我想在我的iOS應用程序中使用來自Core Plot的散點圖。我將Core Plot設置爲Core Plot wiki,然後從Plot Gallery項目中將PlotItem.h/m,PlotGallery.h/m和SimpleScatterPlot.h/m複製到我的項目中。代碼ScatterPlot不讓我點擊繪圖點或移動圖形
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
SimpleScatterPlot *scatterPlot = [[SimpleScatterPlot alloc]init];
[scatterPlot generateData];
[scatterPlot renderInLayer:hostView withTheme:theme];
運行,圖形視圖顯示在我的應用程序中。但是我無法移動圖形視圖或者在Plot Gallery項目中點擊繪圖點。我該如何設置它?
什麼是'hostView'? –
hostView是一個CPTGraphHostingView,它在我的viewController.h中聲明,並具有一個IBOutlet到Interface Builder中的CPTGraphHostingView。 – Jambaman