Is there any compiler option to warn that the type in the for-in loop is wrong? NSArray<NSString *> *stringsArray = @[ @"Hello", @"World" ] ...
Is there any compiler option to warn that the type in the for-in loop is wrong? NSArray<NSString *> *stringsArray = @[ @"Hello", @"World" ] ...
Trying to determine run-time and space complexity of a HashTable (NSMutableDictionary) based solution following question: Implement a TwoSum interfac ...
I have: The loop block never changes server. servers is an NSMutableArray with dictionaries, a property that's not changed during the loop. Why d ...
I learnt the hard way that you can't remove objects from an NSMutableArray when you are looping through the objects in it. Looping through [< arra ...
Is there are better way to do this? Something that looks nicer syntax wise? Something like this, but then with the correct syntax? ...
I was wondering Why is iterating through NSArray is faster than iterating through NSSet? I imaging that it has something to do with the fact that NSAr ...
What lines of code allow us to print the iterations through fast enumeration without repeating the prefatory statement? My code is the following: ...
You can put primitives in an NSArray or NSDictionary by packing them with the @() syntax. For example: But how do you then use this with fast enume ...
I was just wondering, if there was any way of pausing a for loop. For instance, The outcome should be: 1 (wait 1 sec) 2 (wait 1 sec) etc. Firstly ...
I faced "Collection <_NSFaultingMutableSet: 0x7fac9c011190> was mutated while being enumerated" issue. I know what it means, I found it on SO. ...
So I have a NSFetchedResultsController. I have it working fine for normally displaying the data. I have a situation where I need to be able to enumara ...
I'm triying to access each item on an NSArray trough enumerateObjectsUsingBlock, since it let me use fast enumration and evaluating the index. When I ...
I think i blew up my brain. I have a dictionary with two arrays: letters and numbers. Numbers are the letters' positions on a board. How can I enumer ...
I am trying to fast enumerate through all of my collection view cells, however this implementation below is giving me a warning. Error below appear ...
I'm wondering how to transform the following below into Swift. I have attempted it, but have gotten stuck on a concept: I am looping through all my o ...
The following code doesn't loop: Here are the results of the strategically placed NSLog statements: As you can see, I've tried both a traditiona ...
I was wondering how do I get sort through an do something different based on every "tenth" item in an array. I don't know much but I think it would ki ...
I am quite confused on doing fast enumeration with array filled with similar objects Suppose : I have 1 class (Stock Class), it has 1 subClass Forei ...
I"m wondering how to essentially transform the objective c code below into swift. This will loop through all the subviews on my desired view, check i ...
In Objective-C, is it possible to restart to the first iteration of a for loop? I don't want to do anything with my objects until I find a "good" obje ...