アプリでファイルに画像を表示するために使用される IkImageBrowserView インスタンスがあります。すべて問題ありませんが、別のビューに置き換えます。
2012-05-23 12:37:29.690 test[3595:903] --ImageKit Error: IKCacheDatabase::entryAtIndex - bad index
2012-05-23 12:37:29.691 test[3595:903] --ImageKit Error: entry #-1 doesn't exist
2012-05-23 12:37:29.691 test[3595:903] --ImageKit Error: IKCacheDatabase::entryAtIndex - bad index
2012-05-23 12:37:29.692 test[3595:903] --ImageKit Error: entry #-1 doesn't exist
2012-05-23 12:37:29.693 test[3595:903] --ImageKit Error: IKCacheDatabase::entryAtIndex - bad index
2012-05-23 12:37:29.693 test[3595:903] --ImageKit Error: IKCacheDatabase::entryAtIndex - bad index
2012-05-23 12:37:29.693 test[3595:903] --ImageKit Error: IKCacheDatabase::entryAtIndex - bad index
2012-05-23 12:37:29.694 test[3595:903] --ImageKit Error: entry #-1 doesn't exist
2012-05-23 12:37:29.695 test[3595:903] --ImageKit Error: IKCacheDatabase::entryAtIndex - bad index
2012-05-23 12:37:29.695 test[3595:903] --ImageKit Error: entry #-1 doesn't exist
2012-05-23 12:37:29.696 test[3595:903] --ImageKit Error: ram manager::bind can't find cache node with uid: -1 size: 44
そして、実験を行ったところ、このメッセージによってアプリがクラッシュすることはないことがわかりました。また、ブラウザー ビューを他のビューに置き換えるたびに発生するわけではありません。ビューを閉じると、メッセージも表示されます。下のコードは browserView アイテムです。エラーメッセージによると、画像のキャッシュが原因である可能性があります..しかし、何が問題なのかわかりません
@interface ASFileBrowserViewItem : NSObject
@property(retain) NSImage* itemImage;
@property(retain) NSString* imagePath;
- (id)initWithPath:(NSString*)path;
@end
#import "ASFileBrowserViewItem.h"
#import <Quartz/Quartz.h>
@implementation ASFileBrowserViewItem
@synthesize itemImage = _itemImage;
@synthesize imagePath = _imagePath;
- (id)initWithPath:(NSString*)path
{
self = [super init];
if (self) {
self.imagePath = path;
_itemImage = [[NSImage alloc] initWithContentsOfFile:path];
}
return self;
}
- (void)dealloc
{
[_imagePath release];
[_itemImage release];
[super dealloc];
}
#pragma mark require from IKImageBrowserView Protocol
- (NSString *) imageUID
{
return _imagePath;
}
- (NSString *) imageRepresentationType
{
return IKImageBrowserNSImageRepresentationType;
}
- (id) imageRepresentation
{
return _itemImage;
}
- (NSString *) imageTitle
{
return [_imagePath lastPathComponent];
}
@end