What is the underlying mechanism for ivar synthesis in the modern Objective C runtime

前端 未结 3 1837
时光说笑
时光说笑 2020-12-13 20:35

One of the features of the modern (64 bit OS X and iPhone OS) Objective C runtime is the ability for properties to dynamically synthesize ivars without explicitly declaring

3条回答
  •  余生分开走
    2020-12-13 21:18

    You add properties at run-time with the NSKeyValueCoding Protocol.

    [myObject setValue:@"whatever" forKey:@"foo"];
    

提交回复
热议问题