views:

32

answers:

1

I tried to insert NSDictionary's in a NSMutableDictionary. There is noch Error but it won't work :-( It's empty like before.

Here's my code:

NSMutableDictionary *einnahmen = [[NSMutableDictionary alloc] initWithCapacity:20];
        NSArray *objects = [NSArray arrayWithObjects:
                        name, 
                        [NSNumber numberWithInt: x], 
                        [NSNumber numberWithInt: y], 
                        [NSNumber numberWithInt: z], 
                        nil];
    NSArray *keys = [NSArray arrayWithObjects:
                     @"name", 
                     @"startJahr",
                     @"zins", 
                     @"entnahmefaehig",
                     nil];
    NSDictionary *entry = [NSDictionary dictionaryWithObjects:objects forKeys:keys];

    [einnahmen setObject:entry forKey:@"name"]; //seams not to work

After [einnahmen setObject:entry ... The Debugger shows this:

alt text

+1  A: 

I got the Problem. THX !

NSMutableDictionary *einnahmen = [[NSMutableDictionary alloc] initWithCapacity:20];

was in the wrong init-method -.-

the compiler should show a error .-/

Andreas Prang