Objective-C 混淆命名 ivars id
因此,在创建自己的类时,通常会使用 id ivar 作为唯一标识符。但由于 Objective-C 中存在 id 类型,当我将 ivar 声明为 int id 时,这会给编译器带来混乱;
那么你如何声明你的 ivar 与持有 id 相关呢?
So when creating an own class it's quite common to have an id ivar that usually acts as a unique identifier. But since in Objective-C there exists the id type this creates confusion for the compiler when I declare my ivar as int id;
So how do you declare your ivar pertaining to hold ids?
只需重命名 ivar:
这样的例子还在继续......
Just rename the ivar:
And the list goes on...