阅读背景:

Obj-C中的错误“无法识别的选择器发送到实例”

来源:互联网 

Some information: I have two different classes, "House" and "Treasury". They are both inside the same NSMutableArray called "structures". House has a (int) variable called "ownership". I use a for loop (100 loops) to create houses and treasuries across an area. Then I have another loop that loops through "structures" and assigns an "ownership" integer to it. In that loop I use for(Houses *h in structures) but for some reason the loop also loops through the "treasury"s in structures as well. Treasury has no ownership variable though and so I get that error telling me that "setOwnership:" does not exist. I am also using Cocos2D but that shouldn't matter. I have two different classes,




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: