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 tho开发者_JAVA百科se 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.
Mr Xcode is right. You missed out the bracket after tabReference.
NSLog(@"titleName:%@", [[[self.myLibrary objectAtIndex:self.currentNoteBookNumber] tabReference] objectAtIndex:tid]);
精彩评论