On Feb 4, 2008, at 10:59 PM, Ingrid Giffin wrote:

> I'm getting an error message and could use some tips as to where to  
> start
> looking for the problem:

Check the console log for a backtrace; search for BibDesk to find  
possibly relevant messages.

> *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (2)
>
> 1) I just today converted to Version 1.3.14.
> 2) I converted the URL fields as suggested.
> 3) I get this message when I open individual records.
>
> Any suggestions for what the error message means, and what the  
> problem might
> be?

There's been at least one of these lurking in BibDesk for a year or  
two, unfortunately.  It indicates a programmer error, trying to access  
an array element at index -1.  It's probably code that looks like this:

     NSArray *a = [NSArray array];
     NSInteger i = [a count];
     while(--i)
         [a objectAtIndex:i];

which gives a -1 for a signed int and a huge value for an unsigned  
int.  Using while(i--) avoids the problem, as does explicitly  
comparing e.g. while(--i > 0).  Another possible problem occurs using  
an unsigned index:

     NSUInteger j = [a count];
     while(--j > 0)
         [a objectAtIndex:j];

this fails even with an explicit test, since --j is a huge value due  
to integer overflow.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to