NSMutableArray *mutArray=[[NSMutableArray alloc]init];
for(int i=0;i<=2;i++)
{
NSString *object=@"Hello";
[mutArray addObject:object];
}
NSLog(@"Mutable Array==%@",mutArray);
//if the object are in other array then
NSArray *objArray=[[NSArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",nil];
NSLog(@"obje==%@",objArray);
NSMutableArray *myMutableArray=[[NSMutableArray alloc]init];;
for(int index=0;index<objArray.count;index++)
{
[myMutableArray addObject:[objArray objectAtIndex:index]];
}
NSLog(@"myMutable Array==%@",myMutableArray);
save object using for loop how to add objects in array using for loop using for loop add object to array in ios iphone Array objects objects from another array
0 Comment(s)