1

I was wondering how to access an array in an array.

This works with a string in an array:

NSLog(@"titleName:%@", [[self.myLibrary objectAtIndex:0] titleName]);

That is, I have an array myLibrary in which I store different classes, each of which has a string for a titleName. In each class I also have arrays and I was wondering how to get access to those arrays. I tried this, but it won't compile as xCode tells me I'm missing an ]:

NSLog(@"titleName:%@", [[self.myLibrary objectAtIndex:self.currentNoteBookNumber] tabReference objectAtIndex:tid]);

Sorry if this is basic, but I'd appreciate your suggestions.

1 Answer 1

2

Mr Xcode is right. You missed out the bracket after tabReference.

NSLog(@"titleName:%@", [[[self.myLibrary objectAtIndex:self.currentNoteBookNumber] tabReference] objectAtIndex:tid]);
Sign up to request clarification or add additional context in comments.

3 Comments

... but that doesn't make sense. I have two [[ to open and then three ]]] to close?
sorry, its [[[ to open... I should have known. Sorry to have bothered you with this.
Sure! I tried to do this earlier, but it said that I needed to wait for a couple of minutes. Thanks so much again for your help!

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.