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 6767091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:54:35+00:00 2026-05-26T14:54:35+00:00

I load my XML in to my iphone app via: NSArray *Images = [doc

  • 0

I load my XML in to my iphone app via:

NSArray *Images = [doc nodesForXPath:kName_logo error:nil];//Root node
for (CXMLElement *ImgIcons in Images) 
{
    NSArray *locImage = [ImgIcons elementsForName:kName_image];
    for(CXMLElement *fullImage in locImage) 
    {
        LocationImage = fullImage.stringValue;
        locStatImage = LocationImage;
        NSLog(@"Image Found %@",LocationImage);
        break;
    }
}

Which is fine, it’s bringing me back the correct string

2011-11-03 14:48:43.572 Del Search[13152:f203] Image Found http://de1128/directenquirieswebapplicationv3.0/images/logos/PremierInn.jpg

However, When I load it on to my table through the following:

if (indexPath.section == 0)
    {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifierImage];

        if (cell == nil) 
        {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifierImage] autorelease];
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,180)];                
            imageView.tag = 1;
            NSURL *Imageurl = [NSURL URLWithString:[NSString stringWithFormat:@"%@", locStatImage]];
            NSData *data = [NSData dataWithContentsOfURL:Imageurl];
            UIImage *img = [[[UIImage alloc] initWithData:data] autorelease];
            imageView.image = img;

            [cell addSubview:imageView];
            [imageView release];


        }
        return cell;
    }

The app falls over. However if I manually set locStatImage by doing:

locStatImage = @"http://de1128/directenquirieswebapplicationv3.0/images/logos/PremierInn.jpg";

It works fine. What’ am I doing wrong when I set locStatImage?

Thanks

Tom

  • 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-26T14:54:36+00:00Added an answer on May 26, 2026 at 2:54 pm

    Assuming the two code snippets above are from separate methods, locStatImage is probably being autoreleased between you obtaining it from the XML and using it in your cellForRowAtIndexPath method.

    Further assuming locStatImage is a retained property (if it isn’t it should be), in your first code sample you should use

    self.locStatImage = ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML documment that I want to load for the iPhone, do
I need to load an XML source using Simple XML, duplicate an existing node
I currently have an iPhone app that reads data from an external XML file
I use NSURLConnection to load xml from server when starting the app, but mostly
I'm getting the error: Illegal characters in path. when trying to load XML, using
I load up a few XML files with my app in Mono when deploying
I am new to iphone programing. I used to load the whole xml content
I recently created an xml feed -> html javascript function for an iPhone app
There I am trying to load XML content from a remote host using Node.js.
I am using xml.net in web application When I try load xml through an

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.