Permalink
Browse files

a method that will probably be deleted

  • Loading branch information...
1 parent 5d4224c commit 5f11ea23a809871ba1251b29be6a0eb1dfe6fefa Zachary Schneirov committed Feb 1, 2010
Showing with 11 additions and 0 deletions.
  1. +1 −0 NSCollection_utils.h
  2. +10 −0 NSCollection_utils.m
View
@@ -40,6 +40,7 @@
//- (NSRange)nextRangeForString:(NSString*)string activeNote:(NoteObject*)startNote options:(unsigned)opts range:(NSRange)inRange;
- (void)addMenuItemsForURLsInNotes:(NSMenu*)urlsMenu;
- (NSUInteger)indexOfNoteWithUUIDBytes:(CFUUIDBytes*)bytes;
+- (NSArray*)objectsFromDictionariesForKey:(id)aKey;
@end
@interface NSMutableArray (Sorting)
View
@@ -104,6 +104,16 @@ - (NSMutableSet*)setIntersectedWithSet:(NSSet*)set {
@implementation NSArray (NoteUtilities)
+- (NSArray*)objectsFromDictionariesForKey:(id)aKey {
+ NSUInteger i = 0;
+ NSMutableArray *objects = [NSMutableArray arrayWithCapacity:[self count]];
+ for (i=0; i<[self count]; i++) {
+ NSDictionary *info = [self objectAtIndex:i];
+ [objects addObject:[info objectForKey:aKey]];
+ }
+ return objects;
+}
+
- (NSUInteger)indexOfNoteWithUUIDBytes:(CFUUIDBytes*)bytes {
NSUInteger i;
for (i=0; i<[self count]; i++) {

0 comments on commit 5f11ea2

Please sign in to comment.