I have three NSArray
objects. I need to add all objects for this array to NSArray
that is called allMyObjects.
Have NSArray
standard solution to make it for example via initialization method or do I need make custom method to retrieve all objects from other arrays and put all retrieved objects to my allMyObjects array?
once see this one ,
NSArray *newArray=[[NSArray alloc]initWithObjects:@"hi",@"how",@"are",@"you",nil];
NSArray *newArray1=[[NSArray alloc]initWithObjects:@"hello",nil];
NSArray *newArray2=[[NSArray alloc]initWithObjects:newArray,newArray1,nil];
NSString *str=[newArray2 componentsJoinedByString:@","];
NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@"()\n "];
str = [[str componentsSeparatedByCharactersInSet:doNotWant] componentsJoinedByString: @""];
NSArray *resultArray=[str componentsSeparatedByString:@","];
NSLog(@"%@",resultArray);
O/P:-
(
hi,
how,
are,
you,
hello
)