forked from jerrykrinock/CategoriesObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSCountedSet+Votes.h
40 lines (29 loc) · 1.13 KB
/
NSCountedSet+Votes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import <Cocoa/Cocoa.h>
@interface NSCountedSet (Votes)
/*!
@brief Returns the member of the receiver which has the
highest count
@details Returns nil if there is more than one member with
the highest count (a "tie"). Also returns nil if
the receiver is empty.
*/
- (id)winner ;
@end
@interface NSDictionary (Subdictionaries)
/*!
@brief Assuming that the receiver's objects are also
dictionaries (subdictionaries), returns a counted set of all
the different values for a given key in all the subdictionaries.
@details The count of each item in the returned set is equal
to the number of subdictionaries which had an equal item as
the object for the given key. If none of the
subdictionaries have an object for the given key and no
defaultObject is given, returns an empty set.
@param defaultObject An object which will be added to the
result, one for each subdictionary in the receiver which has
no object for the given key, or nil if you do not want any object
added for missing objects.
*/
- (NSCountedSet*)objectsInSubdictionariesForKey:(id)key
defaultObject:(id)defaultObject ;
@end