Hi,
I'm initializing a NSCalendar in viewDidLoad like this:
gregorian = [NSCalendar currentCalendar];
The calendar is declared in the corresponding .h file like this:
NSCalendar *gregorian;
When accessing the calendar from a method my app crashes:
- (void)someMethod{
unsigned int unitFlags;
unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit;
[gregorian
components:unitFlags
fromDate:[NSDate date]
toDate:[NSDate date]
options:0];
}
This is what seems relevant from the crash log:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000015
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Application Specific Information:
objc_msgSend() selector name: components:fromDate:toDate:options:
iPhone Simulator 225, iPhone OS 3.2 (iPad/7W367a)
Any ideas ?
Thanks