Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > Callback method...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 957 of 1009
Post > Topic >>

Callback methods

by Sylvain <sam.g@[EMAIL PROTECTED] > Feb 25, 2008 at 11:49 AM

Hello,

I have an object B which fills a buffer (NSData *) buf asynchronously. 
 From my class A, I want to instantiate B but A needs to know when the 
buf buffer is ready.

I would like to know which mechanism I should use:
* Should I pass a pointer to the calling class to B and in B send a 
message to A, like:
(in A:)
B *b = [[B alloc] initWithCaller: a];
- (void) dataReady: (NSData *) buf {doSomethingWith: buf;}
(in B:)
[a dataReady: buf]

* Should I use selectors? (how do I do that)
* Any other idea?

Thanks,
Sylvain.
 




 4 Posts in Topic:
Callback methods
Sylvain <sam.g@[EMAIL   2008-02-25 11:49:07 
Re: Callback methods
Sherman Pendley <spamt  2008-02-25 16:56:10 
Re: Callback methods
Sylvain <sam.g@[EMAIL   2008-02-25 23:12:53 
Re: Callback methods
costello@[EMAIL PROTECTED  2008-02-26 12:46:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:49:57 CDT 2008.