Hey, stupid newbie question here...
I'm trying to load an image from the Resources folder using initWithContentsOfFile. The code below always writes "Invalid Image" in the log. (And looking at the NSImage object in the debugger shows the "_name" as "Invalid".)
I copied that file into the Resources folder in xCode, and if "View Package Contents" of the build, it's in the Resources folder there too. It's just a png file I saved via Photoshop's "Save for Web" function.
Is there anyway I can figure out what the problem is?
Thanks,
Greg
I'm trying to load an image from the Resources folder using initWithContentsOfFile. The code below always writes "Invalid Image" in the log. (And looking at the NSImage object in the debugger shows the "_name" as "Invalid".)
Code:
image = [[NSImage alloc] initWithContentsOfFile:@"player_ship.png"];
if (![image isValid]) {
NSLog(@"Invalid Image");
}
I copied that file into the Resources folder in xCode, and if "View Package Contents" of the build, it's in the Resources folder there too. It's just a png file I saved via Photoshop's "Save for Web" function.
Is there anyway I can figure out what the problem is?
Thanks,
Greg