如何使用xcode将网址从文本发送到字符串

|
NSURL *url;
            NSData *data;
            NSString *blork;
            url = [NSURL URLWithString: @\"http://www.mycompanyaddress.com/identity_check.jsp?cliId=A-00000&security_key=00000\"];
            data = [url resourceDataUsingCache: NO];
            blork = [[NSString alloc] initWithData: data  encoding: NSASCIIStringEncoding];         
            UIAlertView *testMessage = [[UIAlertView alloc] initWithTitle: @\"From Server: \" message: blork  delegate: self cancelButtonTitle: @\"Ok\" otherButtonTitles: nil];
            [testMessage show];
            [testMessage release];
RESOURCEDATAUSINGCACHE现在是已弃用的功能..否则它就像一个魅力
已邀请:
您可以使用 -
NSData *data = [NSData dataWithContentsOfURL:url];
如文件所述 使用
NSURLConnection
代替此方法。

要回复问题请先登录注册