When I get a selector passed to my method, should I just save it:
-(void) setCallBack:(SEL) selectorToCall
{
self->mSelectorToCall = selectorToCall;
}
or should I retain?
-(void) setCallBack:(SEL) selectorToCall
{
self->mSelectorToCall = [selectorToCall retain];
}
No, the SEL type isn't an object reference, it's basically a constant string pointer. You can just assign it as in your first example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With