Faiz Fareed Faiz Fareed - 1 month ago 10
Objective-C Question

property access result unused - getters should not be used for side effects

I am trying to set title of

UINavigationController
I am using following command
self.title = @"Categories";
it works perfectly, But I needs to name it via an array's object, so I used to put following line of code in
ViewDidLoad
section

self.title =@"%@", currentYouga.yougaName;


and it giving error "property access result unused - getters should not be used for side effects"

S.S S.S
Answer

TRY THIS

self.title =[NSString stringWithFormat:@"%@", [currentYouga yougaName]];

***This Error comes when you access arbitrary methods using dot notation, if yougaName is a method. You cannot access yougaName through dot notation; only properties can access using a method of the same name with dot notation.