I developed an IOS Framework (objective C) and want to integrate it in Kony project. The Framework function to be called will display a UIView.
This function was used in Kony project to load the UI :
- (void)viewDidLoad {
[super viewDidLoad];
GlobalVariables = [GlobalVars sharedInstance];
CameraBioselfie *cam;
cam =[[CameraBioselfie alloc] init];
[self presentViewController:cam animated:YES completion:nil];
[self.view addSubview:[cam window]];
dispatch_group_t group = dispatch_group_create(); dispatch_group_async(group,dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^ {
while (GlobalVariables.response.length==0 && GlobalVariables.error.length==0){
}
if(GlobalVariables.response.length==0){
self.result =GlobalVariables.error;
}
else if([GlobalVariables.response containsString:GlobalVariables.username]){
self.result = @"Recognized";
}
else{
self.result = GlobalVariables.response;
}
NSArray *status = @[self.result];
[self.callbackfunction executeWithArguments:status];
dispatch_sync(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];
});
});
}
When it gets to this line:
[self.view addSubview:[cam window]];
I receive the following error:
This application is modifying the auto layout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Please note that if the framework is integrated in an Xcode objective c project and called the same way, i don't have this issue