iOS property declaration clarification

前端 未结 5 1735
春和景丽
春和景丽 2020-12-22 18:24

This is a two part question in hopes that I can understand more about the topic.

1) It seems to me that you have two popular optio

5条回答
  •  心在旅途
    2020-12-22 18:47

    Properties are basically the accessor methods. They define the scope of the variable. First case as given above,the variable is not accessible in other classes whereas by declaring a property as in the second case,variable is accessible in other classes also. Also, they are useful for memory management.

提交回复
热议问题