2012-02-23 22 views
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
  1. 檢查是否有方法updateWithEvent在FirstViewController之前的LocationManager委託方法
  2. 放置它,或者在定義頭文件這種方法。
相關問題