在當執行方法的類,我已經把這個:通知沒有得到所謂的
[[NSNotificationCenter defaultCenter] postNotificationName:@"locationFromZipFound" object:array];
,並在這我想收到通知之類的我有這樣的:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(getZipLocation:)
name:@"locationFromZipFound"
object:nil];
問題是,這是從未被稱爲:
-(void)getZipLocation:(NSNotification *)notification; {
NSLog(@"Zip received and put into array!");
NSArray *location = [notification object];
}
任何想法? 在此先感謝。
感謝您的幫助。我通過在'viewDidLoad'中註冊通知來實現它。 – 2010-12-18 17:32:13