0 Replies - 1880 Views - Last Post: 13 February 2012 - 08:05 PM

#1 over5  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 06-November 09

How can i get my this method to add the item?

Posted 13 February 2012 - 08:05 PM

I am tring to get this method to add the items in it
+(VM *)vendingMachineWithDefaultContent
{
	ItemContainer *tempC0 = [ItemContainer itemContainerWithDefaultItems];
	ItemContainer *tempC1 = [ItemContainer itemContainerWithDefaultItems];
	ItemContainer *tempC2 = [ItemContainer itemContainerWithDefaultItems];
	ItemContainer *tempC3 = [ItemContainer itemContainerWithDefaultItems];
	ItemContainer *tempContainer= [[ItemContainer alloc] initWithName:@"nothing" andValue:0];
	
	VM *tempVM = [[VM alloc] init];
	
	[tempC0 add:[[Item alloc]initWithName:@"Snickers" andValue:25]];
	[tempC1 add:[[Item alloc] initWithName:@"Trix" andValue:20]];
	[tempC2 add:[[Item alloc] initWithName:@"Payday" andValue:25]];
	[tempC3 add:[[Item alloc] initWithName:@"KitKat" andValue:20]];
	return tempVM;
	
	
}



it will run but it will not show me the name of the item.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1