私のアプリケーションでは、3つ以上のビューでpagecontrolのインスタンスを使用したいので、宣言したいのですが、@propertyと@synthesizeはappDelegateにある必要があります。これを行うためのアイデアをいくつか教えてください...
ありがとう、真野
私のアプリケーションでは、3つ以上のビューでpagecontrolのインスタンスを使用したいので、宣言したいのですが、@propertyと@synthesizeはappDelegateにある必要があります。これを行うためのアイデアをいくつか教えてください...
ありがとう、真野
私は pagecontrol を使用したことはありませんが、原則として、コードは次のようになります。
YourAppDelegate .h で
@interface YourAppDelegate : NSObject <UIApplicationDelegate> {
...
UIPageControl *pageControl;
...
}
@property (nonatomic, retain) IBOutlet ScrollingViewController *viewController;
YourAppDelegate.m:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
pageControl = [[UIPageControl alloc] init]; // or whatever is needed to set up pagecontrol
}
あなたのビューの1つで:
YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];
//and then access the variable by appDelegate.variable