objective c - NSNotificationCenter selector won't work with its NSNotification -
I am working on the Cocoa project in some (I know, objc is in the ...) and am Trying to understand NSNotificationCenter
s >>
/ P>
[[NSNotificationCenter defaultCenter] addObserver: auto selector: @selector (selName :) name: @ "notName" object: zero]; I have a callback function: int callback (/ * args * /) {structName * f = ... NSAutoreleasePool * autoreleasepool = [ [NSAutoreleasePool alloc] init]; [[NSNotificationCenter defaultCenter] postNotificationName: @ "Nomenclature" object: [[NSValue valueWithPointer: f] Maintenance]]; [Autoreilpool release]; }
and then for my selector:
- (zero) selName: (NSNotification *) note {NSLog (@ "here"); NSLog (@ "Note is %%", note); }
Now, if I comment on the second NSLog
, then everything seems to work (i.e. "here" is printed). But if I leave it, nothing is working about NSNotification
but to defeat the object of the NSNotification
object, user, etc. looks like.
What am I doing and how can I fix this so that I can reach them my structName f
?
@ Nathan is okay, so now I have
nssxide * dict = [NSDL dictionary with point of view: [NSVLUE with point pointer: f]: @ "FK "]; // F, N and F. There was a typo in my OP that I had decided. [[NSNotificationCenter defaultCenter] postNotificationName: @ "Nomenclature" object: zero user information: [retaining word]];
... but the problem remains.
Edit:
The problem continues with changing the two lines from the top
[[NSNotificationCenter defaultCenter] postNotificationName: @ "notName" Object: Null user information: [Object with NSDictionary dictionary: [NSData dataWithBytes: f length: sizeof (structName)] forKey: @ "fkey"]];
What are you doing differently?
Comments
Post a Comment