NSNumberFormatter 10.0+ style exception with zero
NSNumberFormatter 10.0+ style exception with zero
- Subject: NSNumberFormatter 10.0+ style exception with zero
- From: Howard Moon <email@hidden>
- Date: Wed, 07 May 2014 09:34:04 -0700
Hi,
is the 10.0+ style of NSNumberFormatter no longer supported? I recently moved from developing in Xcode3 under OS X 10.7 to Xcode 4 under OS X 10.8, and from having a Base SDK of 10.6 to 10.7, and from a Deployment Target of 10.5 to 10.6, and am now having problems with my xib-base NSTextFields connected to an NSNumberFormatter. The formatter uses the 10.0+ style, allowing me to set the "Zero" field, which I am setting to the string N/A. This worked fine, even when running in 10.8 or 10.9, but crashes now that I've compiled under these new conditions.
Here is the call stack when the exception is thrown:
2014-05-07 08:32:15.225 Cubase 7.5[947:707] -[__NSCFString string]: unrecognized selector sent to instance 0x1050188d0
2014-05-07 08:32:15.226 Cubase 7.5[947:707] NSInvalidArgumentException - -[__NSCFString string]: unrecognized selector sent to instance 0x1050188d0
0 CoreFoundation 0x00007fff92b32aee __exceptionPreprocess + 174
1 libobjc.A.dylib 0x00007fff8b8b13f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff92bc940a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff92b2102e ___forwarding___ + 414
4 CoreFoundation 0x00007fff92b20e18 _CF_forwarding_prep_0 + 232
5 Foundation 0x00007fff93bc592b -[NSNumberFormatter(NSNumberFormatterCompatibility2) __oldnf_stringForObjectValue:] + 192
6 AppKit 0x00007fff8bd2ba93 -[NSCell _stringForEditing] + 83
7 AppKit 0x00007fff8bd35a32 -[NSCell _skipsSynchronizationForEditingTextView:] + 34
8 AppKit 0x00007fff8bc5e43f -[NSCell setObjectValue:] + 296
9 AppKit 0x00007fff8bc5e2fd -[NSTextFieldCell setObjectValue:] + 43
10 AppKit 0x00007fff8be51cbd -[NSCell _setIntegerValue:] + 196
11 AppKit 0x00007fff8be47f49 -[NSControl setIntValue:] + 138
...
I am simply calling setIntValue with a value of 0, which in previous builds would set the text field's text to "N/A". But now this exception is thrown, and I don't know why or what to do about it. If the 10.0 style of NSNumberFormatter is no longer supported, why is it still available in Xcode 4, and why does it compile and run, up to the point I set its value to 0?
Thanks,
-Howard
_______________________________________________
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