Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-15-2010, 10:31 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 7
GuitarGuy is on a distinguished road
Default UITableViewCell -- this is wrong -- help please

Ok, I'm trying to load a table with a header and with 2 items in the cell (the "regular" text label and the detailed text label). It's basically a calendar app and I'm pulling the data from a plist with the "month", "event", and "weekday" each in an array. Like so...

NSDictionary *calendar;
NSArray *month;
NSArray *event;
NSArray *weekday;
-------------------

I think this part is right....

NSString *path = [[NSBundle mainBundle] pathForResource:@"calendar"
ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFileath];
self.calendar = dict;
[dict release];

NSArray *array = [[calendar allKeys] sortedArrayUsingSelector:
@selector(compare];
self.month = array;

------------------------
This is where I know there's big problem...

- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath {
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];

NSString *key = [month objectAtIndex:section];
NSArray *eventSection = [calendar objectForKey:key];

NSString *key = [weekday objectAtIndex:section];
NSArray *daySection = [calendar objectForKey:key];

static NSString *SectionsTableIdentifier = @"SectionsTableIdentifier";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SectionsTableIde ntifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:SectionsTableIdentifier] autorelease];
}

cell.textLabel.text = [eventSection objectAtIndex:row];
cell.detailTextLabel.text = [daySection objectForIndex:row];
return cell;
}
GuitarGuy is offline   Reply With Quote
Reply

Bookmarks

Tags
nsdictionary, plist, uitableviewcell

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 333
19 members and 314 guests
2ndSegment, bignoggins, cayladv57, cgokey, dermotos, djohnson, Domele, guusleijsten, Hamad, heshiming, linkmx, markuschow, Objective Zero, pungs, Rudy, Sloshmonster, teebee74, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:54 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0