What's the difference between using obj-c accessors and using dot syntax?

后端 未结 3 1415
故里飘歌
故里飘歌 2020-12-22 10:30

Since I\'ve started on iPhone development I\'ve been kinda confused as to which is the best way to access data as a member in a Class.

Let\'s say I have a class call

3条回答
  •  滥情空心
    2020-12-22 11:09

    The type of the object is statically checked with the . syntax, but not with the [] syntax. This means you can't use . if the object's type isn't specified, and that it is beneficial to use it when it is, so the compiler will help you more.

提交回复
热议问题