Tag: 预处理器指令

macros编译器错误

我试着在iOS中创build并显示一个简单的“OK”对话框: #define ALERT_DIALOG(title,message) \ do\ {\ UIAlertView *alert_Dialog = [[UIAlertView alloc] initWithTitle:(title) message:(message) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];\ [alert_Dialog show];\ } while ( 0 ) 如果我尝试在我的代码中使用它: ALERT_DIALOG(@"Warning", @"Message"); 我得到的错误: parsing问题。 预期']' 而错误似乎指向"Message"之前的第二个@ 。 但是,如果我只是复制粘贴macros,我不会得到这个错误: NSString *title = @"Warning"; NSString *message = @"Message"; do { UIAlertView *alert_Dialog = [[UIAlertView alloc] initWithTitle:(title) message:(message) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert_Dialog show]; } […]

确定设备是否是ARM64

我试图做一个iOS 7的调整,以便当一个设备是ARM64它运行一个版本,当它不是它运行另一个(因为浮动为32位和双为64(如果你有一个解决scheme让我知道。) 所以会是这样的 if ARM64 { \\run double code } else { \\run float code }