can someone help me, y do i get this error?
===============================================
2005-07-27 09:55:19.605 tryXML[345] An uncaught exception was raised
2005-07-27 09:55:19.610 tryXML[345] *** -[NSCFArray objectAtIndex:]:
index (1) beyond bounds (0)
2005-07-27 09:55:19.613 tryXML[345] *** Uncaught exception:
<NSRangeException> *** -[NSCFArray objectAtIndex:]: index (1)
beyond bounds (0)
tryXML has exited due to signal 5 (SIGTRAP).
below is my code
===============================================
NSXMLNode *aNode =[xmlDoc rootElement];
NSMutableArray *arr = [NSMutableArray array];
aNode = [aNode nextNode];
aNode = [aNode childAtIndex:13];
int i;
arr = [NSMutableArray arrayWithObjects: nil];
for(i = 0; i <= 1; i++){
aNode = [aNode childAtIndex:1+i];
aNode = [aNode childAtIndex:1];
[arr addObject:[NSString stringWithString:[aNode stringValue]]];
}//end for
[node1 setStringValue:[arr objectAtIndex:0]];
[node2 setStringValue:[arr objectAtIndex:1]];
===============================================
is there sth wrong with my array? :(
* posted via http://www.mymac.ws
* please report abuse to http://xinbox.com/mymac
Ulrich Hobelmann - 27 Jul 2005 09:27 GMT
> arr = [NSMutableArray arrayWithObjects: nil];
empty array, I would call [NSMutableArray array] here I think.
(or [NSMutablearray arrayWithObject: nil]) if that's what you mean.
> for(i = 0; i <= 1; i++){
> aNode = [aNode childAtIndex:1+i];
> aNode = [aNode childAtIndex:1];
> [arr addObject:[NSString stringWithString:[aNode stri
array with one object.
ngValue]]];
> }//end for
> [node1 setStringValue:[arr objectAtIndex:0]];
> [node2 setStringValue:[arr objectAtIndex:1]];
I guess it's the above line that fails? You might want to try it
out in the XCode debugger.

Signature
XML is a prime example of retarded innovation.
-- Erik Meijer and Peter Drayton, Microsoft Corporation
David Phillip Oster - 27 Jul 2005 16:37 GMT
> can someone help me, y do i get this error?
> 2005-07-27 09:55:19.610 tryXML[345] *** -[NSCFArray objectAtIndex:]:
> index (1) beyond bounds (0)
...
> aNode = [aNode childAtIndex:1+i];
how many children does aNode have?

Signature
David Phillip Oster