开发者

Iterating Through an NSArray

开发者 https://www.devze.com 2023-01-06 06:57 出处:网络
Can someone help me fix my code here. I am trying to do开发者_开发百科 something simple iterate through the whole array that has NSString\'s in it convert them to NSIntegers and assign them to a NSInt

Can someone help me fix my code here. I am trying to do开发者_开发百科 something simple iterate through the whole array that has NSString's in it convert them to NSIntegers and assign them to a NSInteger variable.

 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;          
}  


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

精彩评论

暂无评论...
验证码 换一张
取 消