A: 

In your original code, you never allocated a new instance of BubbleAnimation, and that's why it worked fine.

You have an object in the XIB file which is the BubbleAnimation object, and that's all fine, but the problem is that you're allocating a new instance of BubbleAnimation instead of using the one you have in your revised code.

Even if you were to use the one you have, you'd have to change the init method, since the system will call initWithCoder:, not initWithMood:.

The best thing is most likely to change the init function to something else, e.g. a setMood:, which modifies the image view. Then you re-use the same image view every time.

Then you'd just set it up using something like...

[bubbleAnimation setMood:character.mood];
bubbleAnimation.animationDuration = 0.5; 
bubbleAnimation.animationRepeatCount = 5; 
[bubbleAnimation startAnimating];
Kalle
Aaaaah ok I think I see. So even though I declared the instance of BubbleAnimation as an IBOutlet, and linked it to the instance in IB - because I use the alloc method, it's creating a new instance rather than using the one created by IB. Ok I'll try the setMood method approach now and let you know how it goes. Thanks so much for the help!!
Smikey
It worked perfectly. Thanks so much for the help :D
Smikey
My pleasure! :)
Kalle
Hey Kalle (or anyone), I've run in to a rather similar issue which might be related - I've appended the question accordingly, any chance you could take a look? Thanks! :D
Smikey
I take it back, it works just fine! Not sure what changed, probably a clean or restart? W00 :)
Smikey