保存来自 URL 的流

发布于 2024-10-19 08:59:37 字数 1602 浏览 4 评论 0原文

在我的项目中,我正在连接一个 url,并使用 MPMoviePlayerViewController 观看视频。但这对我来说还不够。我还想将文件保存到我的 iPhone 上。我必须按钮。一是观看视频,二是保存视频。当我按下手表按钮时,我正在观看它。但无法保存。通过这个我希望能够稍后观看视频。因此,在另一种视图中,我想查看保存的视频等。有没有人可以帮助我或可以指明方向?我尝试过以下代码短语,但是当代码开始时,它会工作一段时间(可能是下载时间),但是当需要保存时,我收到 Bad EXC_BAD_ACCESS 错误。谢谢大家。
这是我的代码。

CFStringRef *docsDirectory =  (CFStringRef)[NSTemporaryDirectory() stringByAppendingPathComponent: @"recordedFile.mp4"];


NSString *temPath=NSTemporaryDirectory();
NSString *tempfile=[temPath stringByAppendingPathComponent:@"recode.mp4"];


NSLog(@" DOSYA ADI MADI %@",docsDirectory);


NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = [[NSError alloc] init];

[fileManager removeItemAtPath:docsDirectory error:&error];

NSURL *url = [NSURL URLWithString:@"http://video.teknomart.com.tr/3-13-2.mp4"];

NSMutableURLRequest *liveRequest = [[NSMutableURLRequest alloc] initWithURL:url];
[liveRequest setCachePolicy:NSURLRequestReloadIgnoringCacheData];

[liveRequest setValue:@"headervalue" forHTTPHeaderField:@"headerfield"];

NSURLResponse *response;
NSData *myData = [NSURLConnection sendSynchronousRequest:liveRequest returningResponse:&response error:&error];
NSData *myData2 = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://video.teknomart.com.tr/3-13-2.mp4"]];

NSString *myString=[[NSString alloc] initWithData:myData encoding:NSASCIIStringEncoding];

NSLog(@"gelen sey %@",myString);

[myString writeToFile:tempfile writeToFile:tempfile automatically:YES encoding:NSASCIIStringEncoding error:nil];

 [myString release];
return true;

In my project I am connecting a url and I am watching a video with MPMoviePlayerViewController. But that is not enough to me. I also want to save the file to my Iphone. I have to buttons. one is watch the video, the other is save the video. When I push the button watch I am watchng it. But unable to save it. by this I want to be able to watch the video later. So in another view I want to see saved videos etc. Is there any one can help me or can show the way ? I have tried following code phrase but When the code started, It works for a while (probably it is the download time), but when it is time to save I get Bad EXC_BAD_ACCESS error .Thanks every one.
Here is my code .

CFStringRef *docsDirectory =  (CFStringRef)[NSTemporaryDirectory() stringByAppendingPathComponent: @"recordedFile.mp4"];


NSString *temPath=NSTemporaryDirectory();
NSString *tempfile=[temPath stringByAppendingPathComponent:@"recode.mp4"];


NSLog(@" DOSYA ADI MADI %@",docsDirectory);


NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = [[NSError alloc] init];

[fileManager removeItemAtPath:docsDirectory error:&error];

NSURL *url = [NSURL URLWithString:@"http://video.teknomart.com.tr/3-13-2.mp4"];

NSMutableURLRequest *liveRequest = [[NSMutableURLRequest alloc] initWithURL:url];
[liveRequest setCachePolicy:NSURLRequestReloadIgnoringCacheData];

[liveRequest setValue:@"headervalue" forHTTPHeaderField:@"headerfield"];

NSURLResponse *response;
NSData *myData = [NSURLConnection sendSynchronousRequest:liveRequest returningResponse:&response error:&error];
NSData *myData2 = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://video.teknomart.com.tr/3-13-2.mp4"]];

NSString *myString=[[NSString alloc] initWithData:myData encoding:NSASCIIStringEncoding];

NSLog(@"gelen sey %@",myString);

[myString writeToFile:tempfile writeToFile:tempfile automatically:YES encoding:NSASCIIStringEncoding error:nil];

 [myString release];
