Hello everyone,
Please help me on this one. The code snippet below output
1
0
Hence, [NSObject load] gets called, [NSString load] doesn't.
Can anyone explain this behaviour?
Kind Regards
#include <Foundation/NSString.h>
#include <Foundation/NSAutoreleasePool.h>
static int a = 0;
static int b = 0;
@implementation NSObject (objectCategory)
+(void)load {
a = 1;
}
@end
@implementation NSString (stringCategory)
+ (void)load {
b = 1;
}
@end
int main() {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog (@"%d", a);
NSLog (@"%d", b);
[pool release];
}
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep