Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Oct 23, 2018 11:54 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Looking for a performSelector equivalent
PostPosted: Fri Apr 05, 2013 9:30 am 
Offline

Joined: Thu Feb 23, 2006 5:28 pm
Posts: 5
Location: Cary, NC
I am implementing an api in REALBasic where I call a method for each item in an array. The method to call varies, so a class interface is not suitable for a class interface, though the argument signature is the same for each one.

In objective-C I would use performSelector:, in C i would use a function pointer as a callback. Since RB provides the addressOf call to get a pointer to pass to a C function to call back to a RB method, I assume that you can do the same thing and call the method from another realbasic method, but i can't find any examples of the calling syntax. Can some one point me to an example of how to do this?

Thanks in advance!

_________________
Thanks,
Bobby


Top
 Profile  
Reply with quote  
 Post subject: Re: Looking for a performSelector equivalent
PostPosted: Fri Apr 05, 2013 11:40 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Read the documentation about Introspection.
There you can find methods by name and call them.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Looking for a performSelector equivalent
PostPosted: Fri Apr 05, 2013 11:42 am 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Sounds like you want a Delegate.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group