Challenge problem


#1

Hey guys im really new to this so I just copied things out of the book that I thought would work. I didnt copy the first part from anywhere and made up what I thought looked similar to other text in the book. This is the part I think is giving me problems. The build works but it wont print my grocery items, bread and milk. Any help/guidance would be awesome, thanks.

    @autoreleasepool {
        
        NSString *bread = [NSString string];
        NSString *milk = [NSString string];

        
        //Create an empty array
        NSMutableArray *groceryList = [NSMutableArray array];
        
        //Add grocery item to the array
        [groceryList addObject:bread];
        [groceryList addObject:milk];

        
        for (NSString *d in groceryList) {
            NSLog(@"Here are the grocery items: %@", d);
        }
        
    }
    return 0;
}

#2

You are creating two NSString pointers, however are not populating them with actual data.

Try:

NSString *bread = @"bread";
NSString *milk = @"milk";

Nick
http://myfirstiphoneapp.co.uk
http://easyintervalsapp.co.uk