Configuring a Port-based Input Source -- Part 2
Configuring a Port-based Input Source -- Part 2
- Subject: Configuring a Port-based Input Source -- Part 2
- From: John Love <email@hidden>
- Date: Mon, 26 Jan 2009 08:55:31 -0500
[continuation -- part 2]
Here is where my mainCtrl parm comes into play, because instead of
Apple's:
Within my
do
{
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
beforeDate:[NSDate distantFuture]];
} while (![mainCtrl shouldExit]);
where my – (BOOL) shouldExit is in my main Thread.
Am I still on the right track? I definitely am off-base somewhere
because there is no evidence that mainCtrl's –shouldExit is even
called? Anyway, I'm almost finished, so let me continue.
Further, I just use: [self sendCheckInMessage:distantPort];
and within Apple's – (void) sendCheckinMessage :(NSPort*)bgndPort,
they have:
NSPort* myPort = [NSMachPort port];
Apple states: "Create and configure the worker thread port". Is
myPort a local main Port for the worker thread port to send its
message back to? And if so, why is this required because doesn't
Cocoa know about the main port that it presumably created when it
called:
NSApplicationMain(argc, (const char **)argv);
at the very start within "main.m"?
One last basic question -- where exactly should my –
doSomeSuperLongCalculation method go? Should it be sandwiched somehow
within –shouldExit,? Is it inserted within the main thread's –
handlePortMessage, or is it placed within the above do-while loop?
John Love
Touch the Future! Teach!
P.S. Hope I don't get bumped again for excessive length.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden