nasıl kullanılır Uygulamanızda iki viewControllers var FirstViewController
ve DetailViewController
. Bir tablo hücresine dokunduğunuzda, DetailViewController
'a gidin. DetailViewController
'da düzenleme ve reforme eklemek istiyorum NSNotification
Bu sorun için nasıl NSNotification
kullanabilirim?NSNotification
İşte NSNotification
Stuff
-(IBAction) save{
strSelectedText=theTextField.text;
[NSNotificationCenter defaultCenter];
NSNotification* notification = [NSNotification notificationWithName:@"MyNotification" object:self];
[[NSNotificationCenter defaultCenter] postNotification:notification];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (objFirstViewController) name:@"MyNotification" object:nil];
[self.navigationController popViewControllerAnimated:YES];
}
Size http://mac-objective-c.blogspot.com/2009/02/nsnotifications-broadcasting-mechanism.html – Tendulkar
Bu yararlı olabilir bir bildirim için bir görev değildir. Sadece TableViewProgrammingGuide bir göz atın. Buradan başlayabilirsiniz: http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/TableView/Introduction/Introduction.html HTH –
Önerirseniz, bildirim yerine delege desenini kullanmanız daha iyi olur. –