i have a class to read barcode, and when i read barcode i post a notification to NSNotificationCenter as below .
-(void)barcodeData:(NSString *)barcode type:(int)type {
barcodeValue = barcode;
[[NSNotificationCenter defaultCenter] postNotificationName:@"BarcodeRead" object:self];
}
then in a few view controller i add observer to get barcode value as like as .
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(BarcodeRead) name:@"BarcodeRead" object:nil];
-(void) BarcodeRead
{
//
}
the question is when a notification is send to notification center, in all of the view which i add observer they get the notification and call the method BarcodeRead, but i want if the application is in view controller "A" just A get the notification and not all of them.
thanks for any help