gpt4 book ai didi

ios - Xcode 4.2 错误 : receiver type for instance message does not declare a method with selector

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:53:21 25 4
gpt4 key购买 nike

ARC 错误:“实例消息的接收器类型‘FirstViewController’未声明带有选择器‘updateWithEvent’的方法”

我知道这是因为 ARC,在 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];
}

错误发生在每个 [self updateWithEvent:event];行。

任何帮助都会很棒,谢谢

最佳答案

  1. 检查 FirstViewController 中是否有方法 updateWithEvent
  2. 将其放在 LocationManager 委托(delegate)方法之前或在头文件中定义此方法。

关于ios - Xcode 4.2 错误 : receiver type for instance message does not declare a method with selector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9422357/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com