Possible Duplicate:
What is “->” in Objective C?
what is the "->" in objective-c? And what is it used for?
It's the same as in C. Objective-C is a strict superset of C, so it inherits all the syntax. In C:
x->y
is the same as:
(*x).y
The syntax *x
dereferences the pointer x
, and .
accesses a property on the result of the dereferencing.
-> is for Accessing instance variables (Pointers)
精彩评论