问:我需要做什么:
访问数组中的第三项并将其存储在名为“ bookTitle”的字符串变量中。
我的解决方案(不起作用):
NSArray * booksArray = [NSArray arrayWithObjects:@“ Hamlet”,@“ King Lear”,@“ Othello”,@“ Macbeth”,无];
NSString * bookTitle = [NSString initWithObject:[booksArray objectAtIndex:2]];
答:几乎是正确的,但这就是CC引擎正在寻找的东西:
NSArray * booksArray = [NSArray arrayWithObjects:@“ Hamlet”,@“ King Lear”,@“ Othello”,@“ Macbeth”,无];
NSString * bookTitle = [booksArray objectAtIndex:2];