Hi everyone.
I'm currently having a big problem with an NSMutableArray. At the moment I can addobjects to it, and they display in a NSTableView perfectly. When I remove them they are removed from the array, but when I try to open the sheet containing the tableView I get an error like this: *** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)
If I then add another object to the array, the tableView works perfectly again. If I do not add another object and quit, I get this sort of error:
AssetMonitor [DEBUG](3206,0xa000ed88) malloc: *** Deallocation of a pointer not malloced: 0xbfffe270; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
These are the methods I have for adding and removing:
I've been playing around for a few hours and haven't been able to come up with a fix. Any help appreciated with this one. Thanks.
I'm currently having a big problem with an NSMutableArray. At the moment I can addobjects to it, and they display in a NSTableView perfectly. When I remove them they are removed from the array, but when I try to open the sheet containing the tableView I get an error like this: *** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)
If I then add another object to the array, the tableView works perfectly again. If I do not add another object and quit, I get this sort of error:
AssetMonitor [DEBUG](3206,0xa000ed88) malloc: *** Deallocation of a pointer not malloced: 0xbfffe270; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
These are the methods I have for adding and removing:
Code:
- (void)addLog:(Log *)l
{
[logs addObject:l];
}
- (void)removeObjectIdenticalTo:(id)anObject
{
[logs removeObjectIdenticalTo:anObject];
}
I've been playing around for a few hours and haven't been able to come up with a fix. Any help appreciated with this one. Thanks.