IOS6的代码升级至IOS16代码出错

我在将IOS6的代码升级至IOS16的过程中,代码中出现莫名错误,不知道如何去解决:

-(instancetype)init
{
    if ( (self = [super init]) ) {
        self.graphClass = [CPTXYGraph class];
    }
    return self;
}

/// @}

-(id)newGraph
{
    CPTXYGraph *graph;

    if ( self.graphClass ) {
        graph = [[self.graphClass alloc] initWithFrame:CPTRectMake(0.0, 0.0, 200.0, 200.0)];
    }
    else {
        graph = [[CPTXYGraph alloc] initWithFrame:CPTRectMake(0.0, 0.0, 200.0, 200.0)];
    }
    graph.paddingLeft   = CPTFloat(60.0);
    graph.paddingTop    = CPTFloat(60.0);
    graph.paddingRight  = CPTFloat(60.0);
    graph.paddingBottom = CPTFloat(60.0);

    CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
    plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0];
    plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0];

    [self applyThemeToGraph:graph];

    return graph;
}

然后这里报错:

img


不知道是什么原因,有没有兄弟姐妹给帮忙解答一下,谢谢

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 帮你找了个相似的问题, 你可以看下: https://ask.csdn.net/questions/1042
  • 这篇博客你也可以参考下:iOS开发:在iOS可视化编程的时候,不仅控件可以拖线关联,代理也可以拖线关联
  • 除此之外, 这篇博客: iOS小技能:自定义时间格式(适配iOS15.4之后12/24小时制的问题)中的 1.3 代码实现 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:
    + (NSString *)strdatedateFormat:(NSString*)toDateFormat fromDateFormat:(NSString *)fromDateFormat objstr:(NSString*)objstr{
    
        
        NSString *tmpbirthday = @"";
        
        if(![NSStringQCTtoll isBlankString:objstr]){
            tmpbirthday = objstr;
            
    
            
            tmpbirthday  = [QCT_Common date4ateFormat:toDateFormat withdate:[QCT_Common dateWithFormatterString:tmpbirthday dateFormat:fromDateFormat]];
            
            
        }
        return tmpbirthday;
    }
    
    
    + (NSString *)date4ateFormat:(NSString *)DateFormat withdate:(NSDate *)date{
        
        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
      //  [formatter setDateStyle:NSDateFormatterMediumStyle];
    //    [formatter setTimeStyle:NSDateFormatterShortStyle];
        [formatter setDateFormat:DateFormat];
        
        return [formatter stringFromDate:date];
    }
    
    + (NSDate*)dateWithFormatterString:(NSString*)dateWithString dateFormat:(NSString*)dateFormat {
        
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
        dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];
        dateFormatter.dateFormat = dateFormat;
        NSDate *date = [dateFormatter dateFromString:dateWithString];
        return date;
        
    }
    
    
    
  • 您还可以看一下 董招兵老师的iOS 组件化开发之入门课程中的 3.制作远程私有组件库小节, 巩固相关知识点

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^