- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. [self tableInfo]; } - (void) tableInfo { NSArray *keysArray = @[@"CampaignsName",@"BusinessName",@"BusinessType",@"CampaignsType",@"Distance",@"Daysleft",@"CampaignImage",]; NSArray *valuesArray1 =[NSArray arrayWithObjects:@"5 % OFF ",@"Coffe Shop",@"1",@"1",@"0.10 Miles",@"5 days Left",@"b2.png", nil]; NSArray *valuesArray2 = [NSArray arrayWithObjects:@"win $2 for you & charity ",@"Red Tommato",@"2",@"2",@"20 Miles",@"2 days Left",@"b1.png", nil]; NSArray *valuesArray3 = [NSArray arrayWithObjects:@"Buy dogs food & get a one more",@"Pet Care",@"3",@"3", @"30 Miles",@"10 days Left",@"b2.png", nil]; NSArray *valuesArray4 =[NSArray arrayWithObjects:@"win $2 for you & charity ",@"Red Tommato",@"1",@"1",@"0.10 Miles",@"7 days Left",@"b2.png", nil]; NSDictionary *dict1 = [NSDictionary dictionaryWithObjects:valuesArray1 forKeys:keysArray]; NSDictionary *dict2 = [NSDictionary dictionaryWithObjects:valuesArray2 forKeys:keysArray]; NSDictionary *dict3 = [NSDictionary dictionaryWithObjects:valuesArray3 forKeys:keysArray]; NSDictionary *dict4 = [NSDictionary dictionaryWithObjects:valuesArray4 forKeys:keysArray]; self.tableArray = [[NSArray alloc]initWithObjects:dict1,dict2,dict3,dict4,dict3,dict1,dict4,dict2,nil]; NSLog(@"Array %@",tableArray); [self.tableObj reloadData]; }
rakhi
source share