beelsebob / CoreParse

A shift/reduce parsing framework for Mac OS X and iOS
BSD 3-Clause "New" or "Revised" License
366 stars 49 forks source link

Including CoreParse in an ARC-enabled iOS project is not trivial #20

Closed ratkins closed 12 years ago

ratkins commented 12 years ago

I'm new to Xcode and iOS and the procedure to add CoreParse into my iOS project is not straightforward. When I do the basic stuff I am still getting linker errors, I believe because of CoreParse's use of categories.

Step-by-step instructions on how best to do this would be helpful.

beelsebob commented 12 years ago

First, so you don't go chasing down allys with nothing at the end – ARC has nothing to do with this at all, ARC and non-ARC code can be linked with each other with no issues at all.

In order to diagnose what your issue is, I need to see what the linker errors are. Could you post them? Using CoreParse in an iOS project should simply be a matter of adding the .a to the project, putting the .hs in a place where Xcode can find them (probably adding a header search path), and setting -ObjC -all_load in your other linker flags. The last step there may not be necessary even in modern ObjC land.

ratkins commented 12 years ago

This is the crux of my problem: I'm sure linking ARC with non-ARC code will work if you know how, I just don't know how :-).

I've done as you said and added CoreParse's .a files to my project, added a header search path and set -ObjC as a linker flag (you're right, according to the comments on this answer http://stackoverflow.com/a/2615407/17294, -all_load is no longer necessary.) My original problem has gone away, now I'm getting the following:

*\ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM map:]: unrecognized selector sent to instance

So it seems the NSArray+Functional.m isn't being linked in.