設置從類B類值在Objective-C,我想從類B
只需在Objective-C
這是我的代碼設置Compass
甲級synthesized (assigned)
屬性...
for(Compass * ind in CompassList){
if([[(Compass*)ind showAnalog] isEqualToString:str]){
ind.analogValue=11.0;
}
}
不過,我得到這個錯誤...
Request for member analogValue in something not a structure or union.
我設法用自己的二傳手,把它像避免這種錯誤0。然而,當我在另一個班級後像[(Compass*)currentDevice analogValue];
致電合成消氣,我得到下面的異常...
'NSInvalidArgumentException': [Compass digitalValue]: unrecognized selector sent to instance 0x613ca20
可能有人請幫助我明白我應該怎麼做這個。
1.請向我們展示Compass的聲明。 2.在B類接口文件中,你是否在導入聲明的地方導入了頭文件? – Chuck 2011-03-30 21:05:06
是的,我正在導入B類 – 2011-03-30 21:18:07