可能重复:
What does the question mark and the colon (?: ternary operator) mean in objective-c?任何人都可以帮助我理解这一点吗? ------()? []:[]中的ObjectiveC
NSString *requestString = (self.isFirstTimeDownload) ? [NSString stringWithFormat:[self.commonModel.apiURLs objectForKey:@"updateNewsVerPOST"],@""] : [NSString stringWithFormat:[self.commonModel.apiURLs objectForKey:@"updateNewsVerPOST"], [[NSUserDefaults standardUserDefaults] objectForKey:@"localnewsupdate"]];
谁能帮我明白这是()?和:在Objective-c中? 谢谢!
的可能重复[什么问号和冒号(?:三元运算符)的意思是在Objective-C?(HTTP://计算器.com/q/2595392 /),[这是什么意思:NSString * string = NO? @“aaa”:@“bbb”;](http://stackoverflow.com/q/8290073/),[不明白此语法](http://stackoverflow.com/q/12132665/),[ Objective-C运算符(?)和(:)](http://stackoverflow.com/q/11705848/),[以下语句中的“?”是什么意思?](http://stackoverflow.com/ q/5832134 /),[无效? @“inactive”:@“active”语法?](http://stackoverflow.com/q/10239632/), –