Ken,

        That's brilliant and works like a charm.
On 16/08/2010, at 12:36 PM, Ken Ferry wrote:

> Hi Peter,
> 
> That code is fine, but FYI, it can be written more simply and with perhaps 
> slightly improved semantics:
> 
>     [imageView setImage:[NSImage imageNamed:@"Question Mark"]];
> 
> Semantically, it's very similar, but the above will not actually read the 
> file from disk until the image data is needed.  Perhaps your app can start up 
> faster as a result.
> 
> -Ken
> 
> On Sat, Aug 14, 2010 at 9:55 PM, Peter Zegelin <pe...@fracturedsoftware.com> 
> wrote:
> Yep that worked:
> 
>        NSString *file = [[NSBundle mainBundle]pathForResource:@"Question 
> Mark" ofType:@"pdf"];
>        NSData  *data = [NSData dataWithContentsOfFile:file];
>        NSImage *image = [[NSImage alloc] initWithData:(NSData *)data];
>        [imageView setImage:image];
> 
> (I'm using GC).
> 
> thanks!
> 
> 

Thank you and kind regards!

Peter Zegelin
www.fracturedsoftware.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to