开发者

Open a POST reply in mobile safari

this is my question: I make a POST requesto to www.aaa.com :

NSString *post =[[NSString alloc] initWithFormat:@" bll bla ",importo];
NSURL *url=[NSURL URLWithString:@"http://www.aaa.com"];

NSLog(@"POST: %@",post); 
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding
    allowLossyConversion:YES];
... bla bla bla....
[request setHTTPBody:postData];
[request setValue:userAgent forHTTPHeaderField:@"User-Agent"];
httpRes开发者_运维百科ponse = [[NSMutableString alloc] init];
NSURLConnection *connection = [[NSURLConnection alloc] 
    initWithRequest:request 
    delegate:self];
[connection release];

i receive a response and all is ok! but in

- (void) connectionDidFinishLoading:(NSURLConnection *)connection

i want open the response page in mobile safari, not in a uiwebview, probably i must change approach, anyone have suggestion?


If you want to open URL in Safari, call:

[[UIApplication sharedApplication] openURL: yourUrl];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