Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6081805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:13:00+00:00 2026-05-23T11:13:00+00:00

I’m fetching the value from xml. What I’m fetching it’s working good but I

  • 0

I’m fetching the value from xml. What I’m fetching it’s working good but I face the problem in displaying the value on a cell. I have to display 6 values on first cell and second cell 4 values how can i do this? Because in my first cell, the value is repeated same on next cell.

This is my cell code:

#import <UIKit/UIKit.h>
#import "TWeatherParser.h"
@class TWeatherParser;


@interface TWeatherController : UITableViewController {

    UITableView *mTableView;
    NSMutableArray *mImage;
    NSMutableArray *weatherarray;
    TWeatherParser *weather;
}
@property (nonatomic, retain) IBOutlet UITableView *mTableView;
@property (nonatomic, retain) NSMutableArray *weatherarray;
@property (nonatomic, retain) TWeatherParser *weather;

@end





    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

        static NSString *CellIdentifier = @"Cell";


       TWeatherCell *cell =(TWeatherCell *) [mTableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[TWeatherCell alloc] initWithStyle:UITableViewStyleGrouped reuseIdentifier:CellIdentifier] autorelease];
        }
        TWeatherElement *newobj = [weatherarray objectAtIndex:indexPath.row];
        if ([newobj.icon isEqualToString:@"http://\n"])
        {
            cell.weatherimage.image = [UIImage imageNamed:@"listIcon-H.png"];
        }
        else {
            NSData *imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:newobj.icon]];
            cell.weatherimage.image = [UIImage imageWithData:imageData];
            [imageData release];
        }
        cell.reportdate.text = newobj.currentdate;
        NSLog(@"this is cell1 value:%@",cell.reportdate.text);
        cell.conditionname.text = newobj.conditionname;
        NSLog(@"this is cell2 value:%@",cell.conditionname.text);
        cell.twotemp.text = [NSString stringWithFormat:@"Temp:%@/%@",newobj.mintemp,newobj.maxtemp];
        NSLog(@"this is cell3 value:%@",cell.twotemp.text);
        cell.twodirection.text = newobj.wind;
        NSLog(@"this is cell4 value:%@",cell.twodirection.text);
        cell.humidity.text = newobj.humidity;
        NSLog(@"this is cell5 value:%@",cell.humidity.text);
        //cell.reportdate.text = newobj.currentdate;


        //cell.reportdate.text =@"My journey";
    //  cell.conditionname.text = @"raji";
    //  cell.twotemp.text = @"pradeep"; 
    //  cell.twodirection.text = @"harish";
    //  cell.humidity.text =@"23";
    //  cell.weatherimage.image = [UIImage imageNamed:@"listIcon-H.png"];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

        // Configure the cell...

        return cell;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:13:01+00:00Added an answer on May 23, 2026 at 11:13 am

    If you want to show different values in different cell then you have to use switch case to detect row index :

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
     {
      static NSString *CellIdentifier = @"Cell";
    
    ListDetailCell *cell= [[[ListDetailCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    
    tableView.backgroundColor = [UIColor whiteColor];
    
    if (cell == nil) 
    {
        cell = [[[ListDetailCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier]
                autorelease];
    }
    
    switch (indexPath.row)
    {
        case 0:
            NSLog(@"%d",indexPath.row);
            cell.leadingLabel.text = @"Name: ";
            cell.leadingLabel.font = [UIFont fontWithName:LABELS_FONT_NAME_BOLD size:11.0f];
            cell.leadingLabel.textColor = FONT_GREEN_COLOR;
    
            cell.volInfo.text = volRow.volName;
            cell.volInfo.font = [UIFont fontWithName:LABELS_FONT_NAME size:11.0f];
            break;
        case 1:
            NSLog(@"%d",indexPath.row);
            cell.leadingLabel.text = @"Address: ";
            cell.leadingLabel.font = [UIFont fontWithName:LABELS_FONT_NAME_BOLD size:11.0f];
            cell.leadingLabel.textColor = FONT_GREEN_COLOR;
    
            cell.volInfo.text = volRow.volAddress;
            cell.volInfo.font = [UIFont fontWithName:LABELS_FONT_NAME size:11.0f];
            break;
        case 2:
            NSLog(@"%d",indexPath.row);
            cell.leadingLabel.text = @"Phone: ";
            cell.leadingLabel.font = [UIFont fontWithName:LABELS_FONT_NAME_BOLD size:11.0f];
            cell.leadingLabel.textColor = FONT_GREEN_COLOR;
    
            cell.volInfo.text = volRow.phone;
            cell.volInfo.font = [UIFont fontWithName:LABELS_FONT_NAME size:11.0f];
            break;
        case 3:
            NSLog(@"%d",indexPath.row);
            cell.leadingLabel.text = @"Email: ";
            cell.leadingLabel.font = [UIFont fontWithName:LABELS_FONT_NAME_BOLD size:11.0f];
            cell.leadingLabel.textColor = FONT_GREEN_COLOR;
    
            cell.volInfo.text = volRow.email;
            cell.volInfo.font = [UIFont fontWithName:LABELS_FONT_NAME size:11.0f];
            break;
    
        default:
            NSLog(@"Out of Range ",indexPath.row);
            break;
    }
    
    return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.