从服务器获取数据到iPhone sdk

时间:2012-03-27 04:10:08

标签: iphone ios apache nsdata nsmutableurlrequest

我正在开发视频应用程序,其中我的视频可在apache服务器上获得,该服务器具有 192.1.58.1/3434 等链接。该链接包含mp4文件,如a.mp4,b.mp4,c.mp4。当你点击这些链接时,它会在浏览器中加载视频。我的问题是如何将这些链接导入我的iphone应用程序。我尝试了很多,但没有找到解决方案。请帮帮我。

1 个答案:

答案 0 :(得分:0)

UIWebView放入UIViewController(我称之为myWebView)。然后,在您的UIViewController实施文件中,将其添加到您的viewDidLoad方法中。

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSString* myServerString = @"http://192.1.58.1";
    NSURL* myServerURL = [NSURL URLWithString:myServerString];
    NSURLRequest* myRequest = [[NSURLRequest alloc] initWithURL:myServerURL];
    [self.myWebView  loadRequest:myRequest];
}