How to add NSMutableArray as an object(i) for another NSMutableArray
My code is:
yearImages = [[NSMutableArray alloc]init];
tempImages = [[NSMutableArray alloc]init];
for(int i =0; i< [yearImagesName count]; i++)
{
for(int j=0; j<[totalImagesName count]; j++)
{
if ([[totalImagesName objectAtIndex:j] rangeOfString:[yearImagesName objectAtIndex:i]].location != NSNotFound)
{
[tempImages addObject:[totalImagesName objectAtIndex:j]];
}
}
[yearImages addObject:tempImages];
[tempImages removeAllObjects];
}
NSLog(@"\n\n year%@",[yearImages objectAtIndex:0]); // getting null result
Here i need to add tempImages as object of (i) for yearImages..
I need result as like follows:
[yearImages objectAtIndex:i];// result need as arrayobjects here
nullplz check have you initialised every object in your code?