I am trying to copy a specific values at specific index from one array to another like this:
for (int i = 0; i < 100; i++) {
if ([subID[i] isEqual: @"0"]) {
NSLog(@"state : %@",arrayTempState[i]);
NSString *str = arrayTempState[i];
[arrayState addObject:str];
NSLog(@"%@",arrayState[i]);
}
arrayState
is NSMutableArray
and arrayTempState
is NSArray
but arrayState
is null every time.
I tried arrayState[i] = arrayTempState[i];
but it did not work.
arrayState
was not initialised that is why it couldn't store the value.