【发布时间】:2010-06-26 16:56:06
【问题描述】:
我正在开发一个 iPhone 应用程序,但我在以下方法收到警告:
NSNumber *latitudeValue;
NSNumber *longitudeValue;
[self obtainLatitude:latitudeValue longitude:longitudeValue];
方法声明如下:
- (void) obtainLatitude:(NSNumber *)latitudeValue longitude:(NSNumber *)longitudeValue {
NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
[f setNumberStyle:NSNumberFormatterDecimalStyle];
latitudeValue = [f numberFromString:[latitude.text stringByReplacingOccurrencesOfString:@"," withString:@"."]];
longitudeValue = [f numberFromString:[longitude.text stringByReplacingOccurrencesOfString:@"," withString:@"."]];
[f release];
}
如您所见,我正在尝试计算 latitudeValue 和 longitudeValue 调用 obtainLatitude:longitude: 但我做错了。
我该如何解决这个错误?
【问题讨论】:
标签: iphone objective-c argument-passing