在初始化错误中获取不兼容的类型

时间:2011-08-16 22:18:29

标签: objective-c ios ios4

我有一个名为Place的课程:

@interface Place : NSObject <NSCoding> {
    NSString *name;
    double latitude;
    double longitude;
    double radius;
}

-(id) initWithName:(NSString *)nameStr: (double)latitudeVal : (double)longitudeVal : (double)radiusInt;
-(id)initWithCoder:(NSCoder*)decoder;
-(void)encodeWithCoder:(NSCoder*)encoder;
-(NSString *)toFileName;

@property (retain,nonatomic,readwrite) NSString *name;
@property (nonatomic,readwrite) double longitude;
@property (nonatomic,readwrite) double latitude;
@property (nonatomic,readwrite) double radius;

@end

在我的appDelegate我有NSMutableArray的地方

我在不同的课程中也有这个功能:

-(BOOL)registerNewRegion:(NSString *)identifier : (double)latitudeVal : (double)longitudeVal : (double)radius;

我需要的是在此循环中的任何位置激活此方法:

for (Place *place in self.places) {
    NSString *placeName = [place name];
    double placeRadius = [place radius];
    double placeLatitude = [place latitude];
    double placeLongitude = [place longitude];
    [locationService registerNewRegion:placeName:placeLatitude:placeLongitude:placeRadius];
}

我仅在[place latitude][place longitude]上收到此错误。 [place radius]没有任何错误。为什么?差异是什么?

0 个答案:

没有答案