views:

18

answers:

1

I've got a ControllerView which will initialize a set of Images-Classes. Here the basic-initialization in the Image-Class:

- (id)initWithImage: (UIImage *) anImage {
if ((self = [super initWithImage:anImage])) 
{
}
     return self;
}

How can I inform the ControllerView, when an image has been loaded ?

How could the ControllerView listen to the ImageClass, when the image has been loaded?

A: 

How can I inform the ControllerView, when an image has been loaded ?

If you're doing this initialization on the main thread, the init routine will block until it's done, which means the UI is blocked, which means the ControllerView will be blocked until the init is done, which means that the concept of "informing" doesn't exist. From the ControllerView's point of view, the initialization is done immediately.

How could the ControllerView listen to the ImageClass, when the image has been loaded?

Same question as above and same answer.

If you spin off the initialization into its own thread/NSOperationQueue/whatever, then it's a different story.

Shaggy Frog