So, I have an iOS 9 App that starts a NSOperation extended class and that class' main method it executes a NSRunLoop. I also have implement handleMessage successfully, that is, when I send some parameters to the NSMachPort, it kind of works...
This is the sender:
NSMachPort *rcPort = ((AppDelegate *)[UIApplication sharedApplication].delegate).rController.serverPort;
NSMutableArray *myarray = [NSMutableArray array];
[myarray addObject:@"hello"];
[rcPort sendBeforeDate:[NSDate distantFuture] msgid:666 components:myarray from:nil reserved:0];
My handleMessage does trigger, and I easily get the msgid
- (void)handleMachMessage:(void *)msg {
NSLog(@"got a message");
mach_msg_header_t *msg_t = msg;
NSLog(@" %d ", msg_t->msgh_id);
}
My question is:
I do get the msgid (666), how do I get at the "components" part in handleMachMessage ? I have searched high-and-low, and I cannot find any references or code samples. It seems that handleMachMessage's msg parameter is only a mach_msg_header_t type, however, if I am able to add a "payload", why can't I get access to the said payload in my handleMachMessage?