Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Iterating through an array

Hey everyone, I am trying to iterate though an array of strings when I click a button in my iPhone app. In the viewDidLoad method this code works great, however, I am using a Tab Bar to switch between views, and I want the view to refresh itself when i switch to it from another view. This is the code it is breaking around, very similar to code I am using in another button that works perfectly

        NSEnumerator *e = [deckList objectEnumerator];
        id obj;

It crashes whenever it gets to "id obj" Any help would be most appreciated.

like image 629
user501327 Avatar asked May 30 '26 07:05

user501327


1 Answers

for (NSString* string in arrayOfStrings ){
    NSLog(@"%@", string);
}

The Objective-C Programming Language — Fast Enumeration

like image 110
vikingosegundo Avatar answered Jun 01 '26 04:06

vikingosegundo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!