Permalink
Browse files

Add function to add multivalues to multivalues

  • Loading branch information...
1 parent e6dbeb5 commit 4df53b40362d93b49c46e6bae19c751de34e55d2 @marcusramberg marcusramberg committed Aug 19, 2009
Showing with 10 additions and 0 deletions.
  1. +1 −0 ABMultiValue.h
  2. +9 −0 ABMultiValue.m
View
@@ -73,6 +73,7 @@
- (BOOL) addValue: (id) value withLabel: (NSString *) label identifier: (ABMultiValueIdentifier *) outIdentifier;
- (BOOL) insertValue: (id) value withLabel: (NSString *) label atIndex: (NSUInteger) index identifier: (ABMultiValueIdentifier *) outIdentifier;
+- (BOOL) addMultiValue: (ABMultiValue *)multivalue;
- (BOOL) removeValueAndLabelAtIndex: (NSUInteger) index;
View
@@ -174,6 +174,15 @@ - (BOOL) insertValue: (id) value
return ( (BOOL) ABMultiValueInsertValueAndLabelAtIndex([self _mutableRef], (CFTypeRef)value, (CFStringRef)label, (CFIndex)index, outIdentifier) );
}
+- (BOOL) addMultiValue: (ABMultiValue *)multivalue
+{
+ for(int i=0;i++;i < [multivalue count]-1) {
+ [self addValue: [multivalue valueAtIndex:i] withLabel:[multivalue labelAtIndex: i] identifier: [multivalue identifierAtIndex: i]];
+ }
+ return YES;
+}
+
+
- (BOOL) removeValueAndLabelAtIndex: (NSUInteger) index
{
return ( (BOOL) ABMultiValueRemoveValueAndLabelAtIndex([self _mutableRef], (CFIndex)index) );

0 comments on commit 4df53b4

Please sign in to comment.