If those lines are being called in order and you are getting that message it looks you are over releasing the systemTimeZone somewhere. It just so happens that a valid NSString*
is occupying the memory where the cached systemTimeZone was stored.
According to the documentation:
Special Considerations
If you get the system time zone, it is
cached by the application and does not change if the user subsequently
changes the system time zone. The next time you invoke systemTimeZone,
you get back the same time zone you originally got. You have to invoke
resetSystemTimeZone to clear the cached object.
So consider this
NSTimeZone *systemTimeZone = [NSTimeZone systemTimeZone];
NSLog(@"%lf", [systemTimeZone daylightSavingTimeOffset]); //This works
[systemTimeZone release]; //Testing release do not actually do this
systemTimeZone = [NSTimeZone systemTimeZone];
NSLog(@"%lf", [systemTimeZone daylightSavingTimeOffset]); //This works
[systemTimeZone release]; //Testing release do not actually do this
systemTimeZone = [NSTimeZone systemTimeZone];
NSLog(@"%lf", [systemTimeZone daylightSavingTimeOffset]); //This crashes EXC_BAD_ACCESS
//The cached systemTimeZone at this point has been over released.
Where I get my EXC_BAD_ACCESS
it would also be possible for an NSString* to reside there as I mentioned earlier and that would result in exception being raised. So just make sure you are not improperly releasing it anywhere.