The reason for this warning is that with ARC, the runtime needs to know what to do with the result of the method you're calling. The result could be anything: void, int, char, NSString *, id, etc. ARC normally gets this information from the header of the object type you're working with.3
There are really only 4 things that ARC would consider for the return value:4
- Ignore non-object types (void, int, etc)
- Retain object value, then release when it is no longer used
(standard assumption)
- Release new object values when no longer used (methods in the init/
copy family or attributed with
ns_returns_retained
)
- Do nothing & assume returned object value will be valid in local
scope (until inner most release pool is drained, attributed with
ns_returns_autoreleased
)
This thread explains it in length.