Re: Problem instantiating an array

2010-12-07 Thread Ken Thomases
On Dec 7, 2010, at 12:11 PM, Dennis wrote: > Thanks for taking a look at my code. Sure. > On Dec 6, 2010, at 10:35 PM, Ken Thomases wrote: > >> If you step after the line "TileColumn *allColumns[boardDimension - 1]", >> nothing has happened, yet. That's just a declaration. > > But if for exa

Re: Problem instantiating an array

2010-12-07 Thread Dave Carrigan
On Dec 7, 2010, at 10:11 AM, Dennis wrote: > On Dec 6, 2010, at 10:35 PM, Ken Thomases wrote: > >> If you step after the line "TileColumn *allColumns[boardDimension - 1]", >> nothing has happened, yet. That's just a declaration. > > But if for example I declare int test[16], the debugger shows

Re: Problem instantiating an array

2010-12-07 Thread Wim Lewis
On 7 Dec 2010, at 10:11 AM, Dennis wrote: > But if for example I declare int test[16], the debugger shows the array > "test" with 16 members. That's not happening in the case of my code with > allColumns. It's displaying an array of -1 members. It's possible that the debugger simply doesn't kno

Re: Problem instantiating an array

2010-12-07 Thread Dennis
Hi Ken, Thanks for taking a look at my code. On Dec 6, 2010, at 10:35 PM, Ken Thomases wrote: > If you step after the line "TileColumn *allColumns[boardDimension - 1]", > nothing has happened, yet. That's just a declaration. But if for example I declare int test[16], the debugger shows the ar

Re: Problem instantiating an array

2010-12-07 Thread Ken Thomases
On Dec 7, 2010, at 2:40 AM, Graham Cox wrote: > On 07/12/2010, at 5:35 PM, Ken Thomases wrote: > >>> gameColumns = [NSArray arrayWithObjects:allColumns count: boardDimension]; > > Another issue with this line is that, assuming 'gameColumns' is an instance > variable of the object, the array wil

Re: Problem instantiating an array

2010-12-07 Thread Graham Cox
On 07/12/2010, at 5:35 PM, Ken Thomases wrote: >> gameColumns = [NSArray arrayWithObjects:allColumns count: boardDimension]; Another issue with this line is that, assuming 'gameColumns' is an instance variable of the object, the array will be autoreleased, leaving the variable pointing at dea

Re: Problem instantiating an array

2010-12-06 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dennis Birch wrote: > I'm new to Cocoa programming and brand new to this list, so I hope it's > appropriate to ask this question here. Welcome! > // Initialization code here. > TileColumn *allColumns[boardDimension - 1]; >

Re: Problem instantiating an array

2010-12-06 Thread Ken Thomases
Hi, On Dec 5, 2010, at 12:39 PM, Dennis Birch wrote: > - (id)initWithFrame:(NSRect)frame { >self = [super initWithFrame:frame]; >if (self) { >// Initialization code here. > TileColumn *allColumns[boardDimension - 1]; The above declaration is wrong for what you're tr

Problem instantiating an array

2010-12-06 Thread Dennis Birch
I'm new to Cocoa programming and brand new to this list, so I hope it's appropriate to ask this question here. I've run into a showstopper with my first project on my own (i.e. not a project from a book). I've created a custom View subclass, and when I try to instantiate an array of another cus