• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: IBOutlet to different classes, conditional build
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IBOutlet to different classes, conditional build


  • Subject: Re: IBOutlet to different classes, conditional build
  • From: Trygve Inda <email@hidden>
  • Date: Thu, 24 Feb 2011 20:01:39 +0000
  • Thread-topic: IBOutlet to different classes, conditional build

>
> On 24/02/2011, at 5:56 PM, Trygve Inda wrote:
>
>> The problem is two-fold:
>>
>> 1) How can I have nibs, one with MyObjectClass:NSObject and the other with
>> MyObjectClass:NSPreferencePane where MyObjectClass  is essentially the same
>> but with a few #ifdef to have conditional compilation.
>
> The real problem is that you're trying to define this chimera class in the
> same header. If you split it into two separate headers, each nib only needs to
> know about the header that applies to it. Target Membership will do the rest,
> since the right nib and the right header are part of the same target and
> there's no crosstalk to the other target.

It seems this is not true.

I have:

MyClass.m  (@implementation MyClass) This uses #ifdef to pick the right
header.

MyClassRetail.h   (@interface MyClass : NSPreferencePane)
MyClassAppStore.h (@interface MyClass : NSObject)

MyNibRetail.xib
MyNibAppStore.xib

I have two targets - AppStore and Retail.

I import:

MyClass.m, MyClassRetail.h, MyNibRetail.xib to Retail target
MyClass.m, MyClassAppStore.h, MyNibAppStore.xib to AppStore target.


When I open the Retail nib and create an NSObject, then change it's class to
MyClass... It sees the members from the MyClassAppStore.h file.

It seems .h files are not part of the target really and that it just reads
the .m files to locate the headers... Even though I imported them seperately
and indicated which target I wanted.

How can I share the common code?


_______________________________________________

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

  • Follow-Ups:
    • Re: IBOutlet to different classes, conditional build
      • From: Trygve Inda <email@hidden>
References: 
 >Re: IBOutlet to different classes, conditional build (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: dynamic binding in initializers
  • Next by Date: Re: IBOutlet to different classes, conditional build
  • Previous by thread: Re: IBOutlet to different classes, conditional build
  • Next by thread: Re: IBOutlet to different classes, conditional build
  • Index(es):
    • Date
    • Thread