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

  • SEARCH
  • Home
  • 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 6193863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:11:42+00:00 2026-05-24T03:11:42+00:00

I am create on application for weathercondition by nsxmlparser using. I have created three

  • 0

I am create on application for weathercondition by nsxmlparser using. I have created three class for parser 1st class name is ‘forecastinformation’ 2nd class name is ‘currentcondition’ and 3rd class name is ‘forecastecondition’.

I done with all this my all value come in console it work fine in my custom cell I get all currentcondition with forecastcondition in first cell the the value of current condition is printing correct but in my next 3cell depend on forecastinformation class bes in this class I have future information about weather for eg:today is tuesday then he will show information about next day means wednesday,thursday,friday this information will print in my cell I call all value it show proper but I cannot call image with match different weather conditions.

I have to call custom image with commpare name with condition name. Condition name means I get value from xml in console I write code for this I create if condition but it not work it only show image for currentcondition only it not show me next image on next forecastcondition so how to work on this I create three function for forecast condition for pront image and create 3global value like photo,photo1and photo2 like this but it not get image for me.

Here is my code what i try for print

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

    TWeatherCell *cell =(TWeatherCell *) [MyTableView dequeueReusableCellWithIdentifier:[NSString stringWithFormat:@"cell_%d", indexPath.row]];
    if (cell == nil) {
        //cell = [[[TWeatherCell alloc] initWithStyle:UITableViewStyleGrouped reuseIdentifier:CellIdentifier] autorelease];
        cell = [[[TWeatherCell alloc] initWithFrame:CGRectZero reuseIdentifier:[NSString stringWithFormat:@"cell_%d", indexPath.row]] autorelease];
    }
//this all value cond1,2,3 is my array value i am taking value from array and store in yhis allobject cond1,cond2,cond3
        //ForecastCondition *cond=[forecastcond objectAtIndex:0];
    cond1=[forecastcond objectAtIndex:1];                          
    cond2=[forecastcond objectAtIndex:2];
    cond3=[forecastcond objectAtIndex:3];
    switch (indexPath.row) {
        case 0:
    NSLog(@"%d",indexPath.row);
            NSData *imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:currentcond.Icon]];
            NSLog(@"this is image from server:%@",imageData);
            cell.weatherimage.image = [UIImage imageNamed:photo];
            [imageData release];
    file://localhost/Users/pradeepyadav/Desktop/JourneyMapper/Journey/Classes/TJourneyTabBar.hcell.weatherimage.image = [UIImage imageNamed:photo];     
    cell.reportdate.text = _forecastInfo.CurrentDateTime;
    cell.conditionname.text = currentcond.Condition;
    cell.twotemp.text = [NSString stringWithFormat:@"Temp:%@/%@",currentcond.Tempf,currentcond.Tempf];
    cell.twodirection.text = currentcond.WindCondition;
    cell.humidity.text = currentcond.Humidity;

    break;
        case 1:
            NSLog(@"%d",indexPath.row);
            cell.weatherimage.image = [UIImage imageNamed:photo]; 
            cell.reportdate.text =[NSString stringWithFormat:@"%@",thursday];
            cell.conditionname.text = cond1.Condition;
            cell.twotemp.text = [NSString stringWithFormat:@"Temp:%@/%@",cond1.Low,cond1.High];
            break;
        case 2:
            NSLog(@"%d",indexPath.row);
            cell.weatherimage.image = [UIImage imageNamed:photo1];
            cell.reportdate.text = [NSString stringWithFormat:@"%@",friday];
            cell.conditionname.text = cond2.Condition;
            cell.twotemp.text = [NSString stringWithFormat:@"Temp:%@/%@",cond2.Low,cond2.High];
            break;
        case 3:
            NSLog(@"%d",indexPath.row);
            cell.weatherimage.image = [UIImage imageNamed:photo2];
            cell.reportdate.text = [NSString stringWithFormat:@"%@",sunday];
            cell.conditionname.text = cond3.Condition;
            cell.twotemp.text = [NSString stringWithFormat:@"Temp:%@/%@",cond3.Low,cond3.High];
            break;
        default:
            NSLog(@"Out of Range ",indexPath.row);
            break;
    }
    return cell;
}
-(void)selected
{

    if ([currentcond.Condition isEqualToString:@"Thunderstorm"])
    {
        photo=@"google_weather_thunderstorm.png";
    }

    else if ([currentcond.Condition isEqualToString:@"Mostly Sunny"]) {
        photo=@"google_weather_mostly_sunny.png";
    }

    else if ([currentcond.Condition isEqualToString:@"Mostly Cloudy"]) {
        photo=@"google_weather_cloudy.png";
    }

    else if ([currentcond.Condition isEqualToString:@"Chance of Storm"]) {
        photo=@"google_weather_chance_of_storm.png";
    }
    else if ([currentcond.Condition isEqualToString:@"Clear"]) {
        photo=@"google_weather_sunny.png";
    }

}

-(void)selected1
{

    if ([cond1.Condition isEqualToString:@"Thunderstorm"])
    {
        photo1=@"google_weather_thunderstorm.png";
    }

    else if ([cond1.Condition isEqualToString:@"Mostly Sunny"]) {
        photo1=@"google_weather_mostly_sunny.png";
    }

    else if ([cond1.Condition isEqualToString:@"Mostly Cloudy"]) {
        photo1=@"google_weather_cloudy.png";
    }

}

-(void)selected2
{

    if ([cond2.Condition isEqualToString:@"Thunderstorm"])
    {
        photo2=@"google_weather_thunderstorm.png";
    }

    else if ([cond2.Condition isEqualToString:@"Mostly Sunny"]) {
        photo2=@"google_weather_mostly_sunny.png";
    }

    else if ([cond2.Condition isEqualToString:@"Mostly Cloudy"]) {
        photo2=@"google_weather_cloudy.png";
    }

}
  • 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-24T03:11:43+00:00Added an answer on May 24, 2026 at 3:11 am

    Instead of

    cell.weatherimage.image = [UIImage imageNamed:photo1];
    

    you can use

    cell.weatherimage.image =[UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"http://www.google.com%@",cond1.Icon]];
    

    This will load images from a given url. And instead of doing synchronous loading of images in cell you should use lazy loading approach for better performance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I stack with this, I'm trying to create application using TabLayout. I have 3
Is possible create (register) a new class in runtime using delphi. I have a
I am trying to create application with Zend framework so I have created basic
How do you create an application shortcut (.lnk file) in C# or using the
How do I create an Application Pool on IIS 6.0 using a PowerShell script?
Normally I create web application projects and use code-behind, but I have a requirement
I want to create an application which will have a client and server components.
I needed to create an application using Struts2 as MVC,Hibernate for data access and
Looking for guidelines to create application file. For example I have an application that
I'm new to using WPF. I have the following program I want to create:

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.