Reputation:
Please tell me the difference between test.length
and [test length]
?
Which is more usefull for iOS developement?
Upvotes: 0
Views: 258
Reputation: 4409
They are the same. Sometimes it may (!) be better to use one or the other for readability of your code.
Upvotes: 0
Reputation: 10864
No difference in meaning, they both access length
property.
Their only difference is syntactic.
Check Apple documentation about sending a message to an object
Upvotes: 8
Reputation: 181077
test.length
is just a convenience syntax introduced in Objective C 2.0. The two expressions you list are totally equivalent and a matter of preference more than anything else.
Upvotes: 2