呼叫起飞时,Urban Airship坠毁
使用Xcode 5.0升级到UrbanAirship 3.0.0,我在调用此代码时遇到错误:
Upgrading to UrbanAirship 3.0.0 with Xcode 5.0, I'm getting an error when calling this code:
[UAirship takeOff:config];
错误是
+[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc
2013-09-19 15:02:31.981 [178:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc'
这不是'在 AirshipConfig.plist
中将inProduction键设置为YES时似乎出现了这一点,这在调用takeOff时是有意义的:填充UAirShip的实例。
这似乎是由于类别 NSJSONSerialization + UAAdditions
。
This doesn't seem to appear when setting the key "inProduction" to "YES" in the AirshipConfig.plist
, which makes sense as calling takeOff: populates the instance of UAirShip.
It seems to be due to the category NSJSONSerialization+UAAdditions
.
对此有何帮助?
谢谢
Any help on this one? Thanks
要修复此问题,必须在Other Linker Flags中包含-ObjC标志在您的项目中构建设置。
To fix this issue, you must include "-ObjC" flag in "Other Linker Flags" found in your projects build settings.
UAirship库3.x现在使用Objective-C类别,因此必须设置此标志以避免运行时异常。
UAirship library 3.x now makes use of Objective-C categories so this flag must be set to avoid the runtime exception.
有关此问题的详细信息,请访问:
Details on the issue can be found here:
https://developer.apple.com/library/mac/qa/qa1490/_index.html
更新了文档:
http://docs.urbanairship.com/build/ios.html#build-settings
http://docs.urbanairship.com/topic_guides/ios_migration.html#linker-flags