- (void)viewDidLoad
{
NSLog(@"%s", __func__);
// ...
}
在viewDidLoad
台iOS 8 extension中.NSLog
在Xcode中不输出任何内容.不过NSLog
在容器应用程序中照常工作.
如何从扩展中获得调试消息的输出?
- (void)viewDidLoad
{
NSLog(@"%s", __func__);
// ...
}
在viewDidLoad
台iOS 8 extension中.NSLog
在Xcode中不输出任何内容.不过NSLog
在容器应用程序中照常工作.
如何从扩展中获得调试消息的输出?
Steps to debug an app extension:
运行容器应用程序.在这一步中,Xcode将容器APP和APP扩展上传到设备或模拟器.
停止容器应用程序.当您在模拟器中调试时,此步骤很重要.如果您不这样做,Xcode会告诉您模拟器正在使用中.
In Xcode, press menu Debug -> Attach to Process -> By Process Identifer (PID) or Name..., input the app ext's identifier, e.g. com.abc.ContainerApp.MyExtension, to start debugging. Don't forget to set break points. (Update on Aug 25, 2014: you can input MyExtension(your extension's name) directly.)
在设备或模拟器中,打开您的应用程序扩展.
我发现上面的调试步骤在模拟器上的Xcode 6 beta 6和iOS 8 SDK beta 5上不能很好地工作.
解决方案:
断点起作用了.但是我不知道为什么日志(log)没有显示在输出窗口中.