1

Possible Duplicate:
What is “->” in Objective C?

what is the "->" in objective-c? And what is it used for?

Community
  • 1
  • 1

2 Answers2

6

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.

Mark Byers
  • 767,688
  • 176
  • 1,542
  • 1,434
-1

-> is for Accessing instance variables (Pointers)

Mantar
  • 2,640
  • 5
  • 22
  • 30
  • 3
    `->` is very very rarely used to access instance variables. Can be done, but no one does it that way. `->` is most often seen in the traditional C role. – bbum Jan 01 '11 at 20:34