Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: [paper] Full Trait Support for Objective-C (or almost)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paper] Full Trait Support for Objective-C (or almost)



Hamish,

On Jul 28, 2011, at 12:16 AM, Hamish Allan wrote:

> The annoying bit is calling super. [super foo] is resolved at compile
> time, so you need something like:
>
> struct objc_super s = { self, [self superclass] };
> objc_msgSendSuper(&s, @selector(foo));

That won't work well, since super does *not* go to self.superclass -- actually, that's the very reason it's solved compile-time :)

> You could probably use a trampoline in combination with a category on
> NSObject to achieve cleaner syntax, e.g.:
> [[self runtimeSuper] foo];

I believe it would be solveable; nevertheless, myself, I am yet to see a reasonable code which does [super something] in a trait code. So, in my implementation, I simply documented super as invalid with "undefined results" :)

Best,
---
Ondra Čada
OCSoftware:     email@hidden               http://www.ocs.cz
private         email@hidden             http://www.ocs.cz/oc



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >[paper] Full Trait Support for Objective-C (or almost) (From: Lars Sonchocky-Helldorf <email@hidden>)
 >Re: [paper] Full Trait Support for Objective-C (or almost) (From: Ondřej Čada <email@hidden>)
 >Re: [paper] Full Trait Support for Objective-C (or almost) (From: Hamish Allan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.