1

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

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

Community
  • 1
  • 1
Daniel Node.js
  • 6,734
  • 9
  • 35
  • 57

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
  • 811,555
  • 193
  • 1,581
  • 1,452
-1

-> is for Accessing instance variables (Pointers)

Mantar
  • 2,710
  • 5
  • 23
  • 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