diff --git a/ChangeLog b/ChangeLog index 7e5a34c6c..833f35d81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-13 Wolfgang Sourdeau + + * SoObjects/SOGo/NSArray+Utilities.m ([NSArray + -asPointersOfObjects]): new method that transforms an NSArray into + an array of ptr**; + 2008-06-02 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailPartICalViewer.m diff --git a/SoObjects/SOGo/NSArray+Utilities.h b/SoObjects/SOGo/NSArray+Utilities.h index 998cab7c8..96825c3d5 100644 --- a/SoObjects/SOGo/NSArray+Utilities.h +++ b/SoObjects/SOGo/NSArray+Utilities.h @@ -29,6 +29,8 @@ @interface NSArray (SOGoArrayUtilities) +- (id *) asPointersOfObjects; + - (NSString *) jsonRepresentation; - (NSArray *) stringsWithFormat: (NSString *) format; diff --git a/SoObjects/SOGo/NSArray+Utilities.m b/SoObjects/SOGo/NSArray+Utilities.m index 1e63756bf..389b2a363 100644 --- a/SoObjects/SOGo/NSArray+Utilities.m +++ b/SoObjects/SOGo/NSArray+Utilities.m @@ -27,6 +27,19 @@ @implementation NSArray (SOGoArrayUtilities) +- (id *) asPointersOfObjects +{ + id *pointers; + unsigned int max; + + max = [self count]; + pointers = malloc (sizeof(id) * (max + 1)); + [self getObjects: pointers]; + *(pointers + max) = nil; + + return pointers; +} + - (NSArray *) stringsWithFormat: (NSString *) format { NSMutableArray *formattedStrings;