Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-27-2009, 05:25 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 98
Default Static library issue on the device

I have created a static library and built it for both Release-Simulator and Release-iPhoneOS. I have one class file in the library that adds two functions to the NSString interface. The function is called __IsURL. When I link to the static library and build and run for iPhone simulator, everything works fine but when I build the project and run it for iPhone OS, I get the below error:

Code:
2009-11-27 10:20:29.906 MyDummy[620:207] *** -[NSCFString __IsURL]: unrecognized selector sent to instance 0xd0a8
2009-11-27 10:20:29.914 MyDummy[620:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString __IsURL]: unrecognized selector sent to instance 0xd0a8'
Any idea what this is? Any help would be appreciated.
__________________
UK Flights
Latest UK Flight information right in your iPhone/iPod Touch. All major UK Airports are available in this brilliant iPhone Application. Download from the iTunes Store.

GuitarMonster: Overdrive
A guitar plugged to an overdrive effect, right in your pocket. Download from the iTunes Store.
XCHG is offline   Reply With Quote
Old 11-27-2009, 06:03 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 98
Default

In fact, I just checked and any interface addition (even the pooular NSDataAdditions) causes this issue when it is inside a static library. You just can't use the code inside them. Any ideas?
__________________
UK Flights
Latest UK Flight information right in your iPhone/iPod Touch. All major UK Airports are available in this brilliant iPhone Application. Download from the iTunes Store.

GuitarMonster: Overdrive
A guitar plugged to an overdrive effect, right in your pocket. Download from the iTunes Store.
XCHG is offline   Reply With Quote
Old 11-27-2009, 06:41 AM   #3 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: London
Posts: 226
Default

Not 100% sure about this, but try adding -ObjC to the "other linker flags" entry in the build configuration. I _think_ it tells the linker to check for obj-c in linked files, but like I said, I'm not 100%... but, hey, it's worth a shot, right?
__________________
SimCap - Simple iPhone and iPad Simulator screen capture
_sjc_ is offline   Reply With Quote
Old 11-27-2009, 06:54 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 98
Default

Quote:
Originally Posted by _sjc_ View Post
Not 100% sure about this, but try adding -ObjC to the "other linker flags" entry in the build configuration. I _think_ it tells the linker to check for obj-c in linked files, but like I said, I'm not 100%... but, hey, it's worth a shot, right?
Hi, thanks for your help. I already had -ObjC added to Other Linker Flags. I fixed the issue though.

For anybody having the same problem, you have to add -all_load to linker flags as well. So add:

-ObjC
-all_load

This will make sure the extensions also get compiled into the code. These two have to be added to BOTH the static library and the project that uses the static library. VERY IMPORTANT they are added to both projects. Hope this helps somebody with the same problem.
__________________
UK Flights
Latest UK Flight information right in your iPhone/iPod Touch. All major UK Airports are available in this brilliant iPhone Application. Download from the iTunes Store.

GuitarMonster: Overdrive
A guitar plugged to an overdrive effect, right in your pocket. Download from the iTunes Store.
XCHG is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 453
13 members and 440 guests
banatary70, dapis, darbsllim, Domele, dre, EdwardMichel, HowEver, ilmman, iOSguru, johnRambo, maryrobertson, Objective Zero, Oral B
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 157,853
Threads: 88,914
Posts: 379,297
Top Poster: BrianSlick (7,072)
Welcome to our newest member, banatary70
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:24 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0