当前位置: 动力学知识库 > 问答 > 编程问答 >

iOS - Open PHP url in uiwebview from IBAction

问题描述:

I have this code inside a IBAction:

NSString *strURL = [NSString stringWithFormat:@"http://www.brmyapps.com/folder/folder/registerpost.php?first_name=%@&last_name=%@&titulo_noticia=%@&comments=%@&idpub=%@&dataevento=%@&email=%@", self.textnome.text, self.textimg.text, self.texttitulo.text, self.textnoticia.text, self.textid.text, self.textdata.text, self.textemail.text];

self.aWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];

self.aWebView.autoresizesSubviews = YES;

self.aWebView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);

[self.aWebView setDelegate:self];

NSString *urlAddress = strURL; // test view is working with url to webpage

NSURL *url = [NSURL URLWithString:urlAddress];

NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

[self.aWebView loadRequest:requestObj];

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];

[[self view] addSubview:_aWebView];

My Problem is that when I click in the button, opens UIWebView but the php url i want to open to send data to php is not loading. Only a blank page is showed.

How can i solve this?

分享给朋友:
您可能感兴趣的文章:
随机阅读: