views:

13

answers:

1

I'm curious if it's possible to create an application according to window-based pattern, add UILabel, create a new class, and to be able to change UILabel's value from this new class.

After creating all that files we will have:

  • NewApplicationDelegate.h, .m;
  • Newclass.h, .m;
  • MainWindow.xib.

The IBOutlet in this case must be added to MainWindow.xib, and I want to change its value from NewCalss.m. Is it possible? How can I do that?

The point is that I was working only with navigation-based or simple window-based applications before, and now I need to have one view available and changeable (UILabels, for example) from at least 2 other classes.

Thanks.

A: 

You will have a UIController object too - right?

That has a handle on the UI elements, UILabel etc, whichever you map through.

You could pass this to the Newclass or you could provide an interface/protocol that the controller exposes that allows Newclass to interact with what you want to do.

Chris Kimpton
In case of view-based application, yes, I will have it.
ufw
OK, I figured it out, thank you.
ufw