Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- (NSString *) stringFromDate:(NSDate *)date formatString:(NSString *)dateFormat timeZone:(NSTimeZone *)timeZone App got crashed. #80

Open
shaikshabana opened this issue Feb 15, 2018 · 0 comments

Comments

@shaikshabana
Copy link

Here is crash log:

0 libdispatch.dylib 0x1d3191be _dispatch_semaphore_dispose + 80 (semaphore.c:69)
1 Foundation 0x1e510b20 -[NSDateFormatter dealloc] + 74 (NSDateFormatter.m:291)
2 libobjc.A.dylib 0x1cee9258 objc_object::sidetable_release(bool) + 238 (NSObject.mm:1591)
3 ISO8601DateFormatter 0x0117e522 -[ISO8601DateFormatter stringFromDate:formatString:timeZone:] + 228 (ISO8601DateFormatter.m:716)
4 ISO8601DateFormatter 0x0117e3e6 -[ISO8601DateFormatter stringFromDate:timeZone:] + 132 (ISO8601DateFormatter.m:697)

When see code we are deallocating formatter but due to crash it's not going further steps where it's getting allocated.

if ([dateFormat isEqualToString:lastUsedFormatString] == NO) {
[unparsingFormatter release];
unparsingFormatter = nil;

	[lastUsedFormatString release];
	lastUsedFormatString = [dateFormat retain];
}

if (!unparsingFormatter) {
	unparsingFormatter = [[NSDateFormatter alloc] init];
	unparsingFormatter.formatterBehavior = NSDateFormatterBehavior10_4;
	unparsingFormatter.dateFormat = dateFormat;
	unparsingFormatter.calendar = unparsingCalendar;
	unparsingFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease];
}

Any inputs to fix this are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant