Re: Static library and Objective C categories
Re: Static library and Objective C categories
- Subject: Re: Static library and Objective C categories
- From: Eyal Redler <email@hidden>
- Date: Mon, 28 Jul 2008 04:28:14 +0300
On Jul 27, 2008, at 9:55 PM, Nick Zitzmann wrote:
On Jul 27, 2008, at 11:58 AM, Eyal Redler wrote:
I have an application which links with several (custom - Cocoa
based) static libraries. The static libraries projects are vanilla
"Cocoa Static Library" projects.
The static libraries contain c functions, objective c classes and
some categories for Foundation classes (NSString, NSArray etc.). It
seems that while the c functions and objects operate correctly, the
categories don't. The project compiled and links correctly but the
application crashes when I call one of the category method during
run time.
Is it indeed impossible to define categories in a static library or
is there some setting I need to make?
Try it again, but this time, link the binary using the -all_load
linker flag. Normally the linker only imports the symbols in the
static library it thinks it needs, but every now and then it misses
a spot, and I think that's what's happening here.
Thanks but this didn't work, I've added -all_load to the "Other Linker
Flags" but the code still fails. It also seems quite consistent, it
fails in my main project and in a sample project I've created to
verify the issue.
Maybe I need to add the -all_load flag somewhere else?
Eyal Redler
------------------------------------------------------------------------------------------------
"If Uri Geller bends spoons with divine powers, then he's doing it the
hard way."
--James Randi
www.eyalredler.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden