Using a BOOL property

前端 未结 3 1024
忘了有多久
忘了有多久 2020-12-02 05:13

Apple recommends to declare a BOOL property this way:

@property (nonatomic, assign, getter=isWorking) BOOL working;

As I\'m using Objective

3条回答
  •  渐次进展
    2020-12-02 05:53

    Apple recommends for stylistic purposes.If you write this code:

    @property (nonatomic,assign) BOOL working;
    

    Then you can not use [object isWorking].
    It will show an error. But if you use below code means

    @property (assign,getter=isWorking) BOOL working;
    

    So you can use [object isWorking] .

提交回复
热议问题