2010-07-06 5 views
2

누군가 내 코드를 여기에서 수정할 수 있도록 도와 줄 수 있습니까? NSString을 NSIntegers로 변환하고 NSInteger 변수에 할당하는 전체 배열을 통해 간단한 반복 작업을 수행하려고합니다.NSArray를 통한 반복

for (NSInteger *itemF in myNSArray) { 
    //WHERE "slotA" is an NSInteger and "itemF" is stored as an NSString and I wanna conver to NSInteger 
    //and store is in the var. 
    slotA=itemF;   
} 

답변

6
for (NSString *string in array) 
{ 
    NSInteger integer = [string integerValue]; 
}