鉴于以下 Objective-C 示例,保留单独的语句或将它们捆绑在一起仅仅是样式和易于阅读的问题吗?两者都有实际好处吗?声明单个变量是否浪费内存?
NSDictionary *theDict = [anObject methodToCreateDictionary];
NSArray *theValues = [theDict allValues];
NSString *theResult = [theArray componentsJoinedByString:@" "];
或者
NSString *theResult = [[[anObject methodToCreateDictionary] theValues] componentsJoinedByString:@" "];