Re: Creating a Big and Resizable Question Mark in the Middle of a View
Re: Creating a Big and Resizable Question Mark in the Middle of a View
- Subject: Re: Creating a Big and Resizable Question Mark in the Middle of a View
- From: Peter Zegelin <email@hidden>
- Date: Mon, 16 Aug 2010 14:39:21 +1000
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 <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden