IkImageBrowserView Error

466 Views Asked by At

I have an IkImageBrowserView instance which used to show picture in file,in my app. Everything ok but replace it with another view.

    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

And I make some experiment and found that , this message will not lead the app to crash. And not happen everytime when I replace the browser view with other view.Some time I close the view, the message will also appar.The code under is the browserView item. according the error message, it may caused by cache of image .. but i can't find what's wrong

    @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
0

There are 0 best solutions below