このコード行を使うのは良い考えではありません
@property (nonatomic, retain) AppDelegate *app;
どのクラスにも必要です。デリゲートアプリに必要な場所に簡単にアクセスするには、以下の手順を実行します。
AppDelegate* appDel = (AppDelegate*)[[UIApplication sharedApplication] delegate];
明らかにあなたがする必要があります:
#import "AppDelegate.h"
あなたがそれを使用するクラスで。
より洗練された方法でこれを行うには、次のようにAppDelegate.hにクラスメソッドを作成します。
+(AppDelegate*)sharedAppdelegate;
AppDelegate.mの次のように定義されています:
+(AppDelegate*)sharedAppdelegate
{
return (AppDelegate*)[[UIApplication sharedApplication] delegate];
}
次に、必要な場所で(AppDelegate.hをインポートした後)呼び出すことができます:
AppDelegate* sharedApp = [AppDelegate sharedAppdelegate];
それが役に立てば幸い。
P.S. Why do you need to access the delegate?