考虑到下面的Objective-C例子,它仅仅是一种风格和易读性的问题,可以保留单独的语句或将它们捆绑在一起?是否有任何实际的好处?宣布单个变量是否浪费内存?将声明合并为一个声明还是不合并?
NSDictionary *theDict = [anObject methodToCreateDictionary];
NSArray *theValues = [theDict allValues];
NSString *theResult = [theArray componentsJoinedByString:@" "];
或
NSString *theResult = [[[anObject methodToCreateDictionary] theValues] componentsJoinedByString:@" "];
感谢您的澄清。 – tomchkk