当我尝试在 64 位模式下运行时,我得到的确切错误是Format specifies type 'int' but the argument has type 'long'
.
%d
我可以通过更改为来修复此错误%ld
,但是当我在 32 位(正常)模式下运行应用程序时,我收到一条错误消息:Format specifies type 'long' but the argument has type 'int'
如何同时考虑 64 位和 32 位?我创建了一个 if(condition) 吗?
- (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component {
// Handle the selection
if(pickerView.tag == 1){
start = row+1;
[startButton setTitle:[NSString stringWithFormat:@"%d. %@", row+1, [stops objectForKey:[NSString stringWithFormat:@"%d", row+1]]] forState:UIControlStateNormal];
}else if (pickerView.tag == 2){
stop = row+1;
[endButton setTitle:[NSString stringWithFormat:@"%d. %@", row+1, [stops objectForKey:[NSString stringWithFormat:@"%d", row+1]]] forState:UIControlStateNormal];
}
}