开发者

Objective-C -> symbol? [duplicate]

开发者 https://www.devze.com 2023-02-02 15:02 出处:网络
This question already has answers here: Closed 12开发者_JS百科 years ago. Possible Duplicate: What is “->” in Objective C?
This question already has answers here: Closed 12开发者_JS百科 years ago.

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消