IOS离线打包,第三方插件回调异常。
该插件会打开一个UIViewController界面,在界面操作完成后,回调出错。代码如下:
-
(void)ScanVin:(PGMethod*)commands
{
if ( commands ) {_CallId = [commands.arguments objectAtIndex:0]; __weak XHScanPlugin* control = self; testViewController* test = [[testViewController alloc]init]; test.callback = ^(NSString *result,NSString* vin,NSString* url, NSString* info) { NSLog(@"Callback"); PDRPluginResult *res = [PDRPluginResult resultWithStatus:PDRCommandStatusError messageAsString:@"test"]; [control toCallback:control.CallId withReslut:[res toJSONString]]; }; [self presentViewController:test animated:YES completion:nil];
}
}
在调 [control toCallback:control.CallId withReslut:[res toJSONString]];时异常,感觉 Plugin Bridge内存被释放了。
0 个回复