したがって、私のappDelegateには、次のような一連のイベントがあります。
AppDelegate.m
#import "AppDelegate.h"
#import "ListViewController.h"
#import "Event.h"
#import <RestKit/RestKit.h>
@implementation AppDelegate{
NSMutableArray *events;
/* for test data */
NSMutableArray *titles;
}
@synthesize window = _window; ...
そして、私はこのイベント配列に次のようにビューコントローラでアクセスしたいと思います。
MapViewController.m
#imports ...
...
-(void) viewDidLoad{
[super viewDidLoad];
[worldView addAnnotation:[ACCES_EVENTS_HERE objectAtIndex:int]; // <------
NSLog(@"Loadded the view for MapViewController");
}
どうすればよいですか?次に、マップにイベントを追加してからviewDidLoaDを追加するのに適した場所はありますか?(イベントはデータベースから取得されるため、多くのイベントが発生します)