답변

1

과 같이 비디오를 재생하는 ViewController를 나가면 비디오 재생을 중단 한 시간 값을 NSUserDefault에 저장할 수 있습니다 (여전히 볼 것이 있으면) .

실제로 동영상을 재생하기 전에 viewWillAppear에서이 값을 NSUserDefault에서 확인할 수 있습니다. 예를 들어 키 값이 "timeLeftPlaying" 인 경우이 값으로 직접 비디오를로드 할 수 있습니다.

게터저장하려면 세터 또는 NSUserDefault에서 값을 검색 :

+(NSString *)getTimeLeftPlaying 
{ 
    return [[NSUserDefaults standardUserDefaults] objectForKey:@"timeLeftPlaying"]; 
} 

+(void) setTimeLeftPlaying:(NSString *)timeLeft 
{ 
    [[NSUserDefaults standardUserDefaults] setValue:timeLeft forKey:@"timeLeftPlaying"]; 
    [[NSUserDefaults standardUserDefaults] synchronize]; 

} 

NB : 당신이 재편성하기 위해 사용자 정의 클래스를 작성하는 것이 좋습니다 모든 메서드를 NSUserDefault에 상대적으로 사용하므로 어디서나 쉽게 액세스 할 수 있습니다. 당신이 결코 NSUserDefault 주위를 연주하지 않는 경우

나는이 도움이 링크를 확인 권하고 싶습니다 :

StackOverflow Example

Apple Official Documentation가 당신을 도울하고 당신에게 당신의 기능을 시작하기에 충분한 정보를 제공합니다 바랍니다.