iphone - how to use same UIView in tabs? -


I have a small UIView, I fill it with some string data from the net, I just load it once I want this because I say it in epidegate class.

CurrencyView * currView;

@property (nonatomic, retain) CurrencyView * currView;

FinishLaunchingWithOptions done in the application:

  Currency view * View = [[Currency View Allocess] initWithFrame: CGRectMake (0, 0, 100, 20)]; Self.currView = View; [See release];  

Then I call it in each view controller (in the tab).

  Specify AppDelegate_iPhone * delegate = [AppDelegate_iPhone shared app]; Self.currencyView = delegate.currView [self.view addSubview: currencyView];  

When I go to tabs, the currView takes from tab to second tab. When look back on the last tab, the mood scenes are gone, it remains on the last tab. I do not know why

What should I do to make a carvive in all the scenes?

"post-text" itemprop = "text">

You can not put a UIView for a different controller in a single moment. When you add it to another controller / view, it will be deleted in advance.

So when you change tab ^^ (for example using a delegate method), you should add it again. It depends on what you are using; -))

I think there is no other solution, but if someone has a better thought then I may be interested.


Comments