I'm using the Tab Bar project in Xcode to create an app. It gives you a FirstViewController class and xib file. In the xib file there is a UILabel that just says "First View" in the center. I want to know how to programmaticly change the text value of the label that is in a viewController owned by a Tab Bar Controller using a method?
I started by creating a IBOutlet UILabel *title value in FirstView.h, with a @property, and a @synthesize in FirstView.m. In Interface Builder i was having trouble connecting my UILabel to "title" in File Owner. I dragged the "FirstView" class to my interface, and was able to connect to that class, and "title" showed up and let me connect to it. The problem is, how do you alter the UILabel.text value in this FirstView class? it is owned by the tabController.
Next, i tried adding the UILabel to the AppDelegate class instead. Again, i couldn't connect it in Interface Builder, but copied the AppDelegate class into IB and was able to connect to it, and again, "title" showed up and i connected to it. Now i know i can alter title.text in a method. However, when i do this in didFinishLaunchingWithOptions, the code runs, but nothing happens. I used a break point to verify that it was getting to that line, and it is, but the text isn't altered. I tried it before and after
[window addSubview:tabBarController.view]; [window makeKeyAndVisible];
any ideas on how to alter an IBOutlet, like UILabel, when using a Tab Controller?