MKMapView в настоящемModalView черный - PullRequest
1 голос
/ 23 марта 2012

У меня есть 2 uiviewcontroller - первый - это rootviewcontroller - второй - это UIViewController с представлением карты внутри (MyMap.m / MyMap.h)

Моя проблема в том, что когда я пытаюсь показать свой второй вид как модальный вид из первого вида, мой вид карты полностью черный.

это viewdidload моего второго вида, я пытаюсь установить в качестве начального вида, и представление карты работает:

- (void)viewDidLoad{
    [super viewDidLoad];
    mapView.delegate =self;
    mapView.showsUserLocation = YES;
    UIBarButtonItem *zoomButton = 
    [[UIBarButtonItem alloc]
    initWithTitle: @"Zoom"
    style:UIBarButtonItemStylePlain
    target: self
    action:@selector(zoomIn:)];

    UIBarButtonItem *typeButton = 
    [[UIBarButtonItem alloc]
     initWithTitle: @"Type"
     style:UIBarButtonItemStylePlain
     target: self
     action:@selector(changeMapType:)];

    NSArray *buttons = [[NSArray alloc] 
                    initWithObjects:zoomButton, typeButton, nil];

    toolBar.items = buttons;
    CLLocationCoordinate2D annotationCoord;

    annotationCoord.latitude = 47.640071;
    annotationCoord.longitude = -122.129598;

    MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
    annotationPoint.coordinate = annotationCoord;
    annotationPoint.title = @"Microsoft";
    annotationPoint.subtitle = @"Microsoft's headquarters";
    [mapView addAnnotation:annotationPoint]; 
}

и это мое первое действие

MyMap *map = [[MyMap alloc]init];
[self presentModalViewController:map animated:YES];

Я не знаю, почему мой картограф становится черным, когда я запускаю его с первого вида, а не когда я запускаю его как начальный вид, есть идеи?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...