2013-04-22 79 views
0

我有一個地圖,顯示了很多註釋,當我點擊在標註annotationView.rightCalloutAccessoryView我會得到一個空的黑色視圖。pushViewController做一個黑色的視圖

-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control 
{ 
    NSLog(@"%@", view.annotation.title); 
    MapPoint *annView = view.annotation; 
    DetailViewController *dvc = [[DetailViewController alloc] init]; 
    dvc.titleLabel.text = annView.title; 
    dvc.textView.text = annView.subtitle; 
    [self.navigationController pushViewController:dvc animated:YES]; 
} 

任何想法我做錯了什麼?

編輯: 我用故事板

回答

3

如果您使用的廈門國際銀行的接口,那麼你應該推在棧上分配之前的NibName。

使用IB

DetailViewController *dvc = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; 

使用故事板

確保您已定義的標識符爲 「DetailViewController」 在屬性檢查你的viewController。

DetailViewController *dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailViewController"]; 
+0

我用故事板。我更新了我的問題 – CTSchmidt 2013-04-22 11:13:45

+0

只要看到答案,使用故事板就不難初始化。 – nsgulliver 2013-04-22 11:16:43

0

你應該打開的故事板,並檢查是否視圖控制器的自定義類填寫正確c

custom class property

+0

是的,它被正確填充 – CTSchmidt 2013-04-22 11:21:10

+0

視圖中的每個組件都是透明的?=) – Ossir 2013-04-22 11:23:28

相關問題