我正在編寫一個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