2011-02-09 60 views

回答

1

查看NSNotification Class Reference

在具有getCurrentCycle方法控制器,添加以下內容:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCurrentCycle:) name:@"getCurrentCycle" object:nil]; 

當你想調用getCurrentCycle,補充一點:

[[NSNotificationCenter defaultCenter] postNotificationName:@"getCurrentCycle" object:nil]; 

此外,您將需要更改getCurrentCycle到:

- (void)getCurrentCycle:(NSNotification *)notification 
相關問題