All seems well but image doesn't show up.
All seems well but image doesn't show up.
- Subject: All seems well but image doesn't show up.
- From: David Arnold <email@hidden>
- Date: Sun, 22 Jul 2007 18:37:10 -0700
All,
I've tried to closely follow Mike Beam's "Working With Bitmap Images;
Document-Based Application Redux" at:
http://www.macdevcenter.com/pub/a/mac/2002/04/19/cocoa.html?page=1
Working with the latest version of Tiger and XCode.
My work is here (careful, 1.7 MB):
http://online.redwoods.edu/instruct/darnold/cocoa/ImageApp.zip
Everything seems to be working as it should (as far as I can tell).
When I build and run ImageApp from XCode, I get no window, but I do
get a menu. From the open menu, I select a jpeg image on my system
and the code seems to find it, but the image doesn't show in my
NSImageView.
In my IAWindowController, I have:
@implementation IAWindowController
- (void)windowDidLoad
{
NSImage *image = [[self document] activeImage];
NSLog(@"%@",image);
[view setImage:image];
And the result of that NSLog is the message:
[Session started at 2007-07-22 18:32:59 -0700.]
2007-07-22 18:33:08.077 ImageApp[3767] NSImage 0x37df90 Size={385,
410} Reps=(
NSBitmapImageRep 0x37e920 Size={385, 410}
ColorSpace=NSCalibratedRGBColorSpace BPS=8 BPP=24 Pixels=385x410
Alpha=NO Planar=NO Format=0
)
However, the next line
[view setImage:image];
just won't display the image in my NSImageView.
I've been working on this since yesterday, but I am seriously stuck
at this point. Two things would be helpful:
1. What I can do to fix the problem, and
2. Here is an opportunity to use the debugger (I imagine) to track
down the source of difficulty. The file compiles and runs, but the
image doesn't show up. Does anyone have any good tips on how to debug
a situation like this to try and figure out what is going wrong?
Thanks.
_______________________________________________
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