2011-08-05 89 views
0

我的視圖控制器的名字是RouteToStationViewController,在這個視圖控制器我得到一個警告,當我試圖編譯並導致崩潰後,我的相關代碼:MyViewController可能不響應setMapView

- (void)loadView { 
    [self setMapView:[[[RMMapView alloc]initWithFrame:CGRectMake(0.0, 0.0, 700, 700)]autorelease]]; //this line cause warning 

    [mapView2 setBackgroundColor:[UIColor blackColor]]; 
    self.view = mapView2; 

} 

我得到的警告是:

warning: 'RouteToStationViewController' may not respond to '-setMapView:' 

回答

2

我可能是錯的,但如果你的合成mapView2,不會此時,相應的設定功能是:

[self setMapView2:args]; 
在.h文件
0

你有地圖在您的.h建立財產

property(nonamtoic, retain) id* mapView; 
+0

,我有這方面的屬性:'@property(非原子,保留)RMMapView * mapView2;'和.mi已經合成了它:'@synthesize mapView2;' – Malloc

相關問題