Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C Property Access

Tags:

objective-c

What is the difference in accessing an objects properties or methods via foo.property to [foo property]?

like image 312
Rick Avatar asked Sep 09 '09 08:09

Rick


Video Answer


1 Answers

Nothing! Dot-notation is "syntactic sugar" introduced in Objective-C 2.0. In fact, the compiler converts foo.property to [foo property] during compile-time, so they compile to exactly the same thing.

It's simply a matter of which you prefer.

like image 111
iKenndac Avatar answered Sep 27 '22 20:09

iKenndac