Sell Your Old iPhone For Cash!

What's my iPhone worth?
  1. smartsanja's Avatar
    I'm quite new to iphone development. I created To-Do List app using coredata. I want to add all the names from "oneHero" manageObject
    to a NSMutable array (that means name1 to 1st index position of MutableArray , name2 to 2nd index position of Array)

    this is my table view cellfor indexpath method
    - (UITableViewCell *)tableView:(UITableView *)theTableView  cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *HeroTableViewCell = @"HeroTableViewCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:HeroTableViewCell];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:HeroTableViewCell] autorelease];
    NSManagedObject *oneHero = [self.fetchedResultsController objectAtIndexPath:indexPath];
    NSInteger tab = [tabBar.items indexOfObject:tabBar.selectedItem];
    switch (tab) {
        case kByName:
            cell.textLabel.text = [oneHero valueForKey:@"name"];
            cell.detailTextLabel.text = [oneHero valueForKey:@"secretIdentity"];
        case kBySecretIdentity:
            cell.detailTextLabel.text = [oneHero valueForKey:@"name"];
            cell.textLabel.text = [oneHero valueForKey:@"secretIdentity"];
        //listData = [[[NSMutableArray alloc] init]autorelease];
           //[listData addObject: [oneHero valueForKey:@"secretIdentity"]];
     return cell;
    Actually what I want to do is, retrieve all the names(those are location names) from my "oneHero" object and then show
    those locations in a mapView.
    That's why I want to copy those names in to seperate NSMutable array
    or just as Strings
    Can you please give me a cording help . . .
    Last edited by smartsanja; 06-29-2011 at 06:32 AM.
    06-29-2011 06:29 AM
  2. jayfuerstenberg's Avatar
    You should consider following MVC and use the table cells only for viewing the data. Store the actual data elsewhere and reference it from the table cell's view object.
    08-12-2011 12:22 AM