Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

a method that will probably be deleted

  • Loading branch information...
commit 5f11ea23a809871ba1251b29be6a0eb1dfe6fefa 1 parent 5d4224c
Zachary Schneirov authored
Showing with 11 additions and 0 deletions.
  1. +1 −0  NSCollection_utils.h
  2. +10 −0 NSCollection_utils.m
View
1  NSCollection_utils.h
@@ -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
10 NSCollection_utils.m
@@ -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++) {
Please sign in to comment.
Something went wrong with that request. Please try again.