• 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: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB


  • Subject: Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 14 Jan 2016 17:47:37 -0600

On Jan 14, 2016, at 4:38 PM, Alex Kac <email@hidden> wrote:
>
> I have a NIB with two views that I want to use depending on circumstances. I call one “weatherCell” and one “weatherCellNarrow”.
>
> I register it like this:
>
> - (NSString*)identifierForWeatherCell {
> 	return _narrowView ? @"weatherCellNarrow":@"weatherCell";
> }

> nib = [[NSNib alloc] initWithNibNamed:@"WeatherCell" bundle:nil];
> [self.outlineView registerNib:nib forIdentifier:self.identifierForWeatherCell];

I don't think you should register the NIB for one identifier or the other.  You should register it for both.  The "active" identifier is the one used for the call to -makeViewWithIdentifier:owner:, but there's no reason to be stingy with the registration.

Regards,
Ken


_______________________________________________

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


References: 
 >NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB (From: Alex Kac <email@hidden>)

  • Prev by Date: Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
  • Next by Date: Re: OT: Swift Code Autoformatter?
  • Previous by thread: Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
  • Next by thread: Auto Layout and Multiline labels iOS 8
  • Index(es):
    • Date
    • Thread