Animated-GIF images received as NSData through NSSocket unable to split frames

I'm having trouble with the way iOS handles animated-GIF's. I know that you cannot use animated-GIF's on an UIImageView and you have to use custom animations on the UIImageView.

But..

I have a Java server that sends GIF images through a socketstream. The iOS (iPhone) receives that stream and converts it into an NSData type. I've succeeded in capturing and displaying this image in a UIImageView but as many of you already know.. it only displays the first frame.

I Also found some code to decode that GIF into separate images, but that code works from a GIF file and not NSData.

Question: How do i convert the NSData file into separate images and place them in an NSArray to use it as animation?

Note: In the NSData that is received are both an image and some text separated by a rare character. so the NSData looks like this: [image] [separator] [text].

Hope somebody can give me some pointers or some samples to work with..

Thanks in advance, i will keep searching untill you or me finds an answer :)

8
задан stackr 15 December 2010 в 13:27
поделиться