【发布时间】:2013-05-19 08:25:28
【问题描述】:
鉴于以下 Objective-C 示例,保留单独的语句或将它们捆绑在一起仅仅是样式和易于阅读的问题吗?两者都有实际好处吗?单独声明变量是不是很浪费内存?
NSDictionary *theDict = [anObject methodToCreateDictionary];
NSArray *theValues = [theDict allValues];
NSString *theResult = [theArray componentsJoinedByString:@" "];
或
NSString *theResult = [[[anObject methodToCreateDictionary] theValues] componentsJoinedByString:@" "];
【问题讨论】: