的Xcode 4.2错误:例如消息的接收器类型不声明的方法与选择器

问题描述:

ARC错误:“接收器类型‘FirstViewController’例如消息不声明具有选择‘updateWithEvent’的方法”的Xcode 4.2错误:例如消息的接收器类型不声明的方法与选择器

我知道它是

- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region  { 
    NSString *event = [NSString stringWithFormat:@"didEnterRegion %@ at %@",  region.identifier, [NSDate date]]; 

    [self updateWithEvent:event]; 
} 


- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { 
    NSString *event = [NSString stringWithFormat:@"didExitRegion %@ at %@",  region.identifier, [NSDate date]]; 

    [self updateWithEvent:event]; 
} 


- (void)locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error { 
    NSString *event = [NSString stringWithFormat:@"monitoringDidFailForRegion %@: %@", region.identifier, error]; 

    [self updateWithEvent:event]; 
} 

错误是在每一个[自updateWithEvent:事件]的发生:因为ARC,在Xcode 4.2,但任何人都可以用如何解决这一问题有所帮助;线。

任何帮助将是巨大的,谢谢

+0

在这种情况下的错误告诉你,自己在这里不管它可能没有实现updateWithEvent。在这种情况下自我是什么,它应该实现updateWithEvent? – 2012-02-23 22:29:24

+0

我认为这与ARC没有任何关系。正如其他人所说,你只是在某处丢失了一个方法声明。 – 2012-02-28 22:35:26

  1. 检查是否有方法updateWithEvent在FirstViewController之前的LocationManager委托方法
  2. 放置它,或者在定义头文件这种方法。