NSLogXcode 8.0 beta(8S128d)上没有打印任何内容.printf没有改变
这是我的代码:
NSLog(@"hello from NSLog");
printf("hello from printf");
Run Code Online (Sandbox Code Playgroud)
这是iOS 9模拟器上的输出:
2016-06-17 09:49:10.887 calmapp-dev[28517:567025] hello from NSLog
hello from printf
Run Code Online (Sandbox Code Playgroud)
这是iOS 10 Simulator上的输出:
hello from printf
Run Code Online (Sandbox Code Playgroud) 我想用SiriKit开始锻炼.开始锻炼需要从app扩展程序打开主应用程序.
Apple为INStartWorkoutIntentHandling处理程序提供的样板是
func handle(startWorkout startWorkoutIntent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void) {
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartWorkoutIntent))
let response = INStartWorkoutIntentResponse(code: .success, userActivity: userActivity)
completion(response)
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能从这里打开自己的应用程序?像myapp://workout?action=start&name=pushups 这样的回答似乎没有相关性,因为我没有这个扩展类型UIViewController的extensionContext属性.
最后一个相关位:对于其他操作(暂停,结束)我宁愿不打开主应用程序,而只是暂停在主应用程序中运行的锻炼.我可以使用类似的自定义URL来暂停它,但这会打开应用程序,这是一个额外的不必要的步骤.有什么好方法告诉主应用程序在不打开应用程序的情况下从INExtension中采取特定操作?