• 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
"Controller Cannot Be nil" on binding NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Controller Cannot Be nil" on binding NSTextField


  • Subject: "Controller Cannot Be nil" on binding NSTextField
  • From: Johnny Lundy <email@hidden>
  • Date: Tue, 13 May 2008 10:34:58 -0400

Thanks Bill and Graham.

D'oh! I've got dozens of stringWithFormat calls in my main app and this never occurred to me. I was thinking that somehow an NSTextField would take a number and convert it itself.

This will let me merge all three components of the time into one string with separator colons and the whole shebang.

I was looking to use NSDate to get an "hh:mm:ss" result that allowed hours > 24, but I do not think that is possible, so I went the NSCalendarDate route. I remember having the same problem in AppleScript with the time portion of a date.

Thanks a bunch for taking time to clue me in.

Johnny
On May 13, 2008, at 7:27 AM, email@hidden wrote:

From: Bill Cheeseman <email@hidden>
Subject: Re: "Controller Cannot Be nil" on binding NSTextField
To: Cocoa-Dev Mail <email@hidden>
Message-ID: <C44ED57D.6CFF1%email@hidden>
Content-Type: text/plain;	charset="US-ASCII"

on 2008-05-13 12:06 AM, Johnny Lundy at email@hidden wrote:

I still have to do the crazy

self.hoursString = [[NSNumber numberWithInt: self.hours] stringValue];

To get a string from an int for the textField to bind to. If I bind it
to the model deadline.hours, which is a scalar int, it displays zero
while NSLog is merrily displaying 23 from the same variable.


Is converting the int to a NSNumber and then to a string make sense
here? Seems roundabout.

Look at the reference documentation for +[NSString stringWithFormat:], and
the String Programming Guide for Cocoa (particularly the Formatting String
Objects and String Format Specifiers sections).


--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.com

_______________________________________________

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


  • Prev by Date: how to change the rect of an edit text in each cell on an NSTableView?
  • Next by Date: Re: Create NSStrings from a mapped NSData object - safe?
  • Previous by thread: Re: "Controller Cannot Be nil" on binding NSTextField
  • Next by thread: Getting Pixel Data From CIImage
  • Index(es):
    • Date
    • Thread