Just when I think I’m getting comfortable with Objective-c the mentioned symbols totally throw me down a rabbit hole…
** a double pointer??
& what sort of things can I do with &reference, is a @property? a full on object? weird pointer razzledazzle?
± I see both a + or a – before method declarations; I’ve seen Java annotate some datatype declarations by manually typing the + and the magic of compiling in Eclipse would change them to a –
I’m likely asking repetitious questions and/or way outta the ballpark on my guesses; thanks for answers/edits.
As you might know, a pointer points to the address of an object and is the way you reference an object. A double pointer is sometimes used in Objective-C, mainly for returning NSErrors, where you want to get back the address, i.e. a pointer, to an error object (NSError) if an error occurred, thus you pass in a pointer assigned to null and the caller can change that pointer so that it points to the address of another pointer which in turn points to an NSError object.
The ampersand (&) is mostly used by the lower level C APIs, e.g. Core Graphics. They are used to reference things, like the current context. As long as most of your code uses square brackets around its method calls you won’t see these very often.
Using a + or a – before a method declarations is used to differentiate between class (+) and instance (-) methods. A class methods is called on the class itself (such as alloc), while a instance method is called on an instance of that object (such as init).