Xcode warning "Property access results unused - getters should not be used for side effects" Xcode warning "Property access results unused - getters should not be used for side effects" xcode xcode

Xcode warning "Property access results unused - getters should not be used for side effects"


The dot notation (i.e. self.fetchLetter) is meant for properties, not for arbitrary methods. The self.fetchLetter is being interpreted as "get the 'fetchLetter' property of 'self'," which isn't what you intend.

Just use [self fetchLetter] instead.


In newer Xcode versions, even the [object method]; may trigger the warning. But sometimes we actually do need to call a property and discard the result, for example when dealing with view controllers and we need to make sure the view is actually loaded.

So we were doing:

// Ensure view is loaded and all outlets are connected.[self view];

This now also triggers the “Property access results unused - getters should not be used for side effects” warning. The solution is to let the compiler know it's done intentionally by casting the result type to void:

(void)[self view];


You're declaring fetchLetter using syntax like this?

@property (retain) id fetchLetter;

That looks wrong for what you're doing. Properties are intended to be variable accessors that (in the case of getters) don't have any side effects.

You should declare fetchLetter as a method, like so:

- (void) fetchLetter;

and access it using:

[self fetchLetter]