Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSArray in...

错误信息

[NSArray initWithArray:range:copyItems:]: array argument is not an NSArray’

原因分析

参数传入错误

错误代码:
self.titleArray = [NSMutableArray arrayWithArray:[[GoodsInfoManager shareGoodsInfoManager].formata objectForKey:@"attr"]];
原因分析:因为这里的attr是一个key-value类型,根本不是数组类型

正确代码
self.titleArray = [NSMutableArray arrayWithArray:[[[GoodsInfoManager shareGoodsInfoManager].formata objectForKey:@"attr"] allKeys]];

你可能感兴趣的:(Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSArray in...)