• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is there a self?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Is there a self? (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Re: Is there a self?
  • Next by Date: Re: Are these the same and correct?
  • Previous by thread: Re: Is there a self?
  • Next by thread: NSoutlineView Source List Bindings
  • Index(es):
    • Date
    • Thread