Re: NIB loading with objects from a static library
Re: NIB loading with objects from a static library
- Subject: Re: NIB loading with objects from a static library
- From: Roland King <email@hidden>
- Date: Sun, 9 Jan 2011 19:58:29 +0800
On 09-Jan-2011, at 7:17 PM, Ken Thomases wrote:
> On Jan 9, 2011, at 4:53 AM, Roland King wrote:
>
>> I have found, by googling, that if I put the following line in before the NIB loads, that's enough to drag enough of the class in for the NIB loader to use it.
>>
>> [ RDKView class ];
>>
>> I'd sort of rather not have to do that in every project I write which uses this static library, because I'll forget and spend 2 days trying to figure it out. Is there a way to make the static library such when it links it includes all methods or some other way not to have to put this method call in or is this just a price you pay for using IB with static libraries?
>>
>> Supplementary question, how can I see what methods are being imported into my final binary from the static library, I'm interested to know how just adding one class method like that causes the linker to pull in the rest.
>
> May I suggest that you read the "ld" man page. It's pretty much all documented there.
>
> There's no way (that I know of) to mark the static library so that it's all always included. That's a function of the link step -- that is, the use of the static library -- but you can use -ObjC (or -all_load or -force_load <path>).
>
> Regards,
> Ken
>
Thank you - I had actually read it and tried all those linker flags .. in the wrong place. I'd tried building the static library with them, you pointed out it's the USE of the static library which requires them, I added -ObjC to the build of the application itself and that worked. Regrettably I still have to remember to do that in any project which uses it but this is just one of those things I'm going to have to remember to do whenever I use static libraries until the day I hope apple adds support for custom IB elements for IOS.
I'll drop a note in my header file to remind me to use that flag.
Thanks again.
_______________________________________________
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