Le 27 juin 2012 à 12:21, Bluna Ratimonkey a écrit :

> Hi Quentin, Banlu,
> 
> On Wed, Jun 27, 2012 at 4:43 PM, Quentin Mathé <[email protected]> wrote:
> Hi Banlu,
> 
> Le 26 juin 2012 à 00:32, Al Chemyth a écrit :
> 
> > Hello,
> > I have several frameworks that I want to register their UTI using 
> > +initialize for each class but I have a problem that the parent class type 
> > may not already be +initialize'd and so I need to manually call [aClass 
> > class] to activate their +initialize's.
> 
> When a class receives +initialize, the runtime ensures its superclasses have 
> received +initialize. See +[NSObject initialize] doc on Apple website.
> You might have stumbled on a runtime bug here.
> 
> 
> The reason that they didn't receive +initialize in order because they aren't 
> subclassing each other.
> eg.  A : NSObject and B : NSObject and B depends on A's initialize to 
> register the type.

ok, I see.

> To support the same mechanism for frameworks, I could add a method +[ETUTI 
> registerTypesForBundle:]… You would just have to call this method with your 
> framework bundle once it it's loaded.
> It might even be possible to enumerate the currently loaded frameworks in 
> +[UTI initialize] and handle that transparently.
> 
> I'd prefer this +[ETUTI registerTypesForBundle:] method and auto handling 
> sounds great.

I just added +registerTypesFromBundle:, see r7768 in SVN. In addition, 
UTIDefinitions.plist and ClassBindings.plist when present in a framework 
Resources directory are loaded transparently too (if the framework is already 
loaded at launch time).

Cheers,
Quentin.
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à