1

In IB, I put an Image View object in app window, and dragged a tiff from the finder into that space, turned off editing, and positioned/sized the image as a header banner. Looked fine in IB, but when built and ran, ImageView object is there only as a background filled box (without my tiff).

Could someone explain what steps I am missing or point me to an existing relevant answer? Cheers!

PS: By banner I only mean a static image, nothing to do with html, nor iOS.

2 Answers2

0

Have you put the image in an NSURL or CGImage variable? I haven't worked with any of the image frameworks lately but I know that the app needs to know where the image is. That's the first thing I would look at.

RJ Hill
  • 308
  • 1
  • 5
0

I didn't know you could drag an image from the Finder into an NSImageView. What I would do is add the image to the Xcode project, so that it will be added to the built app. Then the name of the image should appear in the list of choices for the image in the IB inspector for the NSImageView.

JWWalker
  • 22,385
  • 6
  • 55
  • 76
  • Thanks for the suggestions. The IKImageView object accepts images dragged in from Finder, however no permanent linkage is auto-coded - which is where I am stuck. Unfortunately, if I add the image file to the app bundle, the inspector for the image object in IB fails to show it - so that doesn't do the job either. – Mr Anderson Feb 29 '12 at 00:39
  • from cocoadev.com, me :)), and thanks again: // Header 'IBOutlet *NSImageView imageView;' // Source 'NSImage *imageFromBundle = [NSImage imageNamed:@"your_image.tif"];' '[imageView setImage: imageFromBundle];' – Mr Anderson Feb 29 '12 at 00:55