arrays - 选择器“indexPathForRow:inSection:inSection:”没有已知的类方法
问题描述
我似乎在为多维数组创建索引路径时遇到问题。
-(NSIndexPath *)indexPathForObject:(id)object {
NSIndexPath *indexPath;
for (NSUInteger row = 0; row <self.numberOfRows; row++) {
for (NSUInteger column = 0; column <self.numberOfColumns; column++) {
for (NSUInteger stack = 0; stack <self.numberOfStacks; stack++) {
id arrayObject = self.array[row][column][stack];
if (arrayObject == object) {
indexPath = [NSIndexPath indexPathForRow:row inSection:column inSection:stack];
}
}
}
}
return indexPath;
}
我不确定我是否能够像上面那样使用两次“inSection:”。我的 ultimage 目标是确定 3 维空间中的值。谢谢!
解决方案
推荐阅读
- angular - 访问接收到的数据的值
- c++ - 我的合并排序代码中出现垃圾值
- sharepoint - 在 PowerApps 中找不到我的表单,但可以从 SharePoint 列表中的链接访问它
- go - golan-gin api 返回无效的 URL 转义 %
- php - 使用 PHP/HTML 在表单验证中突出显示空文本框
- javascript - 无法滚动网格直到记录结束
- bunifu - Bunifu Flat Button: Selected Property Problem (取消选择本身)
- python-3.x - Pip install 在窗口上的 docker 容器中不起作用
- swift - 在 Swift 中将 GPS 元数据写入 EXIF
- javascript - 失去地图功能的上下文