1
这里是遇到问题的代码IM:如何在Objective C中全局访问这个变量?
if(DriveInfoDict) {
NSLog(@"%@", DriveInfoDict);
//PrevSpeedsDict = [DriveInfoDict objectForKey: @"speed"];
//NSLog(@"Previous Speed Dict:%@", PrevSpeedsDict);
}
DriveInfoDict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithDouble: CurrentLatitude], @"Lat",
[NSNumber numberWithDouble: CurrentLongitude], @"Long",
[NSNumber numberWithDouble:speedMPH], @"speed",
nil];
在这里,我想设置DriveInfoDict,使功能运行它下一次将有之前的值。我已经剥离了操作员来简化我的问题。
我得到的错误是:EXC-BAD-ACCESS
我是新来的OBJ-C,我不知道如何使这个对象这里访问。一些代码与解释,如果它在H或M文件将是非常有用的。
非常感谢您先生 – TaylorMac
当它允许时 – TaylorMac