I can't live another day without knowing why this is happening. I have an iPhone application using Corelocation and here is the issue:
GPSLocation.m - sends long/lat coordinates which are floats to class UserSettings.m (which is a singleton class)
_
UserSettings.m - Then cast the values into a predefined strings from a float
e.g. strLongitude = [NSString stringWithFormat:@"%f", paramLong];
I can trace out the string just fine NSLog(@"Longitude string is %@", strLongitude);
Some notes about strLongitude
- is in the header file
- property is defined as (nonatomic, retain)
- is synthesized
Now the problem: When I need this variable in another class I can use one of two methods of getting it. Either by a getter [UserSettings getLongitude] or access the property [UserSettings strLongitude]
Then when I then trace out this string I sometimes get a badaccess error or random garbage. If I trace out the string as a float %F it works just fine.
Why is this happening? The string defaults back to the original data type of the variable.
Any help would be appreciated.