I think you messed up the relationship between the delegate and the controllers of his views. AppDelegate is created when the application starts. Instead of creating an AppDelegate in Forum.h, you create a ViewController, Forum, in AppDelegate. Also * globalUserName in braces is not required.
So AppDelegate.h will read:
@interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic, retain) NSMutableString *globalUsername; @property (nonatomic, retain) Forum *forum;
In addition, the current version of Xcode and Objective-C do not need to be synthesized either. It is automatically configured and initialized. In AppDelegate.m, you can reference * globalUsername using:
self.globalUsername
The following applicationDidLaunch application should also be included in AppDelegate.m:
[[self.forum alloc] init]; //Allocate and initialize the forum ViewController self.forum.delegate = self; //Set the forum ViewController delegate variable to be the AppDelegate itself
But there is currently no variable called delegate in the Forum ViewController, so we will have to create it. So, in Forum.h you should add:
@property (nonatomic) id delegate;
So now in Forum.m, since AppDelegate.m took care of setting up the delegate, now we can reference the data in AppDelegate using the Forum delegate variable.
So, to access globalUsername from Forum.m, we can use self.delegate.globalUsername. So, to add a line from Forum.m, we can use:
[self.delegate.globalUsername appendString:myNewString]
Where "myNewString" is the string you want to add to the globalUsername name.
Hope this helps.