Subscribe ( )

iPhone Programming Tutorials

 

Forum

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

You must be logged in to post Login Register

Search 

Problem in array initialisation

User Post

6:36 am
March 18, 2009


antilantil

iCoder

posts 6

1

Hi ,

i am facing problem in array initialisation . Throwing uncaught exception “Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: method sent to an uninitialized immutable array object' ” during run time
my code is 

array = [NSMutableArray alloc] ;
for(n =0 ; n < 15; n++)
{
for(m = 0; m < 8; m++)
{

makeBoardView *frameView1 =[[makeBoardView alloc] initWithFrame:CGRectMake(origX,origY, frameWidth,frameHeight)];
[array insertObject:frameView1 atIndex:indexArray];// addObject:frameView1];
origX = origX + 38;
indexArray++;
[frameView1 release];
}
origX = 178.04;
origY = origY + 20.0;
}

[array addObject:nil];
NSLog(@”array element %d”,[array count]);

Kindly suggest me the solution for that issue


About the iCodeBlog forum

Currently Online:

5 Guests

Maximum Online: 25

Forums:

Groups: 2

Forums: 6

Topics: 293

Posts: 729

Members:

There are 625 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 53

crazyiez - 30

VertigoSol - 26

AdeC - 17

Uhu - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)