2
votes

ARC error: "receiver type 'FirstViewController' for instance message does not declare a method with selector 'updateWithEvent'"

I know it is because of ARC, in xcode 4.2, but can anyone help with how to fix this:

- (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];
}

The errors are occurring at each of the [self updateWithEvent:event]; lines.

Any help would be great, thank you

1
The error in this case tells you that self here whatever it may be does not implement updateWithEvent. What is self in this case and is it supposed to implement updateWithEvent? - Rupert Horlick
I don't think this has anything to do with ARC. You're just missing a method declaration somewhere, as others have stated. - Brad Larson

1 Answers

1
votes
  1. Check that you have method updateWithEvent in FirstViewController
  2. Place it before LocationManager delegate methods or define this method in header file.