return true;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟花易冷人易散 2024-10-26 08:59:37
-(void)viewDidLoad {   

 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }
        NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        NSString *appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
        NSLog(@"%@",[myWords lastObject]);
        NSURL *url = [NSURL fileURLWithPath:appFile];
        NSLog(@"%@",url);
        [[UIApplication sharedApplication] setStatusBarHidden:YES];
        self.navigationController.navigationBarHidden=YES;
        currentTimer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(showCurrentTime) userInfo:nil repeats:YES];
        alarmTimeLabel.text =alarmTimeString;
        alarmSongLabel.text = [myWords lastObject] ;
        [self performSelector:@selector(loadVideoInBackground)];
        //[NSThread detachNewThreadSelector:@selector(loadVideoInBackground) toTarget:self withObject:nil];


    }

    -(void)loadVideoInBackground
    {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }
        NSString *appFile;
        NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
        NSFileManager *fileMgr=[NSFileManager defaultManager];
        if (![fileMgr fileExistsAtPath:appFile]) {
            alarmCanPlay = FALSE;
            NSURL *imageURL = [[[NSURL alloc] initWithString:songNameString]autorelease];
            NSURLRequest *imageRequest = [NSURLRequest requestWithURL:imageURL 
                                                          cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:120.0];
            imageConnection = [[NSURLConnection alloc] initWithRequest:imageRequest delegate:self];

            if(imageConnection)
            {
                videoData = [[NSMutableData data] retain];
            }

        }
    }


    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
    {

        // this method is called when the server has determined that it
        // has enough information to create the NSURLResponse
        // it can be called multiple times, for example in the case of a
        // redirect, so each time we reset the data.
        // receivedData is declared as a method instance elsewhere
        [videoData setLength:0];

    }
    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {
        // append the new data to the receivedData
        // receivedData is declared as a method instance elsewhere
        //NSLog(@"%d",[data size]);
        [videoData appendData:data];
    }

    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
    {
        // release the data object
        [videoData release];

        // inform the user
        NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);
        //workInProgress = NO;
    }

    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }
        NSString *appFile;
        NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
        [videoData writeToFile:appFile atomically:YES];
        alarmCanPlay = TRUE;
    }
-(void)viewDidLoad {   

 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }
        NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        NSString *appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
        NSLog(@"%@",[myWords lastObject]);
        NSURL *url = [NSURL fileURLWithPath:appFile];
        NSLog(@"%@",url);
        [[UIApplication sharedApplication] setStatusBarHidden:YES];
        self.navigationController.navigationBarHidden=YES;
        currentTimer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(showCurrentTime) userInfo:nil repeats:YES];
        alarmTimeLabel.text =alarmTimeString;
        alarmSongLabel.text = [myWords lastObject] ;
        [self performSelector:@selector(loadVideoInBackground)];
        //[NSThread detachNewThreadSelector:@selector(loadVideoInBackground) toTarget:self withObject:nil];


    }

    -(void)loadVideoInBackground
    {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }
        NSString *appFile;
        NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
        NSFileManager *fileMgr=[NSFileManager defaultManager];
        if (![fileMgr fileExistsAtPath:appFile]) {
            alarmCanPlay = FALSE;
            NSURL *imageURL = [[[NSURL alloc] initWithString:songNameString]autorelease];
            NSURLRequest *imageRequest = [NSURLRequest requestWithURL:imageURL 
                                                          cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:120.0];
            imageConnection = [[NSURLConnection alloc] initWithRequest:imageRequest delegate:self];

            if(imageConnection)
            {
                videoData = [[NSMutableData data] retain];
            }

        }
    }


    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
    {

        // this method is called when the server has determined that it
        // has enough information to create the NSURLResponse
        // it can be called multiple times, for example in the case of a
        // redirect, so each time we reset the data.
        // receivedData is declared as a method instance elsewhere
        [videoData setLength:0];

    }
    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {
        // append the new data to the receivedData
        // receivedData is declared as a method instance elsewhere
        //NSLog(@"%d",[data size]);
        [videoData appendData:data];
    }

    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
    {
        // release the data object
        [videoData release];

        // inform the user
        NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);
        //workInProgress = NO;
    }

    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }
        NSString *appFile;
        NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
        [videoData writeToFile:appFile atomically:YES];
        alarmCanPlay = TRUE;
    }
变身佩奇 2024-10-26 08:59:37
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    if (!documentsDirectory) {
        NSLog(@"Documents directory not found!");
    }
    NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
    NSString *appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
    NSLog(@"%@",[myWords lastObject]);
    NSURL *url = [NSURL fileURLWithPath:appFile];
    NSLog(@"%@",appFile);
