Question

i'm new in iOS programminng. I want to use feedback system with Apptentive SDK in my first App. There is no errors while compiling, but when it start to make connection with Apptentive server, i get this error message:

2013-07-11 15:32:19.438 wishes[11015:c07] Loading ATWebClient_Metrics_Bootstrap
2013-07-11 15:32:19.438 wishes[11015:c07] Loading ATWebClient_SurveyAdditions_Bootstrap
2013-07-11 15:32:19.439 wishes[11015:c07] Loading ATURLConnection_Private_Bootstrap
2013-07-11 15:32:19.439 wishes[11015:c07] Loading ATWebClient_Private_Bootstrap
2013-07-11 15:32:19.439 wishes[11015:c07] Loading ATWebClient_MessageCenter_Bootstrap
2013-07-11 15:32:19.440 wishes[11015:c07] Loading ATToolbar_Bootstrap
2013-07-11 15:32:19.442 wishes[11015:1303] [info] Setting up data manager
2013-07-11 15:32:19.598 wishes[11015:1d03] [info] Creating conversation
**2013-07-11 15:32:19.616 wishes[11015:c07] -[NSManagedObject setup]: unrecognized selector sent to instance 0xa060110
2013-07-11 15:32:19.618 wishes[11015:c07] ** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSManagedObject setup]: unrecognized selector sent to instance 0xa060110'
** First throw call stack:
(0x2ef4012 0x23a0e7e 0x2f7f4bd 0x2ee3bbc 0x2ee394e 0xbc347 0xbc29f 0xf8f5b3 0x2eb3376 0x2eb2e06 0x2e9aa82 0x2e99f44 0x2e99e1b 0x2e4e7e3 0x2e4e668 0x26bffc 0x2afd 0x2a25)
libc++abi.dylib: terminate called throwing an exception**

While searching forums i found, that it could be a problem of CoreData, that Apptentive SDK uses, but as i write, i'm new in iOS developing, so i didn't use CodeData till now.

The code to start connection:

ATConnect *connection = [ATConnect sharedConnection];
connection.apiKey = @"myApiKey";
[connection presentMessageCenterFromViewController:self];

When i uncomment a line with apiKey assign, there is no error.

Please help me if You can.

Was it helpful?

Solution

The problem is that Apptentive uses categories, like setup on NSManagedObject, but in your system those categories are not getting loaded. This issue is a somewhat difficult issue to understand, and the solution is murky and dependent on the version of Xcode you are using.

To force categories to load using a sledge hammer, add this to your "Other linker flags":

-all_load

If that works, then try this much better solution (changing "" to its real name:

-force_load $(BUILD_PRODUCTS_DIR)/<apptentive_library_name>.a 

If that works, then you can try just using this flag:

-ObjC

If you search on this site for the terms "all_load", "force_load", and "-ObjC" you'll find oodles of posts.

OTHER TIPS

In the Apptentive project settings guide, we recommend the following "Other Linker Flags:

Target > Build Settings > Other Linker Flags:

-ObjC -all_load
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top