Re: NSImageRep Trouble
Re: NSImageRep Trouble
- Subject: Re: NSImageRep Trouble
- From: David Remahl <email@hidden>
- Date: Sat, 23 Nov 2002 04:06:11 +0100
Here you need the full path to the image.
NSString *path = [[NSBundle mainBundle] pathForResource:@"Image"
ofType:@"tiff"];
imageRep = [[NSImageRep imageRepWithContentsOfFile:path] retain];
/ rgds David
On Saturday, November 23, 2002, at 03:58 AM, Seth Willits wrote:
I must be missing something. I'm attempting to open an image from the
resources directory in my bundle and then draw it:
ImageRep is an instance variable.
imageRep = [NSImageRep imageRepWithContentsOfFile:@"Image.tiff"];
[imageRep retain]
The file is there in the final product with no typos, but ImageRep is
always
nil.
And then later:
- (void)drawRect:(NSRect)rect
{
...
[imageRep drawAtPoint:point];
}
Seth Willits
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.