IKImageBrowserの設定がうまくいっているようです。私は並べ替えを可能にするように設定し、アニメーションもYESに設定しましたが(awakeFromNibで)、画像を選択して再配置してみると、奇妙な動作が発生します:IKImageBrowserView移動するアイテムがアニメーション化しない
1)ほとんどの場合、 2)彼らはアニメーション化しません 3)時々画像が離れてしまいます。
私は画像をハイライト表示し、それを削除した場合、予想通り、それはアニメーション化と消える...
これはCore Animationのに問題ですか?インターフェイスビルダのオブジェクトにコアアニメーションレイヤを追加する必要がありますか?私はこれらの結果を得るために、アップルからこのチュートリアルに従っ:http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/ImageBrowser.html#//apple_ref/doc/uid/TP40004907-CH5-SW1
ここで問題のコードです:
- (BOOL) imageBrowser:(IKImageBrowserView *) aBrowser moveItemsAtIndexes: (NSIndexSet *)indexes toIndex:(NSUInteger)destinationIndex{
int index;
NSMutableArray *temporaryArray;
temporaryArray = [[[NSMutableArray alloc] init] autorelease];
for(index=[indexes lastIndex]; index != NSNotFound;
index = [indexes indexLessThanIndex:index])
{
if (index < destinationIndex)
destinationIndex --;
id obj = [mImages objectAtIndex:index];
[temporaryArray addObject:obj];
[mImages removeObjectAtIndex:index];
}
// Insert at the new destination
int n = [temporaryArray count];
for(index=0; index < n; index++){
[mImages insertObject:[temporaryArray objectAtIndex:index]
atIndex:destinationIndex];
}
return YES;
}
は興味深いことに、この行は警告
for(index=[indexes lastIndex]; index != NSNotFound;
比較は常にtrueによるものであるスロー〜 データ型の限定範囲
あなたは持っている問題には関係ありませんが、 'int index'を' NSUInteger index'に変更することでコンパイラの警告を取り除くことができます。 – NSGod
実際にそれを修正しました!どうもありがとうございます :) – mootymoots