2012-05-03 5 views
1

두 개의보기가있는 탭 막대 제어기가 있습니다. 두 번째보기에서 버튼을 누르면 첫 번째보기에 알림이 전송되고 첫 번째보기에서 데이터를 다시로드해야합니다. 그러나 두 번째보기에서 내 첫 번째보기로 전환하면 첫 번째보기 데이터가 다시로드되지 않았습니다. 나는 AQGridview, btw를 사용하고있다.수신 통지 후보기 다시로드

//firstView.m

-(void) reloadGridView: (NSNotification *)notification 
{ 
[_gridView reloadData]; 
} 
- (void)viewDidLoad 
{ 
//notification for added exercise 
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadGridView:) name:@"reloadGridView" object:nil]; 
} 

//secondView.m

- (IBAction)AddExercise:(id)sender 
{ 
     [[NSNotificationCenter defaultCenter] postNotificationName: @"reloadGridView" object: nil]; 
} 

답변

1

그것은 알림을 사용하지 않고 첫 번째 탭의 viewDidAppear에서 reloadData 전화를 아마 좋습니다.