• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
IKImageBrowserView reload data broken
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IKImageBrowserView reload data broken


  • Subject: IKImageBrowserView reload data broken
  • From: Richard Gutierrez <email@hidden>
  • Date: Wed, 1 Jul 2009 14:33:37 -0700
  • Acceptlanguage: en-US
  • Thread-topic: IKImageBrowserView reload data broken

Hello... I have an IKImageBrowserView that is not refreshing it's data correctly. I have an NSPopUpButton which has a list of directories in its array, when a directory is selected, it changes the contents of my IKImageBrowserView to display all image files contained in the said directory.

Unfortunately, I have encountered an issue with the IKImageBrowserView's "reloadData" call. When I have no objects selected in the IKImageBrowserView, the reloadData call works as expected. The problem is, I have set IKImageBrowserView's "setAllowsEmptySelection" to "NO" and (thanks to you all's help) set the IKImageBrowserView to "setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];", so there is always a selection.

When my IKImageBrowserView has an object selected, the "reloadData" call gives me the following error: "2009-07-01 14:28:43.453 ImageBrowser[17020:813] *** -[NSCFArray objectAtIndex:]: index (2147483647( or possibly larger)) beyond bounds (0)" and I have been unable to resolve this issue. Here is my call when the NSPopUpButton's selection is changed which causes the problem at "[imageBrowser reloadData]" on both the "if" and "else" statements:

- (IBAction) pubSelectionChanged:(id)sender {
    NSString *selectedPUBItem = [[selectCategoryPUB selectedItem]title];
    NSString *selectedCategoryPath = [NSString stringWithFormat:@"/Users/richardg/Desktop/Demetras_Images/Thank You_Referral Cards/%@", selectedPUBItem];
    NSArray *categoryPath = [NSArray arrayWithObject:selectedCategoryPath];
    if ([selectedPUBItem isEqualToString:@"All Images"]) {
        NSString *allImagesPUBSelection = @"/Users/richardg/Desktop/Demetras_Images/Thank You_Referral Cards/";
        NSArray *allImagesPath = [NSArray arrayWithObject:allImagesPUBSelection];
        [images removeAllObjects];
        [importedImages removeAllObjects];
        [imageBrowser reloadData];
        [NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) toTarget:self withObject:allImagesPath];
    }
    else {
    [images removeAllObjects];
    [importedImages removeAllObjects];
    [imageBrowser reloadData];
    [NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) toTarget:self withObject:categoryPath];
    }
}

Any help here would be greatly appreciated. I looked extensively online and came up with many dead ends. Thank you AGAIN in advance! You guys are always a HUGE help!
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: User interface validation doesn't work, right?
  • Next by Date: Re: GC bug in NSFontManager?
  • Previous by thread: Re: User interface validation doesn't work, right?
  • Next by thread: libcurl -- how to write a callback?
  • Index(es):
    • Date
    • Thread