I\'m trying to integrate some GCD into my code, and have found that a severe bottleneck is a bubble comparison I am performing between objects in a large array.Here is the original code:
For example, say I have an NSArray that contains a bunch of NSString objects: NSArray *games = [NSArray arrayWithObjects:@\"Space Invaders\", @\"Dig Dug\", @\"Galaga\", nil];
It seems from experimentation that the collection expression is evaluated only once. Consider this example:
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 I expect it to go from the start of an array to the end in order? Can\'t find anything in the docs about this.
I have my data in a NSDictionary object where the keys are CGPoints converted to NSValues and the objects are UIColors. Here\'s the method I\'m using to return an object from the dictionary:
after much debugging, I have determined that this code is ignoring the fast enumeration loop and blindly jumping to the end:
Just wondering, it seems like it works pretty well but I want to make sure I am using generally accepted coding practices and not get开发者_开发知识库 into bad habits.