Saturday, 29 December 2012

To set text inside a alert box text can be a user entered string





UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Selected Country" message:@"You have selected\n\n\n" delegate:self cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
        UILabel *textField;
        textField = [[UILabel alloc] init];
        [textField setBackgroundColor:[UIColor whiteColor]];
        textField.frame = CGRectMake(15, 75, 255, 30); 
        textField.text = @"text";
        textField.textAlignment = UITextAlignmentCenter;
        [alert addSubview:textField];
        [alert show];