2010년 3월 11일 목요일

서버에서 다운 받기 - Objective-c

erica 예제 c3-06-Synchronous Downloads


NSURL *url = [NSURL URLWithString: [urlArray objectAtIndex:[which intValue]]];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSURLResponse *response;
NSError *error;

NSData* result = [NSURLConnection sendSynchronousRequest:
theRequest
theRequest returningResponse:&response error:&error];



덤으로 무비 플레이어

- (void) startPlayback : (id) sender
{
MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:self.savePath]];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
[theMovie play];
}

댓글 없음:

댓글 쓰기