On 6 Aug 2008, at 10:03 PM, Maxwell, Adam R wrote:

> On 08/06/08 12:18, "Christiaan Hofman" <[EMAIL PROTECTED]> wrote:
>
>> No, it's not a related to preferences not being written. It is a
>> genuine bug triggered by code in Skim. However it's a bug in the
>> system frameworks or the objective-c runtime, the system is messing  
>> up
>> loading code. I've filed a bug report with Apple about this and
>> implemented a workaround in Skim.
>>
>> And to 'explain' what Matthieu describes in his second mail: when you
>> set the "jump" setting while Skim is running, Skim will notice, but
>> when you've got this pref set *before* launching Skim, Skim won't
>> notice. The reason is probably because this system pref is read  
>> around
>> the time it loads the code, at the time the problem occurs.
>>
>> For people knowing Objective-C: the problem occurs when you send / 
>> any/
>> message to the NSScroller class in the +load method in an NSScroller
>> category.
>
> I think messaging a class from its own +load is a bad idea, but it  
> would be
> interesting to hear what the objc-language list thinks; I really  
> doubt it's
> a runtime bug.  At least one side effect is that messaging the class  
> from a
> +load will cause +initialize to be sent immediately [1], so any  
> setup it
> does in +initialize will happen before your +load finishes.
>
> -- 
> Adam
>
> [1] http://lists.apple.com/archives/objc-language/2004/Mar/msg00006.html


The docs don't tell me not to do it. And I'm not using methods that  
assume anything, e.g. just the following is sufficient:

@implementation NSScroller (Stupid)
+(void)load{ [self class]; }
@end

So at a minimum it's a documentation bug. And probably it's an  
implementation bug in +[NSScroller initialize], I guess that  
implementation does make assumptions about when it's called.

Christiaan


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to