Gibt es eine Möglichkeit, einzelne Benachrichtigungen zu posten und zwei verschiedene Objekte zwei verschiedene Methoden ausführen zu lassen?Einzelmeldung an mehrere Objekte?
[[NSNotificationCenter defaultCenter] postNotificationName:@"locationAdded" object:nil];
OBJECT ONE:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadAnnotations:)
name:@"locationAdded"
object:nil];
OBJECT TWO:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadAnnotations:)
name:@"locationAdded"
object:nil];
. . .
Oder, wie ich vermute, würde ich brauche zwei separate Mitteilungen mit eindeutigen Namen schreiben (dh)
[[NSNotificationCenter defaultCenter] postNotificationName:@"updateTable" object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"updateMapView" object:nil];
und rufen [[NSNotificationCenter defaultCenter] postNotificationName: @ "locationAdded" object: nil]; – Andriy