如何在Objective-C的特定索引处打印数组元素?我的代码如下所示:如何在Objective-C中打印单个数组元素?
NSString *String=[NSString StringWithContentsOFFile:@"/User/Home/myFile.doc"];
NSString *separator = @"\n";
NSArray *array = [String componetntsSeparatedByString:separator];
NSLog(@"%@",array);
我可以一次打印阵列的全部内容,但我想每个索引处的元素分配到一个字符串,如...
str1=array[0];
str2=array[1];
str3=array[0];...this continues
我该怎么做?
嘿我得到了答案...对不起....它的 NSLog(@“%@”,[array objectAtIndex:index]); – suse 2010-02-05 06:36:14