self.videoMPPlayer =[[MPMoviePlayerController alloc] init];
            videoMPPlayer.view.frame = CGRectMake(0, 0, 768, 1024);
            videoMPPlayer.scalingMode = MPMovieScalingModeAspectFill;

            videoMPPlayer.controlStyle = MPMovieControlStyleNone;
            videoMPPlayer.shouldAutoplay = NO;
            [videoMPPlayer pause];
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    if (!documentsDirectory) {
        NSLog(@"Documents directory not found!");
    }
    NSArray *myWords = [songNameString componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
    NSString *appFile = [documentsDirectory stringByAppendingPathComponent:[myWords lastObject]];
    NSLog(@"%@",[myWords lastObject]);
    NSURL *url = [NSURL fileURLWithPath:appFile];
    NSLog(@"%@",appFile);
self.videoMPPlayer =[[MPMoviePlayerController alloc] init];
            videoMPPlayer.view.frame = CGRectMake(0, 0, 768, 1024);
            videoMPPlayer.scalingMode = MPMovieScalingModeAspectFill;

            videoMPPlayer.controlStyle = MPMovieControlStyleNone;
            videoMPPlayer.shouldAutoplay = NO;
            [videoMPPlayer pause];
别想她 2024-10-26 08:59:37

这就是我的代码中的内容。看起来像是正在下载电影。但我找不到该文件。我也在模拟器中运行它。以我的电影名命名的 nofile 位于 tmp 目录中。有什么问题或缺失吗?

-(void)viewDidLoad
 {

    [super viewDidLoad];
    NSString *documentsDirectory = NSTemporaryDirectory();
    if (!documentsDirectory) {
        NSLog(@"Documents directory not found!");
    }
    downloaded=FALSE;

     NSString *appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4"];

    NSURL *url = [NSURL fileURLWithPath:appFile];
    NSLog(@"%@",url);
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    self.navigationController.navigationBarHidden=NO;

    timer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(showVideo) userInfo:nil repeats:YES];

    [self performSelector:@selector(loadVideoInBackground)];
    [NSThread detachNewThreadSelector:@selector(loadVideoInBackground) toTarget:self withObject:nil];
    }

 -(void)showVideo{

    NSString *homeDir = NSHomeDirectory();


    NSString *tempDir = NSTemporaryDirectory();

    // Format output
    NSString *s = 
    [NSString stringWithFormat:@"homeDir:\n"
     @"%@\n"
     @"tempDir:\n"
     @"%@\n",
     homeDir,
     tempDir];
    NSLog(@" %@ ",s);



        if (downloaded) {

                NSLog(@"burdayim");

        NSString *documentsDirectory = NSTemporaryDirectory();
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }

        NSString *appFile;
        appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4" ];
         NSString *filePath = [[NSBundle mainBundle] pathForResource:@"myvoview" ofType:@"mp4" inDirectory:@"/tmp"];  
                NSLog(@" %@  lafta oynatilan dosya ",filePath);



            NSFileManager *fileMgr=[NSFileManager defaultManager];
            if (![fileMgr fileExistsAtPath:filePath]) {
                NSLog(@"dosya yok");
            } 
            else        
            {

                NSLog(@"dosyayi da buldum");


        NSURL *movieURL = [NSURL fileURLWithPath:appFile];

            NSLog(@" %@  lafta oynatilan dosya ",appFile);
        MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];



        [player setFullscreen:YES];
        [self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft];
     player.fullscreen=YES;
        //self.view.autoresizesSubviews=YES;
        //[self presentModalViewController:player animated:YES];



    self.view=player.view;

        [player play];
            }

    }
    }

-(void)loadVideoInBackground{ 

NSString *documentsDirectory = NSTemporaryDirectory();

if (!documentsDirectory) {
NSLog(@"Documents directory not found!");
}

NSString *appFile;
    appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4" ];
    NSFileManager *fileMgr=[NSFileManager defaultManager];
    if (![fileMgr fileExistsAtPath:appFile]) {

        NSURL *videoURL = [[[NSURL alloc] initWithString:@"http://video.teknomart.com.tr/3-13-2.mp4"] autorelease];
        NSURLRequest *videoRequest = [NSURLRequest requestWithURL:videoURL 
                                                      cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:120.0];
        videoconnection = [[NSURLConnection alloc] initWithRequest:videoRequest delegate:self];

        if(videoconnection)
        {
            videoData = [[NSMutableData data] retain];
        }

    }
}


- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{


    //[videoData setLength:0];

}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    // append the new data to the receivedData
    // receivedData is declared as a method instance elsewhere
    NSLog(@" bisiler yukleniyor ");
    [videoData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
[videoData release];

NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    if (!documentsDirectory) {
        NSLog(@"Documents directory not found!");
    }else
{
    NSString *appFile;
    appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4"];
    [videoData writeToFile:appFile atomically:YES];
    downloaded = TRUE;
    NSLog(@"Yuklandi");
}

    }
}

This is What I have in my code. It looks like it is downloading movie . But I cant find the file. also I run it in the similator . nofile that named with my moviename was in tmp dir. What is wrong or missing ?

-(void)viewDidLoad
 {

    [super viewDidLoad];
    NSString *documentsDirectory = NSTemporaryDirectory();
    if (!documentsDirectory) {
        NSLog(@"Documents directory not found!");
    }
    downloaded=FALSE;

     NSString *appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4"];

    NSURL *url = [NSURL fileURLWithPath:appFile];
    NSLog(@"%@",url);
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    self.navigationController.navigationBarHidden=NO;

    timer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(showVideo) userInfo:nil repeats:YES];

    [self performSelector:@selector(loadVideoInBackground)];
    [NSThread detachNewThreadSelector:@selector(loadVideoInBackground) toTarget:self withObject:nil];
    }

 -(void)showVideo{

    NSString *homeDir = NSHomeDirectory();


    NSString *tempDir = NSTemporaryDirectory();

    // Format output
    NSString *s = 
    [NSString stringWithFormat:@"homeDir:\n"
     @"%@\n"
     @"tempDir:\n"
     @"%@\n",
     homeDir,
     tempDir];
    NSLog(@" %@ ",s);



        if (downloaded) {

                NSLog(@"burdayim");

        NSString *documentsDirectory = NSTemporaryDirectory();
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
        }

        NSString *appFile;
        appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4" ];
         NSString *filePath = [[NSBundle mainBundle] pathForResource:@"myvoview" ofType:@"mp4" inDirectory:@"/tmp"];  
                NSLog(@" %@  lafta oynatilan dosya ",filePath);



            NSFileManager *fileMgr=[NSFileManager defaultManager];
            if (![fileMgr fileExistsAtPath:filePath]) {
                NSLog(@"dosya yok");
            } 
            else        
            {

                NSLog(@"dosyayi da buldum");


        NSURL *movieURL = [NSURL fileURLWithPath:appFile];

            NSLog(@" %@  lafta oynatilan dosya ",appFile);
        MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];



        [player setFullscreen:YES];
        [self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft];
     player.fullscreen=YES;
        //self.view.autoresizesSubviews=YES;
        //[self presentModalViewController:player animated:YES];



    self.view=player.view;

        [player play];
            }

    }
    }

-(void)loadVideoInBackground{ 

NSString *documentsDirectory = NSTemporaryDirectory();

if (!documentsDirectory) {
NSLog(@"Documents directory not found!");
}

NSString *appFile;
    appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4" ];
    NSFileManager *fileMgr=[NSFileManager defaultManager];
    if (![fileMgr fileExistsAtPath:appFile]) {

        NSURL *videoURL = [[[NSURL alloc] initWithString:@"http://video.teknomart.com.tr/3-13-2.mp4"] autorelease];
        NSURLRequest *videoRequest = [NSURLRequest requestWithURL:videoURL 
                                                      cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:120.0];
        videoconnection = [[NSURLConnection alloc] initWithRequest:videoRequest delegate:self];

        if(videoconnection)
        {
            videoData = [[NSMutableData data] retain];
        }

    }
}


- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{


    //[videoData setLength:0];

}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    // append the new data to the receivedData
    // receivedData is declared as a method instance elsewhere
    NSLog(@" bisiler yukleniyor ");
    [videoData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
[videoData release];

NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    if (!documentsDirectory) {
        NSLog(@"Documents directory not found!");
    }else
{
    NSString *appFile;
    appFile = [documentsDirectory stringByAppendingPathComponent:@"mymoview.mp4"];
    [videoData writeToFile:appFile atomically:YES];
    downloaded = TRUE;
    NSLog(@"Yuklandi");
}

    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文