作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图通过从 NSMutableArray
中删除所有项目来删除用户在 NSCollectionView
中添加的所有项目。它不起作用。
我只需要通过清除/删除NSCollectionView
的所有项目来刷新/重新加载
最佳答案
试试这个
NSIndexSet* selectedIndexSet = [_lablesCollectionView selectionIndexes];
NSUInteger index = [selectedIndexSet firstIndex] ;
NSLog(@"index is %d", index);
[lablesArray removeObjectsAtArrangedObjectIndexes:selectedIndexSet];
希望有帮助。
关于objective-c - 如何从 NSCollectionView 中删除所有项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31849557/
我是一名优秀的程序员,十分优秀!