Question

I'm trying to follow the example on http://developers.cloudmade.com/wiki/iphone-sdk/Create_basic_Local_Search_and_Geocoding_app .

The example from svn provided there runs fine. But when I create my own projects and copy things from there thing gets weird.

I keep on getting the following error:

2012-03-29 13:09:57.300 TimGeoCoding[2863:1480b] -[GLViewController cm_invokeOnMainThread]: unrecognized selector sent to instance 0x6877020

2012-03-29 13:09:57.362 TimGeoCoding[2863:1480b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GLViewController cm_invokeOnMainThread]: unrecognized selector sent to instance 0x6877020'

* First throw call stack:

(0x15a9022 0x1b61cd6 0x15aacbd 0x150fed0 0x150fcb2 0x40a11 0xce04d6 0xce0447 0x9627ded9 0x962816de) terminate called throwing an exception

I even created a projects and just started to copy example codes into my code (only fixing the ARC issues and added one line [RMMapView class] on viewDidLoad ) but it still breaks. I googled cm_invokeOnMainThread and that one person has the same problem and solved it. But the person didn't post the solution. Any help appreciated.

Was it helpful?

Solution

OK it turns out that I did not follow the instruction closely as describe here: How_to_setup_Xcode_to_work_with_CloudMade_iPhone_Library

Instead of closely following instructions (which is on Xcode 3), I link the libraries in Target->Build Phases->Link binary with Libraries. This compiles fine, but it's not getting the categories correctly from the static libraries as the result of a problem documented here: what-does-the-all-load-linker-flag-do.

So basically I added the linker flags -ObjC -all_load and voila, problem solved.

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