Subscribe ( )

iPhone Programming Tutorials


 

Forum

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 9

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

Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

4 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.