Monotone-Parent: af5a859ee61b26ffd727e648f95c54ee60e3079e

Monotone-Revision: 668c4f876568e36b66e3c665c37e3108a08fb967

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-15T19:50:20
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-08-15 19:50:20 +00:00
parent a37f85fba7
commit 810eb67b40
3 changed files with 68 additions and 0 deletions
+56
View File
@@ -33,6 +33,7 @@
id currentObject;
formattedStrings = [NSMutableArray arrayWithCapacity: [self count]];
objects = [self objectEnumerator];
currentObject = [objects nextObject];
while (currentObject)
@@ -45,6 +46,61 @@
return formattedStrings;
}
- (NSArray *) keysWithFormat: (NSString *) format
{
NSMutableArray *formattedStrings;
NSEnumerator *objects;
id currentObject;
formattedStrings = [NSMutableArray arrayWithCapacity: [self count]];
objects = [self objectEnumerator];
currentObject = [objects nextObject];
while (currentObject)
{
[formattedStrings addObject: [currentObject keysWithFormat: format]];
currentObject = [objects nextObject];
}
return formattedStrings;
}
- (NSArray *) objectsForKey: (NSString *) key
{
NSMutableArray *objectsForKey;
unsigned int count, max;
id value;
max = [self count];
objectsForKey = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
value = [[self objectAtIndex: count] objectForKey: key];
[objectsForKey addObject: value];
}
return objectsForKey;
}
- (NSArray *) flattenedArray
{
NSMutableArray *flattenedArray;
NSEnumerator *objects;
id currentObject;
flattenedArray = [NSMutableArray array];
objects = [self objectEnumerator];
currentObject = [objects nextObject];
while (currentObject)
{
[flattenedArray addObjectsFromArray: currentObject];
currentObject = [objects nextObject];
}
return flattenedArray;
}
- (void) makeObjectsPerform: (SEL) selector
withObject: (id) object1
withObject: (id) object2