• 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
NSNumberFormatter issue with method -setLocale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumberFormatter issue with method -setLocale


  • Subject: NSNumberFormatter issue with method -setLocale
  • From: Ulf Dunkel <email@hidden>
  • Date: Thu, 24 Feb 2011 16:44:05 +0100
  • Organization: invers Software

Mac OS 10.6.6 and Xcode 3.2.5:

I am playing with NSNumberFormatter stuff for various custom number edit fields, which will e.g. be used to auto-format dpi values, degree values, document measurement values with various format strings, etc.

I currently receive an EXC_BAD_ACCESS, with the following relevant code lines in the relevant method:

- (id)init
{
  [...]
  [self setFormatterBehavior:NSNumberFormatterBehavior10_4];
  return self;
}

- (void)setNewFormatString
{
  NSLocale *autoLocale = [NSLocale autoupdatingCurrentLocale];
  NSString *localeIdentifier = [autoLocale localeIdentifier];

  NSLog(@"%@", localeIdentifier);  // outputs e.g. "fr_CA"

  [self setLocale:autoLocale];     // <-- EXC_BAD_ACCESS

   // more formatting stuff
  [...]
}

I cannot find what I am doing wrong. Can you help, please?

---Ulf Dunkel
_______________________________________________

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: NSNumberFormatter issue with method -setLocale
      • From: Ulf Dunkel <email@hidden>
    • Re: NSNumberFormatter issue with method -setLocale
      • From: Ulf Dunkel <email@hidden>
  • Prev by Date: Re: Using asynchronous APIs with NSOperation
  • Next by Date: Re: Fast way to grab the screen
  • Previous by thread: Re: Using asynchronous APIs with NSOperation
  • Next by thread: Re: NSNumberFormatter issue with method -setLocale
  • Index(es):
    • Date
    • Thread