0

I can't seem to append a string from arrayOne into arrayTwo. It's a very simple problem and I have Googled around and have tried different examples that I found below. Does anyone see the obvious issue here?

[_arrayTwo addObject:arrayOne[i]]; // int i
[_arrayTwo addObject:[arrayOne objectAtIndex:i]]; // int i
[_arrayTwo addObject:@"Test"]; // I can't even add a literal string

NSString *tempString = [arrayOne objectAtIndex:i];
[arrayTwo addObject:tempString];

NSLog Output:

NSLog(@"%@", _imageArray); // Result is "(null)"

Additional Notes:

  1. arrayOne is healthy (contains NSString values)
  2. Both arrays are NSMutableArray (declared as properties in the .h)

1 Answer 1

3

I believe _imageArray is nil

Try adding in

_imageArray = [[NSMutableArray alloc] init];

In your init method call.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.