hi am working with NSArrays using foundation tool and i have wrote the following code
-(void)simplearrays
{
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:3];
for(int i =0;i<3;i++)
{
scanf("%d",&arr[i]);
}
for(int j =0; j<3;j++)
{
printf("\n%d",arr[j]);
}
}
My query is that the above code when executed shows the given output but the i get an error once the application finishes execution which says that "can't allocate region" can you please help.
Also i wanted to know the difference between NSArray and NSMutable Array in icode blog i have read that nsarray can dynamically resize so if NSArray can dynamically resize then why to use NSMutable array or a better one would be when to use NSArray and when to use NSMutable Array???