Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mkristain

macrumors regular
Original poster
Aug 18, 2011
115
0
hello,

i add the images with path and reloaddata to view the images.

but second time the images are not changed and IKImageBrowserView display the previously loaded images, but when double click on item the correct image is open.

so i found IKImageBrowserView not change the view of images when i inserted images again after removing previous images.

please help me for this.

thanks in advance.
 
You're asking us to debug your code without seeing it.

We can't read your mind.
We can't see your files.

Post your code.
 
yes i removeallobject of image array but still i have the same problem.
Code:
//images is the image array

[images removeAllObjects];
images = [[NSMutableArray alloc] init];
[imageBrowser reloadData];

i use this when i m inserting images again in imagebrowser.

please help me..
 
The code you've posted doesn't help much at all. It doesn't look real world, and just shows you still don't understand memory management rules in Cocoa.

The only advice I can think to give is that you're not properly using imageUID and/or imageVersion of the datasource items. This could cause the browser view to load from its cache.
 
yes the image name is same and i pass image name in imageUID so is this the main issue?

please help me to resolve this.

please tell me how can use imageVersion.

thanks.
 
Last edited:
Seems likely. imageVersion seems to exists for this purpose. Sounds like you just increment it each time the image is modified.
 
please can u give me any example for this.

actually i am use this but now the image not display properly in image browser.

Code:
- (NSUInteger) imageVersion;
{
	image_version++;
	
	return image_version;
}

thanks.
 
this not works

Code:
- (NSString *) imageUID
{
	
// This is uses the NSManagedObjectID for the entity to generate a unique string.
   return [[[self objectID] URIRepresentation] description];

}

so i am use this

Code:
- (NSString *) imageUID
{
  return image_Name;
}
and When I call the following:

[imageBrowserView reloadData];
The Debugger Console prints this:

--ImageKit Error: reloadData called in non main thread

and some other error like jpeg data stream is corrupt if file contain not full image file.


and vertical scroll not move down when images inserted.
 
Copying and pasting without understanding is a really bad idea.

I'm struggling to help you because you're giving very little useful information.

For example:

Code:
--ImageKit Error: reloadData called in non main thread

Is pretty explicit that you're not calling reloadData on the main thread. If you don't know how to do this then you shouldn't be messing around with threads in the first place.
 
yes i removeallobject of image array but still i have the same problem.
Code:
//images is the image array

[images removeAllObjects];
images = [[NSMutableArray alloc] init];
[imageBrowser reloadData];

i use this when i m inserting images again in imagebrowser.

please help me..

I stopped reading the rest of the thread here.
Have you read the documentation about NSMutableArray? Do you know what -removeAllObjects does? Have you read at least a part of Apple's memory management guide?
Also, this is an English forum. Many of your statements are absolutely not clear.

Being a developer implies you do your work -- reading and studying. Everyone can write two lines of codes, and that makes him/her no more than someone who typed two lines of code.

Memory management: http://developer.apple.com/library/...onceptual/MemoryMgmt/Articles/MemoryMgmt.html

NSMutableArray's documentation: http://developer.apple.com/library/...NSMutableArray_Class/Reference/Reference.html

CFUUID documentation page: http://developer.apple.com/library/.../Reference/CFUUIDRef/Reference/reference.html


Read those pages. Then, if you still have doubts, ask. But not before having read them.
 
yes i removeallobject of image array but still i have the same problem.
Code:
//images is the image array

[images removeAllObjects];
images = [[NSMutableArray alloc] init];
[imageBrowser reloadData];

i use this when i m inserting images again in imagebrowser.

please help me..

Don't know why you are re-declairing the NSMutableArray called 'images'
I'm using this

Code:
-(IBAction) SelectFolderWithImages:(id)sender
{
    //Clear all MutableArrays ImportedImages, Images, FilteredOutImages]
   
    //Clear images and arrays
    [self ClearImages];
    //Load files from selected folder 
    [self loadImages];
   
}

-(void)ClearImages
{
    [images removeAllObjects];
    [ImportedImages removeAllObjects];
    [images removeAllObjects];
    [filteredOutImages removeAllObjects];
    [filteredOutIndexes removeAllIndexes];
}

- (void)loadImages
{
    NSArray *pathToSelectedFiles = openFiles();
    
    if(!pathToSelectedFiles)
    {
        NSLog(@"No path selected, return..."); 
        return;
    }
    [NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) toTarget:self
                           withObject:pathToSelectedFiles];
    
    [ImageBrowser reloadData];
}
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.