Re: Some advice requested on debugging a difficult problem. iOS.


 



On Mar 26, 2019, at 8:53 AM, Alex Zavatone via Groups.Io <zav@...> wrote:

@property(strong, nonatomic, readwrite,getter=getRootAPIData) NSDictionary *rootUrlMap;

See how we have an accessor defined for rootUrlMap to be getRootAPIData?  (Yes, that get is bad form, i know.)

At the runtime level, properties are implemented as getter and/or setter methods. The `getter=` syntax just lets you rename the getter method. It doesn’t affect the property name.

It seems a little weird that you can use the custom getter method name with property syntax; I guess that’s just because for backward-compatibility reasons Obj-C lets you call any no-arguments method using “.” syntax (if it has a non-void return type.)

I can’t imagine how this would cause any weird results like you’re getting. You get exactly the same compiled code, whichever name you use to access the property.

—Jens

Join cocoa@apple-dev.groups.io to automatically receive all group messages.