03 Apr 2009, 04:12
Generic-user-small

whitman stone (19 posts)

hi bill.

I’m converting some of your stage 1 code to iphone beta 2 3.0

by going into ApplicationServices/ImageIO I got most of the CGImageSource stuff to compile and run. I just import the CGImageSource.h header file.

But when I try to link I get problems with CGImageSourceCreateWithURL and CGImageSourceCreateImageAtIndex – but when I look online other programmers seem to be using these methods on the iPhone just fine. they’re part of ImageIO

I get an error during the link, and each method is prefixed with an underscore as in _CGImageSourceCreateImageAtIndex and _CGImageSourceCreateWithURL

Both calls are definitely present in the CGImageSource.h file.

Am I not linking to an object file that I need? Which one? When I try to link to ApplicationServices or to ImageIO I am told they can’t be found and their names appear in red in the project tree.

Any clarity you could bring would be much appreciated.

Whitman

03 Apr 2009, 20:25
Biopic_100x100_pragsmall

Bill Dudney (917 posts)

Hi Whitman,

Well iPhone SDK 3 beta 2 is under NDA so I can’t talk about that.

However, ImageIO is not part of the iPhone SDK 2.x so you can’t use it in that version of the SDK.

The short way to get the same basic functionality is to use UIImage imageNamed: or imageWithData: and then get the CGImageRef from the UIImage with the CGImage method. You need to be careful with the memory management here as imageNamed: will cache the image data. Great feature if you know about it, memory hog if you don’t expect that.

Good luck!

14 Apr 2009, 23:56
Generic-user-small

whitman stone (19 posts)

Thanks, Bill. Sorry, forgot about the NDA for 3.0. Are we allowed to discuss it openly on the Apple Developer forums?

15 Apr 2009, 05:26
Biopic_100x100_pragsmall

Bill Dudney (917 posts)

Hi Whitman,

Yep, AFAIK anyway.

Thanks again!

  You must be logged in to comment