经常在代码里面写弹出提示框,太多次了。
何不来个宏定义
#define MSG(title, msg, ok) { if (msg != nil && [msg length] > 0) {UIAlertView* alert = [[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:ok otherButtonTitles:nil] autorelease]; [alert show]; }}
如果你不用autorelease 记得最后用[alert release];