uialertviewdelegate

clickedButtonAtIndex method is not called

末鹿安然 提交于 2019-12-02 11:24:45
when the user click on a button on the UIAlertView the clickedButtonAtIndex method is supposed to be called, however, it doesn't : in the .h i have called the UIAlertView protocol : @interface RechercherViewController : UIViewController<UIAlertViewDelegate> { //code } and in .m file i have this : -(void)requestFailed:(ASIHTTPRequest *)request { //quand il y aura un échec lors de l'envoie de la requête UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"TopStation" message :@"Your internet connexion is down" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert

Several UIAlertViews for a delegate

做~自己de王妃 提交于 2019-11-28 17:47:59
Currently I've got a class popping up UIAlertView s here and there. Currently, the same class is the delegate for these (it's very logical that it would be). Unfortunately, these UIAlertView s will call the same delegate methods of the class. Now, the question is - how do you know from which alert view a delegate method is invoked? I was thinking of just checking the title of the alert view, but that isn't so elegant. What's the most elegant way to handle several UIAlertView s? Tag the UIAlertView s like this: #define kAlertViewOne 1 #define kAlertViewTwo 2 UIAlertView *alertView1 = [

Several UIAlertViews for a delegate

别来无恙 提交于 2019-11-27 10:45:10
问题 Currently I've got a class popping up UIAlertView s here and there. Currently, the same class is the delegate for these (it's very logical that it would be). Unfortunately, these UIAlertView s will call the same delegate methods of the class. Now, the question is - how do you know from which alert view a delegate method is invoked? I was thinking of just checking the title of the alert view, but that isn't so elegant. What's the most elegant way to handle several UIAlertView s? 回答1: Tag the

Unable to add UITextField to UIAlertView on iOS7…works in iOS 6

别来无恙 提交于 2019-11-27 06:43:16
The code below works on iOS6 (and before) but the UITextField does not display in iOS7...any ideas on how to get a UITextField to display in an UIAlterView in 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:

Unable to add UITextField to UIAlertView on iOS7…works in iOS 6

陌路散爱 提交于 2019-11-26 12:55:41
问题 The code below works on iOS6 (and before) but the UITextField does not display in iOS7...any ideas on how to get a UITextField to display in an UIAlterView in 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)];