问:我收到类似“致命错误:数组索引超出范围”的错误。
这是我的代码:
INIT (指数: 诠释) {
让brandsLibrary = BrandsLibrary ()。库让playlistDictionary = brandLibrary [ index ]品牌= playlistDictionary [ “ brand” ]为!弦!clas = playlistDictionary [ “ class” ]为!弦!headquaters = playlistDictionary [ “ headquaters” ]为!
弦!
模特+ = playlistDictionary [ “模特” ]为![字符串] }
有人可以帮我摆脱这个错误吗?
答:索引超出范围”表示您正在尝试访问数组中超出数组范围的项目。即,如果您尝试访问仅包含4个项目的数组的第6个项目,则您的应用将崩溃,因为该数组不包含6个项目。