• 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 & NSNumber
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IBOutlet & NSNumber


  • Subject: Re: IBOutlet & NSNumber
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 13 Oct 2012 22:52:32 -0500

On Oct 13, 2012, at 9:49 PM, Randy Widell wrote:

> Quick question…  For some reason I cannot find an answer.
>
> I have a NSWindowController subclass and I want to bind the selection index of a NSComboBox to a NSNumber that is an IBOutlet of the NSWindowController subclass.  I have a NSNumber object in the window's XIB and the object is linked to the outlet in the subclass, but the outlet is always nil.
>
> Is there something special about NSNumber?  Other object types seem to work.

How could that NSNumber be initialized?  It could only be via -init.  A quick test here shows that [[NSNumber alloc] init] returns nil. I.e. it fails, because that's a nonsensical thing to do.

So is putting an NSNumber in a NIB.  What in the world are you trying to do?  In general, it makes no sense to put things other than views or controller objects into NIBs.  NSNumbers are value objects, suitable for the model layer of your app.

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


  • Follow-Ups:
    • Re: IBOutlet & NSNumber
      • From: Randy Widell <email@hidden>
References: 
 >IBOutlet & NSNumber (From: Randy Widell <email@hidden>)

  • Prev by Date: IBOutlet & NSNumber
  • Next by Date: Re: filtering an array of entities using NSPredicate
  • Previous by thread: IBOutlet & NSNumber
  • Next by thread: Re: IBOutlet & NSNumber
  • Index(es):
    • Date
    • Thread