Hello,

according to the iOS 4.2 NSDateFormatter class documentation, the -init method 
is available in iOS 2.0 through iOS 3.2, but it does not offer an alternative 
method to initialize a newly allocated date formatter (or, if it does, I missed 
it on repeated readings of the docs). How then?

I went ahead and tried -init anyway and, sure enough, a problem arises:

malloc: *** error for object 0x4d6c9b0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Doing as suggested, I see the following call stack:

#0      0x916d1f82 in malloc_error_break
#1      0x915e1b63 in free
#2      0x0005aa09 in icu::DateFormatSymbols::dispose
#3      0x0005a98c in icu::DateFormatSymbols::~DateFormatSymbols
#4      0x0005a8a6 in icu::SimpleDateFormat::~SimpleDateFormat
#5      0x01165b39 in __CFDateFormatterDeallocate
#6      0x010e9bcb in _CFRelease
#7      0x002963ac in -[NSDateFormatter _regenerateFormatter]
#8      0x0000315d in -[AppDelegate dateFormatter] at AppDelegate.m:144

And here's the -[AppDelegate dateFormatter] method I have:

- (NSDateFormatter*) dateFormatter;
{
    if (dateFormatter_ == nil)
    {
         dateFormatter_ = [[NSDateFormatter alloc] init];

        [dateFormatter_ setLocale:    self.localePtBr];
        [dateFormatter_ setDateStyle: NSDateFormatterShortStyle];
    }

    return dateFormatter_;
}

Thanks in advance.
WT_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to