SSCollectionViewとSSCollectionViewItemで問題が発生しました。
まず、IBから初期化してもらいたいです。しかし、それは私にはうまくいきません。私は次のようなSelectFooViewControllerを持っています:
@interface SelectFooViewController : SSCollectionViewController { ... }
対応するXIBのfilesOwnerとして使用しています。
SelectFooViewController* selectFooVC = [[SelectFooViewController alloc]
initWithNibName:@"SelectFooViewController" bundle:nil];
しかし、それが機能しないため、viewDidLoad()内でそのプロパティを自分で初期化する必要がありました。
さらに、SSCollectionViewItemsのbackgroundColor以外は表示できません。私が欲しいのはtextLabelとimageです。
- (SSCollectionViewItem *)collectionView:(SSCollectionView *)aCollectionView itemForIndexPath:(NSIndexPath *)indexPath {
SSCollectionViewItem *item = [[[SSCollectionViewItem alloc] initWithStyle:SSCollectionViewItemStyleImage reuseIdentifier:itemIdentifier] autorelease];
SSLabel* label = [[SSLabel alloc] init];
[label setText:@"foo"];
item.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foo.png"]];
item.textLabel = label;
[label autorelease];
return item;
}
デリゲートメソッド(行数、セクション数などを決定するため)が実装され、期待どおりに機能していることを確認できます。しかし、私のアイテムはすべて空です-しかし、期待されるポップアップでonclickに反応します。
誰かが私がしたことに誤りを見ますか?- ありがとう...
編集:SSCatalogプロジェクトを変更してもローカル画像を表示できませんでした