gpt4 book ai didi

iphone - 使用不兼容的 void 类型初始化 NSMutableArray __strong

转载 作者:行者123 更新时间:2023-12-03 19:28:35 26 4
gpt4 key购买 nike

这就是返回错误的原因:

NSMutableArray *newArray = [[[NSMutableArray alloc] initWithArray:[NSJSONSerialization JSONObjectWithData:[[[appDelegate.Matches objectAtIndex:(NSUInteger)indexPath] objectForKey:@"chat"] dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil]] addObject:[NSDictionary dictionaryWithObjectsAndKeys:message, @"message", [NSString stringWithFormat:@"%llu", appDelegate.userId], @"id", nil]];

最佳答案

“神圣的连续表达, bat 侠!”

如果您将其分成多行,您可以轻松看出问题出在哪里。

或者,更有可能的是,错误会神秘地消失。

问题在于 addObject: 返回 (void),但您试图将该方法的返回值分配给变量。

关于iphone - 使用不兼容的 void 类型初始化 NSMutableArray __strong,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10790531/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com