我正在编写一个iPhone应用程序。如何从可可中的其他文件设置对象的属性?
而是写在这里所有的代码,这是basicly是我想做的事:
testViewController.m:
- (void)viewDidLoad { [email protected]"text"; }
这工作。
现在我想更改testAppDelegate文件中的标签文本。
- (void)applicationDidBecomeActive:(UIApplication *)application {
testViewController *tvc=[[testViewController alloc] init];
[email protected]"another text";
[tvc release];
}
这不行!
我该怎么做?
感谢所有答案:)
似乎你有两个不同的testViewController实例。 – user523234