summaryrefslogtreecommitdiffstats
path: root/Classes
diff options
context:
space:
mode:
authormatt handler <matt.handler@gmail.com>2011-04-24 21:22:27 -0400
committermatt handler <matt.handler@gmail.com>2011-04-24 21:22:27 -0400
commit88d3de337a09fcab2439b20f5cb5d76aa0fcf08a (patch)
tree768ed4629fdc10c45385056a8d49fa5af4ad97da /Classes
parent663d25e5160e97eefed1444bac0b4ac964f3368e (diff)
downloadpiccast-app-88d3de337a09fcab2439b20f5cb5d76aa0fcf08a.tar.gz
piccast-app-88d3de337a09fcab2439b20f5cb5d76aa0fcf08a.zip
stable state, things load into section dictionary and display... now need to get storage to actually work though
Diffstat (limited to 'Classes')
-rw-r--r--Classes/SectionDictionary.m5
-rw-r--r--Classes/TopicsViewController.m13
2 files changed, 11 insertions, 7 deletions
diff --git a/Classes/SectionDictionary.m b/Classes/SectionDictionary.m
index 8845b2b..b183725 100644
--- a/Classes/SectionDictionary.m
+++ b/Classes/SectionDictionary.m
@@ -37,13 +37,16 @@
- (void) appendObject:(id)anObject forKey:(id)aKey {
NSMutableArray *store = [theRealDictionary objectForKey:aKey];
if (store == nil) {
+ [indexMap setObject:aKey forKey:[NSString stringWithFormat:@"%d", index]];
+ index++;
+
NSMutableArray *store = [[[NSMutableArray alloc] init] autorelease];
[store addObject:anObject];
[theRealDictionary setObject:store forKey:aKey];
}
else [store addObject:anObject];
- NSLog(@"number of rows: %d", [[theRealDictionary objectForKey:aKey] count]);
+ //NSLog(@"number of rows: %d", [[theRealDictionary objectForKey:aKey] count]);
}
- (id) objectForIndex:(NSInteger)i {
diff --git a/Classes/TopicsViewController.m b/Classes/TopicsViewController.m
index 2548bf3..9751eb2 100644
--- a/Classes/TopicsViewController.m
+++ b/Classes/TopicsViewController.m
@@ -101,13 +101,13 @@
- (NSTimeInterval) daysApart:(NSDate *)date {
//NSLog(@"datestring: %@", [Topic dateToString:date]);
- NSDate *today = [NSDate date];
-
+// NSDate *today = [NSDate date];
+// NSLog(@"today: %@", today);
// NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
// [dateFormatter setDateFormat:@"yyyy-MM-dd"];
// NSDate *published = [dateFormatter dateFromString:string];
- return [today timeIntervalSinceDate:date];
+ return [date timeIntervalSinceNow];
}
// called after parsing is finished
@@ -282,12 +282,13 @@
[mi clear];
}
+ Topic *topic = [[tableDictionary objectForIndex:[indexPath section]] objectAtIndex:[indexPath row]];
//cell.useDarkBackground = (indexPath.row % 2 == 0);
- cell.title = [[topics objectAtIndex:indexPath.row] title];
- cell.picCount = [NSString stringWithFormat:@"%@", [[topics objectAtIndex:indexPath.row] picCount]];
+ cell.title = topic.title;
+ cell.picCount = [NSString stringWithFormat:@"%@", topic.picCount];
micon.url = [NSURL URLWithString:@"http://www.acidcow.com/favicon.ico"];
- mi.url = [NSURL URLWithString:[[topics objectAtIndex:indexPath.row] iconUrl]];
+ mi.url = [NSURL URLWithString:topic.iconUrl];
mi.squareCropped = true;
[objMan manage:mi];