On 22 janv. 2013, at 18:34, Jean Suisse <[email protected]> wrote:
>
>> myObj = [[myClass alloc] performSelector(@selector("initWithManager:")
>> withObject:self];
>>
>> Would this work?
>>
>
>
> You could do :
>
> id myObj =[myClass alloc];
> myObj = [myObj performSelector(@selector("initWithManager:")
> withObject:myObj];
[Sorry, I did hit send by mistake]
This (above) implies that the manager is self. Not that myObj is used as self
when calling init.
Or you could declare a protocol myProtocol that defines initWithManager: and
have the following declaration for myObj:
id <myProtocol> myObj = …
This would avoid the use of @selector.
You could also test if myObj responds to the selector selector just after
calling alloc.
Jean
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]