Tag: uialertviewdelegate

代表的几个UIAlertViews

目前我有一个类在这里和那里popupUIAlertView 。 目前,同一个class级是这些class级的代表(这是非常合乎逻辑的)。 不幸的是,这些UIAlertView会调用类的相同委托方法。 现在,问题是 – 你怎么知道从哪个alert视图中调用委托方法? 我只是想检查警报视图的标题,但这不是那么优雅。 什么是处理多个UIAlertView的最优雅的方式?

无法将UITextField添加到iOS7上的UIAlertView …在iOS 6中可用

下面的代码工作在iOS6(和之前),但UITextField不显示在iOS7 …任何想法如何让UITextField显示在UIAlterView在iOS7? UIAlertView* dialog = [[UIAlertView alloc] init]; [dialog setDelegate:self]; [dialog setTitle:@"Enter ESC Score"]; [dialog setMessage:@" "]; [dialog addButtonWithTitle:@"Cancel"]; [dialog addButtonWithTitle:@"OK"]; dialog.tag = 5; nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)]; [nameField setKeyboardType:UIKeyboardTypeNumberPad]; [nameField becomeFirstResponder]; [nameField setBackgroundColor:[UIColor whiteColor]]; [dialog addSubview:nameField]; CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0.0, 0.0); [dialog setTransform: moveUp]; [dialog show]; [dialog release]; [nameField release]; […]