Hi,
Like described there, this happened suddenly after I updated Cappuccino since some weeks/months.
I have a CPArrayController which is bound to and items CPArray, containing CPDictionary-items (with key "name"). Now, I load the data from a server. The first time it works correctly. But then, after a reload and the server doesn't return items (also when it returns less items than batch before, I think), the next error occurs:
Frameworks/Debug/Foundation/CPException.j:51 Uncaught CPRangeException: -[_CPObservableArray objectAtIndex:]: index (1) beyond bounds (1)
Because most my apps use CPArrayControllers and bindings, they are all broken. I imagine more people will face this. I checked the source, but I can't really pinpoint the problem. I think CPArrayController 'thinks' there are more items than there actually are.
I have a workaround though, add this to your code:
@implementation _CPObservableArray (WorkAround2317)
- (id)objectAtIndex:(int)index {
if (index >= [self count])
return [CPDictionary dictionary];
else
return [super objectAtIndex:index];
}
@end
And everything works again.
Thanks!