Hiding properties from public access

后端 未结 6 736
攒了一身酷
攒了一身酷 2020-12-07 22:53

I\'m trying to declare properties that are for internal use only in a Private category as such:

@interface BarLayer (Private)

@property (readwr         


        
6条回答
  •  广开言路
    2020-12-07 23:36

    I just want to add my 2 cents and let people know that it IS possible to add properties to an existing class through Categories (not class extensions). It requires using associative references, but it's really not that bad.

    I wrote a post about it here if anyone would like more details.

    There is also another question that addresses this topic, but it's pretty scant on the details.

    Cheers

提交回复
热议问题