Re: NIB Object instantiation of missing class
Re: NIB Object instantiation of missing class
- Subject: Re: NIB Object instantiation of missing class
- From: Markus Spoettl <email@hidden>
- Date: Wed, 1 Dec 2010 19:17:13 +0100
On Dec 1, 2010, at 6:14 PM, email@hidden wrote:
> On 1 Dec 2010, at 17:08, Markus Spoettl wrote:
>
>> Hello,
>>
>> I have an application for which I need to create a second version that's basically the same but doesn't use a Framework the original uses. I've done this by creating a second target where I removed all references to the framework in the target setup.
>>
>> In a NIB file the application instantiates an object of that framework. Apart from one outlet the object lives by itself and performs tasks in a stand-alone manner, so the app actually won't miss it if it's not instantiated. I'd like to avoid duplicating the nib and removing the object because it would generate a lot of overhead (localization, maintenance, etc.) that isn't justified.
>>
>> Now, it seems to work, all I get is a Console log entry stating that the object class wasn't found and NSObject was used instead. An outlet connected to that object wasn't restored either which generates another log message. Other than that the application behaves correctly.
>>
>> The obvious question is: Is there a better way to do this (that avoids duplication of resources), or is it OK?
>>
>> I'm targeting 10.5 my base SDK is 10.5, so far I only tested on Snow Leopard so I'm not sure if that situation is handled gracefully in Leopard (I assume it is).
>>
>>
> It might be better to instantiate the framework object in code rather than in the nib.
> That way you can conditionally exclude it completely from the build when required.
Yes, you're right, that's by far the easiest solution. Thanks for setting me straight!
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden