デリゲートとそのビュー コントローラーの関係がごちゃ混ぜになっていると思います。アプリを起動すると、AppDelegate が作成されます。Forum.h で AppDelegate を作成するのではなく、ViewController であるフォーラムを AppDelegate で作成します。また、中括弧内の *globalUserName は不要です。
したがって、AppDelegate.h は次のようになります。
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, retain) NSMutableString *globalUsername;
@property (nonatomic, retain) Forum *forum;
また、現在のバージョンの Xcode と Objective-C では、合成も不要です。自動的にセットアップおよび初期化されます。AppDelegate.m では、次を使用して *globalUsername を参照できます。
self.globalUsername
AppDelegate.m には、applicationDidLaunch に以下も含める必要があります。
[[self.forum alloc] init]; //Allocate and initialize the forum ViewController
self.forum.delegate = self; //Set the forum ViewController's delegate variable to be the AppDelegate itself
しかし、フォーラムの ViewController には現在、delegate という名前の変数がないため、作成する必要があります。したがって、Forum.h に以下を追加する必要があります。
@property (nonatomic) id delegate;
Forum.m では、AppDelegate.m がデリゲートの設定を処理したので、Forum のデリゲート変数を使用して AppDelegate のデータを参照できるようになりました。
最後に、Forum.m から globalUsername にアクセスするために、self.delegate.globalUsername を使用できます。したがって、Forum.m からの文字列に追加するには、次を使用できます。
[self.delegate.globalUsername appendString:myNewString];
「myNewString」は、globalUsername に追加する文字列です。
お役に立てれば。