I’m working on a quite simple native extension for Adobe Air powered iOS app.
I’m playing with CLLocationManager class and i ran into really strange problem.
When i’m trying to initialize CLRegion object app crashes.
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(0.0, 0.0);
CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:coords radius:100.0 identifier:@"Region1"];`
It doesn’t look like it’s a problem with the extension itself. It works fine, all other functionality works fine. Adding this bit of code is causing a problem.
Has anyone run into this problem as well?
UPDATE
it looks like i have problems with CLLocationManager as well… Sample code:
FREObject ExtensionTest(FREContext ctx, void* funcData, uint32_t argc, FREObject arg[]){
const char *str;
if ([CLLocationManager regionMonitoringAvailable])
{
str = "It works!";
}
else
{
str = "No!";
}
FREObject retStr;
FRENewObjectFromUTF8(strlen(str)+1, (const uint8_t *)str, &retStr);
return retStr;
}
And that’s what i get while tesing app on iphone 4 device…
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xe1590002
Crashed Thread: 0
Solved.
Ensure you have specified the Apple iOS SDK correctly under the Native Extensions tab of your Apple iOS build packaging in your project settings. With default setup it should be…
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk