Re: Error: mutating method sent to immutable object

2009-04-05 Thread Graham Cox
On 05/04/2009, at 4:50 AM, Priscila J.V. wrote: Can you please suggest me something to fix it? Why not try randomly changing the code without thinking about the problem until it stops throwing errors? Yes you're right, that would be stupid. So why are you doing it? You need to develop t

Re: Error: mutating method sent to immutable object

2009-04-04 Thread Simon Robbie
Change: [arregloNumeros release]; } to: [arregloNumeros removeAllObjects]; } [arregloNumeros release]; regards Simon ___ Cocoa-dev mailing list (Cocoa-

RE: Error: mutating method sent to immutable object

2009-04-04 Thread Priscila J . V .
> >> thanks for your advice but now the message in the log window is: >> *** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1) >> >> Can you please suggest me something to fix it? > > Bug-fixing tip number 1: Don't do that. > > In particular: Stop trying to index past the end of the arr

Re: Error: mutating method sent to immutable object

2009-04-04 Thread Greg Guerin
Priscila J.V wrote: thanks for your advice but now the message in the log window is: *** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1) Can you please suggest me something to fix it? Bug-fixing tip number 1: Don't do that. In particular: Stop trying to index past the end of the arr

RE: Error: mutating method sent to immutable object

2009-04-04 Thread Priscila J . V .
Change: [arregloNumeros release]; } to: [arregloNumeros removeAllObjects]; } [arregloNumeros release]; regards Simon Hello Simon, thanks for your advice but now the message in the log window is: ***

RE: Error: mutating method sent to immutable object

2009-04-03 Thread Priscila J . V .
Hello Graham, thanks a lot. > > On 04/04/2009, at 12:27 PM, Priscila J.V. wrote: > >> >> Hello, >> I'm trying to do this: > > int p; > NSMutableArray* arregloNumeros = [[NSMutableArray alloc] init]; > NSString* fileContents = [NSString > stringWithContentsOfFile:@"lineasF

Re: Error: mutating method sent to immutable object

2009-04-03 Thread Graham Cox
On 04/04/2009, at 12:27 PM, Priscila J.V. wrote: Hello, I'm trying to do this: int p; NSMutableArray* arregloNumeros = [[NSMutableArray alloc] init]; NSString* fileContents = [NSString stringWithContentsOfFile:@"lineasFinal.txt"]; NSEnumerator* lineFileEnumerator = [[fileConten