Path: utzoo!utgpu!watserv1!watmath!att!rutgers!usc!ucselx!petunia!news From: mdeale@vega.acs.calpoly.edu (Myron Deale) Newsgroups: comp.sys.next Subject: Question about Objective-C's @selector Message-ID: <26a20030.3d07@petunia.CalPoly.EDU> Date: 16 Jul 90 17:58:08 GMT Reply-To: mdeale@vega.acs.calpoly.edu (Myron Deale) Distribution: na Organization: ACS, Cal Poly, San Luis Lines: 22 I have something like [listObject makeObjectsPerform:(SEL)aSelector with:anObject]; but can "aSelector" only be a constant? I have a radio button matrix that inputs a choice between a number of different methods. I would like to set some kind of pointer (ala C's pointer to function), based upon the radio button input, though aSelector would have to be a variable rather than a constant literal. The alternative to a pointer is using a bunch of if-then-else's each with a listObject call. Pretty ugly, but effective. Setting a flag in the target object and branching inside the called method is bad software engineering. -Myron // mdeale@cosmos.acs.calpoly.edu