I have a problem understanding this problem I have the following code, I am trying to sort key and sort them at the same time. But, it is not sorted Output NSArray's order does not matter what I do. I think you are confused about that These entries are in your dictionary: < Code> keys Selectable Value Selector: The method effectively applies that table to a "????" Organizes by Value? Column: (Note that Then one of the key Array returns, Order is computed only in: Note that the If you want to sort key by itself using the key, do this: compare-selector / <> compare code
NSMutableDictionary * dictToSort = [[NSMutableDictionary alloc] initWithObjectsAndKeys: @ "Joe", [NSNumber NumberHome: 2], @ "Icon", [NSNumber Number with Int: 1], @ "M Dirk ", [NSNumber numberAttah: 3], zero]; NSArray * dictToSortKeys = [dictToSort keysService given user selector: @sillector (compare :)); NSLog (@ "Not Sorted"); NSNumber * xx = dictToSortKeys [0]; NSNumber * xy = dictToSortKeys [1]; NSNumber * Xz = DecoSortCas [2]; NSLog (@ "Sorted% d% d% d", xx.integerValue, xy.integerValue, xz.integerValue); I do not find how this code is computed: The function's function says that it gives
NSOrderedAscending, NSOrderedSame or NSOrderedDescending , But there is no way to get these returns. And also, this is considered magical work? The documentation for this comparative thing is pretty bad.
keysSortedByValueUsingSelector: It converts dictionary entries by value , and returns the key in that sequence.
Key value - ----- 1 digit 2 that is 3 mdark
Key value -------- 2 which is 1 point 3 mdark
joe Before the alphabet>
symbol and
symbol before the spectrum occurs before
mdark .)
@ [@ 2, @ 1, @ 3] .
keysBibleUser Selector: never compares keys, it compares values to only .
NSArray * dictToSortKeys = [DictToSort.allKeys is sorted by User: @Selector (compare Please :) :);
No comments:
Post a Comment