我有一个名为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]
没有任何错误。为什么?差异是什么?