2014-03-05 1 views

답변

8

ViewDidLoad 메서드에서이 메서드를 호출하십시오 .ViewDidLoad는 iPhone 장치 나 시뮬레이터에 뷰가 표시 될 때 나타납니다. 이

-(void)xyz{ 
     [self performSelectorInBackground:@selector(xyz) withObject:nil]; 
    } 

- (void)viewDidLoad { 
    [self performSelector:@selector(xyz) withObject:nil afterDelay:0.3]; 
} 
1

사용 NSTimer

NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(xyz) userInfo:nil repeats:YES]; 
1

@mokujin에서 언급 한 바와 같이 당신은 NSTimer를 사용해야합니다 같은

[NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(runMethod) userInfo:nil repeats:YES]; 


    -(void)runMethod 

    { 

    }