Does UIImageView have a property to indicate setImage has completed and animations are ready?

There is a method in UIImageView (BOOL)isAnimating so you could potentially use.

I have tried this, to no avail - isAnimating apparently does not identify that the uiimageview is still busy scaling the image in the background. – Amateur Programmer by Night May 10 at 21:33 I'm sorry to hear that. It's a bit messier, but it's possible to override the setImage: method with - (void)setImage:(UIImage *)image { super setImage:image; // your custom code; }.

Worse comes to worst, you could include a notification in there to be sent to the main thread that lets it know it can continue to the next image – slev May 10 at 21:52 And I could indeed do that, if I had any way to tell when the image was done scaling/loading - but that problem remains. I appreciate the help - but the //your custom code block is still the question - how do I know the image is indeed ready to animate? – Amateur Programmer by Night May 10 at 21:59 After looking around with just about every possible search field for a solution for you, I cannot find an answer to find when an image has indeed scaled and loaded.

However, I did find a link that could prove useful if this fits your situation, here. Basically it says that a UIImageView is not meant to hold large images and provides ways to resize them to avoid problems (without destroying the quality of the original). If this is not the case, though, I will continue to look around – slev May 10 at 22:46 Thanks for the effort, slev - I will take to heart this suggestion and instead of just using UIImage imageNamed directly into the view, I'll resize an image according to link (vocaro.Com/trevor/blog/2009/10/12/…) referenced by your post here.

That way the UIImageView won't be dealing with the crazy big file itself, but a properly scaled version, when its time to animate it. – Amateur Programmer by Night May 107 at 11:38.

My gut is that setImage is handled synchronously, especially since you're talking about how the app stalls. You'd want to run setImage in an NSOperation to allow that happen in the background. developer.apple.com/library/ios/#documen... NSInvocationOperation *myOp = NSInvocationOperation alloc initWithTarget:myImageView selector@selector(setImage:) object:aUIImage; myOp addObserver:(NSObject *)self forKeyPath:(NSString *) @"isFinished" options:(NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld) context:NULL; anOpQueue addOperation:myOp; You'd then handle the KVO operation and handle removing the spinner there.

The application does not stall - the animationcommit on bgimage does stall - but the code between setimage and that animationcommit runs (e.g. The fgimage animation completes and then it stalls, that's 7 lines of code later) – Amateur Programmer by Night May 10 at 21:29 In fact, were it to stall, that would be better - setImage appears to be loading and scaling the image in a background thread. I am trying to identify that the background thread has completed and uiimageview is ready for animation. – Amateur Programmer by Night May 10 at 21:34 More to the point - it appears setImage loads synchronously, but UIImageView scales the image asynchronously.....therein lies the crux, I believe.

– Amateur Programmer by Night May 10 at 22:01.

UIImageView setImage: is not asynchronous: It's done immediately before the message returns. If the view does not show the image instantly it's probably because of some lazy UIImage code. My guess is that UIImage imageNamed: just references the file in the bundle and loads it only after the image data is requested.

You could try to force the image to load by sending it a CGImage message: bgImageView. Image CGImage; If this still does not trigger the image to be loaded you have to draw it somewhere: UIGraphicsBeginImageContext((CGSize){1, 1}); bgImageView drawInRect:(CGRect){{0, 0}, {1, 1}}; UIGraphicsEndImageContext().

BgImageView does not respond to drawInRect, but bgImageView. Image does. Unfortunately, neither code block seems to force a synchronous wait for the image to truly be ready/scaled/loaded.

– Amateur Programmer by Night May 10 at 21:42 While the image may be loaded - it is probably not finished scaling - the image is 1.5MB in size. – Amateur Programmer by Night May 10 at 21:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions