I tried two ways to debug while the extension is running:
a. using NSlog, such as
NSLog(@"%@", ((NSExtensionItem *)self.extensionContext.inputItems.firstObject).userInfo);
but no log shows.
b. using code like
p self.extensionContext
in the lldb debug mode, but it tells me
error: property 'extensionContext' not found on object of type 'ShareViewController *'
error: 1 errors parsing expression
You need to use simulator debug. On Simulator, click on Debug Menu, Open System Log.
As mentioned HERE , you can debug share extension by attaching target
Debug -> Attach Process -> By process name or PID
In our case, PID will be Share extension bundle name as mentioned in Share Extension Target.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.