Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ios coreplot设置_Ios_Core Plot - Fatal编程技术网

ios coreplot设置

ios coreplot设置,ios,core-plot,Ios,Core Plot,在我的项目中很难让CorePlot工作,但现在一切都在运行。除了一个空白的白色屏幕,我什么也看不到 使用下面的代码,我至少应该这样做一个空白的图形吗 self.graph = [[[CPTXYGraph alloc] initWithFrame:frame] autorelease]; layerHostingView.hostedGraph = graph; [self addSubview:layerHostingView]; 谢谢你帮我做这件事 仅供参考这不是我第一次使用coreplo

在我的项目中很难让
CorePlot
工作,但现在一切都在运行。除了一个空白的白色屏幕,我什么也看不到

使用下面的代码,我至少应该这样做一个空白的图形吗

self.graph = [[[CPTXYGraph alloc] initWithFrame:frame] autorelease];
layerHostingView.hostedGraph = graph;

[self addSubview:layerHostingView];
谢谢你帮我做这件事


仅供参考这不是我第一次使用
coreplot
进行测试。我已经在这上面转了好几天了,从那以后,我尝试了我能得到的每一个完整的例子。我觉得从基础重新开始是个好主意。

我真的不知道发生了什么变化,但我看到了一个包含此代码的裸体图

H
老实说,我不知道发生了什么变化,但我看到了一个带有此代码的裸体图

H
不同之处在于您在回答中发布的代码,您创建了一个
CPTGraphHostingView
,并将其添加为
RaceDetailView
的子视图。在您问题中的代码中,我怀疑宿主视图为零。我不认为添加主题会有什么不同——默认外观是一个简单的白色背景,带有黑线和标签,您仍然可以看到一些东西。

不同之处在于您在答案中发布的代码,您创建了一个
CPTGraphHostingView
并将其添加为
RaceDetailView
的子视图。在您问题中的代码中,我怀疑宿主视图为零。我不认为添加主题会有什么不同——默认外观是一个简单的白色背景,带有黑线和标签,你仍然可以看到一些东西。

我真的不知道真正的答案,我太不感兴趣了,想不出它是什么。然而,我觉得给你答案比给我好得多。知道你会从中得到更多的分数是更好的!老实说,我不知道真正的答案,我也太不感兴趣了,想不出它是什么。然而,我觉得给你答案比给我好得多。知道你会从中得到更多的分数是更好的!
#import <UIKit/UIKit.h>
#import "CorePlot-CocoaTouch.h"

@interface RaceDetailView : UIView <CPTPlotSpaceDelegate, CPTPlotDataSource, CPTScatterPlotDelegate>

@end
#import "RaceDetailView.h"

@implementation RaceDetailView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        CGRect f = self.frame;
        CPTXYGraph *graph = [[[CPTXYGraph alloc] initWithFrame:f] autorelease];
        CPTGraphHostingView *layerHostingView = [[CPTGraphHostingView alloc] initWithFrame:f];
        layerHostingView.hostedGraph = graph;
        [graph applyTheme:[CPTTheme themeNamed:kCPTDarkGradientTheme]];

        [self addSubview:layerHostingView];
    }
    return self;
}

@end