Array Iteration

Hi everyone, I'm trying to iterate an array of strings when I click a button in my iPhone app. In the viewDidLoad method, this code works fine, however, I use the tab bar to switch between views, and I want the view to refresh when I switch to it from another view. This is the code that it breaks, very similar to the code that I use in another button that works great

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

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

+3
source share
2 answers
for (NSString* string in arrayOfStrings ){
    NSLog(@"%@", string);
}

Objective-C Programming Language - Quick Enumeration

+6

, @vikingosegundo NSZombieEngabled, . :

 id obj = nil;

!

+2

Source: https://habr.com/ru/post/1775708/


All Articles