我正在使用 for 语句来枚举数组中的所有对象。对于数组中的每个对象,我想创建它,以便它每次创建一个不同的对象,以便我可以引用不同的对象,例如数组中有 5 个字符串对象。我使用 for 语句枚举每个对象,并且每次我想创建一个包含文本 @"hello" 的 nsmutablestring
for (NSString *string in array) {
// Ignore string variable
NSMutableString *
// I have this problem, how do I code it so that it makes a new NSMutableString with a separate name that i can specify
// so i can refer to it
= [NSMutableString alloc] init];
// More code that is not relevant
}
万一你不明白这里是不是简单......在一个数组中 - 5个对象枚举数组并每次使用单独的名称创建一个新对象,以便我可以引用它:object1 object2 object3 object4 object5
更新:
数组我的意思是 NSArray
我的问题是我正在添加 uiimageview ...