Re: How do I know what class sent a message?
Re: How do I know what class sent a message?
- Subject: Re: How do I know what class sent a message?
- From: Wade Tregaskis <email@hidden>
- Date: Mon, 7 Jun 2004 15:23:50 +1000
I need to be able to init a class and pass it info then tell the
sending class to perform a selector when it's done example
-(void)setupDatabase setupEndedSelector:(SEL)selector
when I reach the point I need to perform the selector I have two
problems.
1 how do I know the class that called this method?
2 do I call it as follows:
[sendingClass performSelector:@selector(selector:)]; ?
or
[sendingClass performSelector:selector]; ?
There's no way to find the caller of your method, at least not without
doing nasty things peeking at the stack.
The simplest and recommended way to do exactly what you want is to pass
in the object manually. However, I suspect for your use here that you
might be better of using notifications. See the documentation for
NSNotificationCenter and the like.
Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.