I'm new in XCode and still learning XCode (currently using Xcode 4.5.2).
Based on Apple tutorial about IconCollection , i try to make a kind of thumbnail view app with ImageMetada fields Stored in an array as the CollectionView Datasource.
here are some basic information :
Table could display info stored in array including filename, path, and metadata (Date and GPS information) correctly. But the CollectionItem's custom view wont. No image, no name, no information.
On debugging, i found that each of IBOutlet : imgpic, imglabel, imgbtn1, and imgbtn2 is null.
Why all IBOutlet properties/links didn't work ?
Is there something i forgot?
How to get the imageinfo stored in imageinfos array from custom view associated to collectionitem for custom draw purpose?
CollectionView ---> Collection Item ---> custom view
for example while perform custom draw on a customview associated to a collectionitem at index number 4, how could i get that index (number 4)?
My code to get the index is get its superview as collectionview and get its index on superview's subviews as follow :
-(NSInteger) getIndexInCollection
{
return [[[self superview] subviews] indexOfObject:self];
}
The problems with this code is sometimes it works sometimes it doesn't.
Any help would be appreciated. Thanks.
阅读有关NSCollectionview的文档IconViewPrototype.xib时要小心,简单的代码使用一些绑定,在Collection.xib中应确保如何使用IconViewPrototype.xib来显示“自定义”视图,并确保如何根据绑定获取数据。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.