ここで奇妙なエラーが発生しています。__ImageData という名前の配列があります。
static NSArray *__ImageData = nil;
NSString *path = [[NSBundle mainBundle] pathForResource:@"ImageData" ofType:@"plist"];
NSData *plistData = [NSData dataWithContentsOfFile:path];
NSString *error; NSPropertyListFormat format;
_ImageData = [NSPropertyListSerialization propertyListFromData:plistData
mutabilityOption:NSPropertyListImmutable
format:&format
errorDescription:&error];
配列の内容を NSLog アウトすると、次の出力が得られます。
2012-08-23 16:36:35.573 CAT[28814:c07] {
"Item 0" = {
height = 7121;
name = Map1;
width = 8556;
};
"Item 1" = {
height = 7121;
name = Map2;
width = 8556;
};
"Item 2" = {
height = 7121;
name = Map3;
width = 8556;
};
}
しかし、 NSLog out するとNSLog(@"%@", [__ImageData objectAtIndex:0]);
、次の例外が発生します。
2012-08-23 16:36:35.573 CAT[28814:c07] -[__NSCFDictionary objectAtIndex:]:
unrecognized selector sent to instance 0x719d0f0
2012-08-23 16:36:35.574 CAT[28814:c07] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFDictionary objectAtIndex:]:
unrecognized selector sent to instance 0x719d0f0'
*** First throw call stack:
等..
この配列内のオブジェクトに到達する方法がわかりません..内部にデータがあるにもかかわらず、objectAtIndexはindex:0でさえもインデックスを見つけることができないようです..誰もそれを取得する方法を知っていますか? を使用して、Apple の PhotoScroller-template を使用していCATiledLayer
ます。全体的にファンキーだと思いますが、大きな画像にはこれを使うべきだと誰もが言います。巨大な画像について、CATiledLayer よりも優れた説明やアイデアを持っている人はいますか? (8556*7121px)。
NSArray から Dictionary-error が発生するのはなぜですか? を実行するNSDictionary *dict = [__ImageData objectAtIndex:0]
と、同じ例外も発生します。
スティアン。