New to Objective-c I think that a pointer should be used when creating a new object, such as < / P>
class * var = ....
Now, I also understand that when this object is called, let's say in one method, once It has already been made, we do not need to use the pointer, right?
What other example (s) should, in the outside of the object, should we use the * symbol?
After
You always use the signal, because OOP-objects are allocated on the heap and in C-Objects (which casts the object, runs everything "bacterial" on the runtime and says an address with OOP-objects) Pointer is always used with allocated storage class. For OOP-objects, this is an indicator of the object, which is called the object reference.
In Detail:
NSString * pointer = [NSString new]; // pointer is an indicator for objects, an object reference ... [pointer doSomething]; // pointer * is an indicator, so an indicator * is used.
Perhaps you want to ask, when to use asterisk *
for the object reference as NSString *
? Only one type definition (including casting), because in an expression it means the dereference indicator will result in an OOP-object (not a reference) but you always use the indicator for the OOP-object .
[* Pointer doSomething]; * Pointer is an object but you know the receiver of messages using an indicator, no object