fast-enumeration
Objective-C Fast Enumeration Bubble Sort
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:[详细]
2023-02-09 03:51 分类:问答If the type of objects in a collection is known, should I specify the type of the iterating variable when using fast enumeration?
For example, say I have an NSArray that contains a bunch of NSString objects: NSArray *games = [NSArray arrayWithObjects:@\"Space Invaders\", @\"Dig Dug\", @\"Galaga\", nil];[详细]
2023-02-06 09:09 分类:问答Objective c "for each" (fast enumeration) -- evaluation of collection?
It seems from experimentation that the collection expression is evaluated only once. Consider this example:[详细]
2023-01-18 22:22 分类:问答Iterating Through an NSArray
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[详细]
2023-01-06 06:57 分类:问答Does fast enumeration in Objective-C guarantee the order of iteration?
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.[详细]
2022-12-29 02:20 分类:问答fast enumeration on NSDictionary fails with "[Waypoint countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance ..."
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:[详细]
2022-12-16 08:02 分类:问答Application not entering Fast Enumeration loop
after much debugging, I have determined that this code is ignoring the fast enumeration loop and blindly jumping to the end:[详细]
2022-12-16 03:32 分类:问答Is fast enumeration considered bad form or is it generally accepted?
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.[详细]
2022-12-16 02:38 分类:问答