0

I'm new to iOS and trying to use RestKit.

I'm getting a 'sigabrt' exception during Singleton instantiation dealing with the use of autoRelease.

I noticed that RestKit uses memory management keywords that are not allowed in iOS projects w/ Automatic Reference Counting (ARC) enabled, could this be an issue?

Anyone encountered anything similar?

AlexVPerl
  • 7,652
  • 8
  • 51
  • 83
  • Disable ARC for certain files [here][1] [1]: http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project – Kaan Dedeoglu May 17 '12 at 20:51

3 Answers3

1

I'm surprised you were able to get the project to compile with those keywords.

You will need to use the linker flag -fno-objc-arc in the Compile Sources section of your Build Settings for all RestKit files, or include it as a project that does not use ARC (a much better approach).

Refer to the RestKit installation docs for help on this: https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x . Installing as a git submodule is the way to go imho.

tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
1

You can easily add the library to a project that use automatic reference counting (ARC) by following the steps below.

  1. Add the Rest kit files to your project.
  2. Go to your project settings, select your application's target(s) and click the "Build Phases" tab.
  3. Expand the section named "Compile Sources".
  4. Select all the files from the RestKit library
  5. Hit Enter to edit all the files at once, and in the floating text-box add the -fno-objc-arc compiler flag.

Thanks.

Nikhil Dinesh
  • 3,359
  • 2
  • 38
  • 41
1

OK - found the problem: it seems the '-ObjC -all_load' key disappeared, I thoroughly followed RestKit's install instructions but this seemed to have slipped somehow - jshin thanks for making me look through the installation help again :)

Coming from .NET world I have to say XCode/ObjectiveC feel extremely archaic in comparison, just adding a library is a 10 page manual and not to mention the exception that made no sense what's so ever or gave any useful info - but then again this is coming from someone who's new to iOS :)

AlexVPerl
  • 7,652
  • 8
  • 51
  • 83