Note that there are some explanatory texts on larger screens.

plurals
  1. POscrolling doesn't work when alerview with textfield is called in iOS
    text
    copied!<p>I am trying to add UITextfield in UIAlertview, so that user can enter the required text and after the submit is clicked the respective datas must send to the webservice.</p> <p>Viewcontroller is 320*600 frameset, so am having scrollview for displaying the entire content.</p> <p>While running, when the 'next' button is pressed, alertview with textfield is displayed with no issues, but the moment i click the 'submit' button or 'cancel' button in the alertview, the viewcontroller's scrollview is not working, but the 'back' button in navigation bar for moving to previous controller works good. </p> <p>Code for alertview with textfield is,</p> <pre><code>- (IBAction)next:(id)sender { UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Enter your changes" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Submit Changes", nil]; [message setAlertViewStyle:UIAlertViewStylePlainTextInput]; [message show]; } </code></pre> <p>What could be the reason behind this and why the scrollview is not working properly.</p> <p>UPDATED:</p> <p>The action for 'submit' button is,</p> <pre><code>-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { UIAlertView *approval = [[UIAlertView alloc]initWithTitle:@"success" message:@"Your request is updated " delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [approval show]; text = [[alertView textFieldAtIndex:0] text]; NSLog(@"passed value %@",text);// text returns the entered value } NSURL *url = [NSURL URLWithString:@"http://*******************************"]; NSMutableURLRequest *urlRequest =[[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; NSString * log= [NSString stringWithFormat:@"key=%@&amp;Action=Preview&amp;deal=%d&amp;status=%d,comment=%@",session,value,11,text]; [urlRequest setHTTPBody:[log dataUsingEncoding:NSUTF8StringEncoding]]; [urlRequest setHTTPMethod:@"POST"]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self]; if(connection) { NSLog(@"Request for change"); responseData = [[NSMutableData alloc] init]; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload