I would like to update the UI in my application from the AppDelegate, but whenever I call it as so:
Controller *object = [[Controller alloc] init];
[object methodHere];
It doesn’t seem to update the UI. What am I doing wrong here? I have put in a NSLog to see if it was being called, and it is. Here is a sample project that shows the error.
Edit: Can someone just show me what to change to the project I provided. I just don’t know what to type into my project so that I can change the value of a simple NSTextField from another class.
This is really simple, and Chuck’s comments basically explain what you need to do, but I will lay out the code explicitly for you. In
testAppDelegate.h:Then go into your xib in InterfaceBuilder and hook up that outlet from your Test App Delegate object to your Controller object (these objects are already present in the xib).
In
testAppDelegate.m: