I have an object that simulates an online resource. Therefore, my object must store the URL of the resource to which it belongs. What to call getter and setter?
MyObject *myObject = [[MyObject alloc] init];
[myObject setURL:url];
myObject.URL = url;
[myObject URL];
myObject.URL;
or it will be better:
MyObject *myObject = [[MyObject alloc] init];
[myObject setURL:url];
myObject.URL = url;
[myObject URL];
myObject.URL;
In the first example, of course, you will need to define a property as follows:
@property (retain, getter = URL, setter = setURL:) NSURL *url;
source
share