[OGo-Developer] accessing telephone numbers of team members in OGOGroupsPage

Helge Hess developer@opengroupware.org
Tue, 6 Mar 2007 11:03:44 +0100


On Mar 6, 2007, at 10:58, Sebastian Reitenbach wrote:
>   /* fetch members */
>   members = [cmdctx runCommand:@"team::members",
>                     @"teams",      self->groupList,
>                     @"returnType", intObj(LSDBReturnType_ManyObjects),
>                     nil];
> NSLog(@"The team members telephones: %@", telephones);

Sebastian, sorry, but please do the obvious and get and read a C  
tutorial. Then read the Objective-C book. This is really 101 stuff.

   members = [cmdctx runCommand:@"team::members",
                     @"teams",      self->groupList,
                     @"returnType", intObj(LSDBReturnType_ManyObjects),
                     nil];
   for (int i = 0; i < [members count]; i++) {
     NSLog(@"member: %@", [members objectAtIndex:i]);

     NSArray *tels = [[members objectAtIndex:i]  
valueForKey:@"telephones"];
     for (int j = 0; j < [tels count]; j++)
       NSLog(@"  tel: %@", [tels objectAtIndex:j]);
   }

Of course you need no code at all when you do this using  
WORepetition's as I initially suggested.

Helge
-- 
Helge Hess
http://www.helgehess.eu/