Jas*_*RRE 8 objective-c urbanairship.com ios nsjsonserialization ios7
使用Xcode 5.0升级到UrbanAirship 3.0.0,调用此代码时收到错误:
[UAirship takeOff:config];
Run Code Online (Sandbox Code Playgroud)
错误是
+[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'
Run Code Online (Sandbox Code Playgroud)
当将"inProduction"键设置为"YES"时似乎没有出现这种情况AirshipConfig.plist,这有意义,因为调用takeOff:填充UAirShip的实例.这似乎是由于类别NSJSONSerialization+UAAdditions.
对此有何帮助?谢谢
ral*_*ski 16
要解决此问题,必须在项目构建设置中的"其他链接器标志"中包含"-ObjC"标志.
UAirship库3.x现在使用Objective-C类别,因此必须设置此标志以避免运行时异常.
有关该问题的详细信息,请访问:
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