Re: Is there a self?
Re: Is there a self?
- Subject: Re: Is there a self?
- From: Uli Kusterer <email@hidden>
- Date: Mon, 14 Nov 2005 21:59:13 +0100
Am 14.11.2005 um 21:29 schrieb Brian O'Brien:
Does main have a 'self' object and are selectors possible off of
that self?
No. It's a function. Functions are standalone. Only methods are
bound to an object and therefore have a "self".
I have a simple Foundation tool that I am using to test my
framework code.
The framework starts a thread and requires that the class that
started the thread pass a pointer of the instance of the class
that started it... In this case main created the thread...
What you actually want to do is create an object and create the
thread from there. An "application controller", so to say. Put your
code in that, and all you do in main() is create that object and
maybe call a few methods on it.
PS - I presume you already verified this, but for the archives in
case a newbie stumbles over this, I thought it worth mentioning that
you need to make sure the framework is intended to work without an
NSApplication at all. Classes that call methods on delegate objects
frequently require a run loop to process events for them, otherwise
your app will quit before the other thread has even sent a single
method call to your delegate.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden