标签:
(1)post Notification类
[[NSNotificationCenter defaultCenter] postNotificationName:CRMPerformanceNewCellCurrentPageShouldChange object:@(performanceTabConfigure.tab)];
(2) Notification的观察者类
//.h文件 extern NSString *const CRMPerformanceNewCellCurrentPageShouldChange; //.m文件 NSString *const CRMPerformanceNewCellCurrentPageShouldChange = @"CRMPerformanceNewCellCurrentPageShouldChange"; //addObserver [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(currentPageShouldChange:) name:CRMPerformanceNewCellCurrentPageShouldChange object:nil]; // 执行函数 - (void)currentPageShouldChange:(NSNotification*)aNotification { NSNumber *number = [aNotification object]; self.pageControl.currentPage = [number integerValue]; }
标签:
原文地址:http://www.cnblogs.com/Xylophone/p/5330010.html