NSMutableArray * oneText = [[NSMutableArray alloc] init];
[oneText addObject:[arraySystem objectAtIndex:[countImage intValue]]];
[oneText addObject:@".png"];
NSString *oneTextText=[oneText objectAtIndex:0];
[oneTextText stringByAppendingString:[oneText objectAtIndex:1]];
NSLog(oneTextText);
为什么上面的代码不能打印'Length.png'?因为[arraySystem objectAtIndex:[countImage intValue]]
等于'长度'
它只打印'长度'
答案 0 :(得分:4)
在调用stringByAppendingString时输入“oneTextText =”,它应该是:
oneTextText = [oneTextText stringByAppendingString:[oneText objectAtIndex:1]];