I am getting data using this way from i want that i should display date in section title
and the event location in rows which are in appDelegate.book1 array. when this roop runs first then in first section it must show 7 rows in one section and same like that as come but i am not getting required
NSArray *activitiesArray;
for (int j=0;j<10; j++) {
NSDictionary *dictOne = [results objectAtIndex:j];
NSLog(@"%@ - %@", [dictOne objectForKey:@"date"]);
Date *aDate = [[Date alloc] initWithDictionary:[results objectAtIndex:j]];
[appDelegate.dates addObject:aDate];
[aDate release];
activitiesArray = [dictOne objectForKey:@"events"];
for (int i=0; i<[activitiesArray count]; i++) {
int testcount =[activitiesArray count];
NSDictionary *dictTwo = [activitiesArray objectAtIndex:i];
NSDictionary *eventDict=[dictTwo objectForKey:@"event"];
// NSLog(@"%@ - %@", [dictOne objectForKey:@"date"]);
// NSLog(@"%@ - %@", [dictTwo objectForKey:@"affectedDate"]);
// NSLog(@"%@ - %@", [eventDict objectForKey:@"location"]);
NSInteger*date=[dictTwo objectForKey:@"affectedDate"];
NSInteger*affectedDate=[dictTwo objectForKey:@"affectedDate"];
NSString*appId =[eventDict objectForKey:@"appId"];
NSString*eventId=[eventDict objectForKey:@"eventId"];
NSString*location=[eventDict objectForKey:@"location"];
NSString*municipality=[eventDict objectForKey:@"municipality"];
NSString*title=[eventDict objectForKey:@"title"];
Book1 *aBook=[[Book1 alloc] initWithDate:date affectedDate:affectedDate location:location municipality:municipality title:title];
[appDelegate.books1 addObject:aBook];
int count=[appDelegate.books1 count];
}
}
this is the NSLog of count of appDelegate.book1
The value of integer num is 1
2011-08-09 12:40:31.731 FVN[2409:207] The value of integer num is 2
2011-08-09 12:40:31.731 FVN[2409:207] The value of integer num is 3
2011-08-09 12:40:31.731 FVN[2409:207] The value of integer num is 4
2011-08-09 12:40:31.732 FVN[2409:207] The value of integer num is 5
2011-08-09 12:40:31.732 FVN[2409:207] The value of integer num is 6
2011-08-09 12:40:31.733 FVN[2409:207] The value of integer num is 7
so like this array my table view should show 7 items in first section adn like wise above as they are in sequence so how to do this
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…