I am filling array in view did load method but the problem is that each time view is loaded it adds again and again same content i want that if first time view is loaded then it should add contents in array not in the second time repeatedly. Here is my code:
for (int i=0;i<5;i++) {
Coffee*obj=[appDelegate.coffeeArray objectAtIndex:i];
NSLog(@"This is working %d",i);
[appDelegate.arrayOne addObject:obj];
}
for (int a=5;a<8;a++) {
Coffee*obj=[appDelegate.coffeeArray objectAtIndex:a];
[appDelegate.arrayTwo addObject:obj];
}
two array i am filling from another array but it repeats values if we move from one view to another and again come back