mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 14:57:12 +00:00
Monotone-Parent: 29948ba19f24f47aa6c1b2c0764586b89ff9493f
Monotone-Revision: 1a5434f30282a4932bf29227da4cf2da44ef5783 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-11T22:28:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
45f0686d92
commit
6c5003d7bc
22 files changed
+773
-480
No files matched your search
@@ -25,6 +25,7 @@
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
@class NSArray;
|
||||
@class NSString;
|
||||
|
||||
@interface NSDictionary (SOGoDictionaryUtilities)
|
||||
@@ -36,4 +37,11 @@
|
||||
|
||||
@end
|
||||
|
||||
@interface NSMutableDictionary (SOGoDictionaryUtilities)
|
||||
|
||||
- (void) setObjects: (NSArray *) objects
|
||||
forKeys: (NSArray *) keys;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* NSDICTIONARY_UTILITIES_H */
|
||||
@@ -23,6 +23,7 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSNull.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
@@ -103,3 +104,23 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMutableDictionary (SOGoDictionaryUtilities)
|
||||
|
||||
- (void) setObjects: (NSArray *) objects
|
||||
forKeys: (NSArray *) keys
|
||||
{
|
||||
unsigned int count, max;
|
||||
|
||||
max = [objects count];
|
||||
if ([keys count] == max)
|
||||
for (count = 0; count < max; count++)
|
||||
[self setObject: [objects objectAtIndex: count]
|
||||
forKey: [keys objectAtIndex: count]];
|
||||
else
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Number of objects does not match"
|
||||
@" the number of keys."];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user