我有一个JWGeoGame
具有这些属性的类:
@interface JWGeoGame : NSObject{
JWCountry *hidden,*last,*prev;
}
@property (nonatomic) JWCountry *hidden;
@property (nonatomic) JWCountry *last;
@property (nonatomic) JWCountry *prev;
//some methods
@end
但是,每当我尝试设置它们中的任何一个时,都会收到一个神秘的错误:
Implicit conversion of Objective-C pointer type 'Class' to C pointer type 'struct objc_class *' requires a bridged cast.
此错误发生在以下场景的ech中:
self.prev=self.last;
self.prev=nil;
当我尝试使用它们进行比较时:
if (guess == self.hidden)
return FOUND;
我得到另一个错误:
Member reference type 'struct objc_class *' is a pointer, did you mean ->?
但是当我尝试 -> 时出现此错误:
Member reference base type 'Class' is not a structure of union.
显然,我在这里做错了什么,但无论我看多少个例子,我都无法弄清楚是什么。我怎样才能解决这个问题?
编辑:
JWCountry 目前只是一个骨架:
@interface JWCountry : NSObject{
NSInteger index;
}
@property NSInteger index;
@end