debug的时候,gdb提示获取task失败,后从网上查到解决方法罗列如下:
In the File Menu, select New File -> iPhone OS -> Code Signing -> Entitlements. Name the file “Entitlements.plist" and click ‘Finish’. This creates a copy of the default entitlements file within the project.Select the new Entitlments.plist file and check the “get-task-allow” property. Save the Entitlements.plist file.Select the Target and open the Build settings inspector. In the ‘Code Signing Entitlements’ build setting, type in the filename of the new Entitlements.plist file including the extension. There is no need to specify a path unless you have put the Entitlements.plist file somewhere other than the top level of the project.Click ‘Build’.
大体意思是新建一个签名文件,并在内部增加一个布尔类型的属性“get-task-allow”,标记为true。编辑project 设置,在“Code Signing Entitlements”中填入新建的属性文件名称“Entitlements.plist”,重新编译即可。