• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
IKImageView Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IKImageView Question


  • Subject: IKImageView Question
  • From: <email@hidden>
  • Date: Mon, 24 May 2010 16:36:22 -0500
  • Sensitivity: Normal

I've been trying a few tests with IKImageView to view an EPS file with zooming capabilities.  Some code that Apple provides works well... however I'm getting a warning -> "warning: 'IKImageView' may not respond to '-setImage:'".  Instead of using the NSURL (which doesn't seem to work with EPS images in my tests), I'm using NSImage.  The IKImageView documentation states:

-------------------
You can provide an images for the view in any of these formats:

File reference (NSURL, CFURLRef, or a path)
CGImageSourceRef
Data (NSData or CFDataRef)
Image (NSImage, CGImageRef, or CIImage)
-------------------

Just curious why I'm getting this warning since I'm using a NSImage?  My next thought was to convert the NSImage to a CGImageRef, but that looks pretty in-depth.  I thought if I converted it, maybe I could use:

- (void)setImage:(CGImageRef)image imageProperties:(NSDictionary *)metaData

Is there a correct way to code this in order to use a NSImage?

Thanks.

Jay

--

Here's my code so far:

- (void)openTheImage: (NSImage*)theImage
{
	NSSize imageSize = [theImage size];
	imageSize.width *= 5;
	imageSize.height *= 5;
	[theImage setSize:imageSize];
	[mImageView setImage:theImage];
	/* -----------------------------------
	   WARNING HAPPENS HERE:
	   warning: 'IKImageView' may not respond to '-setImage:'
	   (Messages without a matching method signature will be
	   assumed to return 'id' and accept '...' as arguments.)
	------------------------------------ */
}

- (void)awakeFromNib
{
    NSString *path = [[NSBundle mainBundle] pathForResource: @"TestImage" ofType: @"eps"];
    anImage = [[NSImage alloc] initWithContentsOfFile:path];
    [self openTheImage: anImage];
    [mImageView zoomImageToFit: self];
}

_______________________________________________

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

  • Follow-Ups:
    • Re: IKImageView Question
      • From: Brian Postow <email@hidden>
  • Prev by Date: Re: NSDoc's Magic File Watcher Ruins Core Data Migration [SOLVED]
  • Next by Date: Re: NSDoc's Magic File Watcher Ruins Core Data Migration [SOLVED]
  • Previous by thread: Re: How can i disable "multiple selection" on a NSTextView
  • Next by thread: Re: IKImageView Question
  • Index(es):
    • Date
    • Thread