My guess is that one of the blocks implemented a new class and "closed" the previous one (started with @end).
One of the blocks does contain
two @end, it is from one of your examples:
#if objc
- (NSObject*)createCircularRegion:(double)lat :(double)lon :(double)radius :(NSString*)identifier {
return [[CLCircularRegion alloc] initWithCenter:CLLocationCoordinate2DMake(lat, lon) radius:(CLLocationDistance)radius identifier:identifier];
}
@end
@interface B4ILocationManager (beacon)
@end
@implementation B4ILocationManager (beacon)
- (void)locationManager:(CLLocationManager *)manager
didExitRegion:(CLRegion *)region {
[B4IObjectWrapper raiseEvent:self :@"_regionexit:" :@[region]];
}
- (void)locationManager:(CLLocationManager *)manager
didEnterRegion:(CLRegion *)region {
[B4IObjectWrapper raiseEvent:self :@"_regionenter:" :@[region]];
}
- (void)locationManager:(CLLocationManager *)manager
monitoringDidFailForRegion:(CLRegion *)region
withError:(NSError *)error {
NSLog(@"Error: %@", error);
[B4IObjectWrapper raiseEvent:self :@"_statechanged:" :@[@(3)]];
}
- (void)locationManager:(CLLocationManager *)manager
didStartMonitoringForRegion:(CLRegion *)region {
NSLog(@"Start monitoring: %@", region);
}
- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)State forRegion:(CLRegion *)region {
NSLog(@"didDetermineState: %@", @(State));
[B4IObjectWrapper raiseEvent:self :@"_statechanged:" :@[@(State)]];
}
#End If
When in doubt, check the generated Objective C modules.
Ok, I tried that now, and then I tried changing the order of the blocks. Sure, they switched place in the generated file, but I couldn't see anything that seemed obviously wrong. That said, I know next to nothing about ObjC, so that might be the problem of course.
Would it be possible to summarize the situation with a rule? Something like "If an inline objc block contains @end it must also contain X", or something like that?