Re: Problems with [NSArray count]

2008-04-22 Thread David Duncan
On Apr 22, 2008, at 2:45 PM, Peter Browne wrote: The process followed is: 1) the myController object acquires data from a text file, using NSString's -stringWithContentsOfFile:encoding:error 2) myArray then grabs this data (a bunch of numbers) using NSArray's -componentsSeparatedByString: 3

Re: Problems with [NSArray count]

2008-04-22 Thread Shawn Erickson
On Tue, Apr 22, 2008 at 2:45 PM, Peter Browne <[EMAIL PROTECTED]> wrote: > I'm getting an "EXC_BAD_ACCESS" error. > > I've since managed to solve the problem by inserting a > > [myArray retain]; > > but I'm not entirely sure WHY this fixed it... > > The process followed is: > > 1) the myCont

Re: Problems with [NSArray count]

2008-04-22 Thread Hamish Allan
On Tue, Apr 22, 2008 at 11:45 PM, Peter Browne <[EMAIL PROTECTED]> wrote: > The process followed is: ... > 2) myArray then grabs this data (a bunch of numbers) using NSArray's > -componentsSeparatedByString: You haven't told us where "myArray" comes from in the first place... Hamish __

Re: Problems with [NSArray count]

2008-04-22 Thread Peter Browne
On 22 Apr 2008, at 22:15, David Duncan wrote: On Apr 22, 2008, at 2:03 PM, Peter Browne wrote: I'm returning to Cocoa after quite a long break, and it seems that I'm a little rusty... All I want to do is find out the number of items in an NSArray and store that as a variable, which I can

Re: Problems with [NSArray count]

2008-04-22 Thread Andy Lee
On Apr 22, 2008, at 5:03 PM, Peter Browne wrote: The docs tell me that [NSArray count] returns an NSUInteger, but exactly WHAT one of these is, or how I use it is baffling me. You could do a search using the built-in documentation browser in Xcode (it's in the Help menu). Alternatively, Goo

Re: Problems with [NSArray count]

2008-04-22 Thread Shawn Erickson
On Tue, Apr 22, 2008 at 2:10 PM, Shawn Erickson <[EMAIL PROTECTED]> wrote: > On Tue, Apr 22, 2008 at 2:03 PM, Peter Browne > <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm returning to Cocoa after quite a long break, and it seems that I'm a > > little rusty... > > > > All I want to do is f

Re: Problems with [NSArray count]

2008-04-22 Thread David Duncan
On Apr 22, 2008, at 2:03 PM, Peter Browne wrote: I'm returning to Cocoa after quite a long break, and it seems that I'm a little rusty... All I want to do is find out the number of items in an NSArray and store that as a variable, which I can then find the square root of. The docs tell me

Re: Problems with [NSArray count]

2008-04-22 Thread Shawn Erickson
On Tue, Apr 22, 2008 at 2:03 PM, Peter Browne <[EMAIL PROTECTED]> wrote: > Hi, > > I'm returning to Cocoa after quite a long break, and it seems that I'm a > little rusty... > > All I want to do is find out the number of items in an NSArray and store > that as a variable, which I can then find th

Problems with [NSArray count]

2008-04-22 Thread Peter Browne
Hi, I'm returning to Cocoa after quite a long break, and it seems that I'm a little rusty... All I want to do is find out the number of items in an NSArray and store that as a variable, which I can then find the square root of. The docs tell me that [NSArray count] returns an NSUInteger,