Skip to content

Commit

Permalink
moved +load to +initialize in a couple of cases; except for automatic…
Browse files Browse the repository at this point in the history
… registration, we should be doing class initialization in +initialize because this is after the other classes have loaded.
  • Loading branch information
Dan Wood committed Feb 12, 2007
1 parent 0d54492 commit fa08531
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion iMBMusicFolder.m
Expand Up @@ -31,7 +31,20 @@ copy of this software and associated documentation files (the "Software"),

@implementation iMBMusicFolder

+ (void)load
+ (void)initialize // preferred over +load in most cases
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

NSBundle *bndl = [NSBundle bundleForClass:[self class]];
NSString *iconPath = [bndl pathForResource:@"MBiTunes4Song" ofType:@"png"];
sSongIcon = [[NSImage alloc] initWithContentsOfFile:iconPath];
iconPath = [bndl pathForResource:@"iTunesDRM" ofType:@"png"];
sDRMIcon = [[NSImage alloc] initWithContentsOfFile:iconPath];

[pool release];
}

+ (void)load // registration of this class
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

Expand Down
2 changes: 1 addition & 1 deletion iMediaBrowser.m
Expand Up @@ -55,7 +55,7 @@ - (id)observedObject;

@implementation iMediaBrowser

+ (void)load
+ (void)initialize // preferred over +load in most cases
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
_browserClasses = [[NSMutableArray alloc] init];
Expand Down

0 comments on commit fa08531

Please sign in to comment.