Archive for August, 2008
iPhone Dev: ABAddressBook ABMultiValue Debugging
For those of you who have done work with the ABAddressBook framework, I have found the following method for testing the contents of an ABMultiValue object extremely handy!
No comments
void printMultiValue(char *title,id prop, ABPerson *p){
int j,k;
ABMultiValue *multi = [p valueForProperty:prop];
if([multi count])
printf(” * %s:\n“,title);
// sometimes we get NSDictionaries for values. These
// need to be handled differently (kABAddressProperty does this, for example)
if ([[multi valueAtIndex:0] isKindOfClass:[NSDictionary class]] == YES){
for (k=0;k<[multi count];++k){
NSArray *keys, *values;
keys = [[multi valueAtIndex:k] allKeys];
values = [[multi valueAtIndex:k] allValues];
// get the dictionary name
printf(” * %s\n“,
[[multi labelAtIndex:k] UTF8String]);
for (j=0;j<[keys count];++j){
printf(” * %s: %s\n“,
[[keys objectAtIndex:j] UTF8String],
[[values objectAtIndex:j] UTF8String]);
}
}
}else{
for (j=0;j<[multi count];++j){
printf(” * %s: %s\n“,
//[[multi identifierAtIndex:j] UTF8String],
[[multi labelAtIndex:j] UTF8String],
[[multi valueAtIndex:j] UTF8String]);
}
}
}
Upcoming Events: 360|Flex
It’s official, I am attending 360|Flex in San Jose on August 18-20 with the team at andCulture. Hit me up at contact@wintondeshong.com if you are going to be at 360|Flex or in the area.
No comments