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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:06:43+00:00 2026-06-01T19:06:43+00:00

The issue I’m running into is I have an NSMutableArray labeled: _podAllEntries, which contains

  • 0

The issue I’m running into is I have an NSMutableArray labeled: _podAllEntries, which contains url paths. The contents of this array are then loaded into one row in my UITableView. There are a total of 4 items in this array and there should be an entry in the table per item. Below is a more detailed explination of how the app works:

This iOS app uses NSURL to consume XML data from a website: http://undignified.podbean.com/feed. From there I parse through the XML using NSXMLParser and search for an attribute called “url” within the “enclosure” element. All attributes that match “url” are then added to an array and then should be loaded in the UITableView with each item on a separate row (as previously mentioned, there is only one row filled).

I’m probably missing something minor at this point and a nudge in the right direction or any feedback would be greatly appreciated.

UnDigParser.h

Header file for parsing class:

#import <Foundation/Foundation.h>

@interface UnDigParser : NSXMLParser <NSXMLParserDelegate> {

}
@property (retain) NSMutableArray *links;
@end

UnDigParser.m

Implementation for for parsing class:

#import "UnDigParser.h"

@implementation UnDigParser
NSMutableArray *_links;

@synthesize links = _links;

-(void)parserDidStartDocument:(NSXMLParser *)parser{
    _links=[[NSMutableArray alloc] init];
}

-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
    if ([elementName isEqualToString:@"enclosure"]){

        NSString *link = [attributeDict objectForKey:@"url"];
        if (link){
            [_links addObject:link];
        }
    }
    //NSLog(@"%@",_links);
}

-(BOOL)parse{
    self.delegate = self;
    return [super parse];
}

@end

ViewController.h

@class WebViewController;

@interface getpodViewController : UITableViewController <UITableViewDataSource>
{
    NSMutableArray *_podAllEntries;
    NSMutableArray *_allEntries;
    WebViewController *_webViewController;
}

@property(retain) NSMutableArray *podAllEntries;
@property(retain) NSMutableArray *allEntries;
@property(retain) WebViewController *webViewController;

@end

ViewController.m

@implementation getpodViewController

@synthesize podAllEntries = _podAllEntries;
@synthesize allEntries = _allEntries;
@synthesize webViewController = _webViewController;

-(void)addRows
{
    //dispatch_async(dispatch_get_global_queue(0, 0), ^{

    NSURL *url = [NSURL URLWithString:@"http://undignified.podbean.com/feed"];
    UnDigParser *parser = [[UnDigParser alloc] initWithContentsOfURL:url];      

    [parser parse];
    [_podAllEntries insertObject:parser.links atIndex:0];
    NSLog(@"%@", _podAllEntries);

    [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:0]]
                          withRowAnimation:UITableViewRowAnimationRight];
}

- (void)viewDidLoad 
{
    [super viewDidLoad];

    self.title = @"Podcasts";
    self.podAllEntries = [[NSMutableArray alloc]init];
    [self addRows];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [_podAllEntries count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    static NSString *CellIdentifier = @"Cell";

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

    NSString *cellValue = [NSString stringWithFormat:@"%@", _podAllEntries];

    cell.textLabel.text = cellValue;
    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-06-01T19:06:46+00:00Added an answer on June 1, 2026 at 7:06 pm

    You need to do it like this:

     [NSString stringWithFormat:@"%@", [_podAllEntries objectAtIndex:indexPath.row]];
    

    Example:

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if(cell==nil){
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
        }
    
        NSString *cellValue = [NSString stringWithFormat:@"%@", [_podAllEntries objectAtIndex:indexPath.row]];
    
        cell.textLabel.text = cellValue;
    
        /* to use less code, you can also do it like this: */
        //cell.textLabel.text = [_podAllEntries objectAtIndex:indexPath.row];
    
        return cell;
    }
    

    You can also remove the following statement from addRows since cellForRowAtIndexPath: is where the cells will actually be created.

    [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationRight];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This issue is driving me mad. I have several tables defined, and CRUD stored
Issue: I have a Mootools Request object which sends a GET request to a
My issue is, I have to make one demo application in which I wants
Issue: Hello, I have an edit page which enables the client to update the
This issue only exists under IIS5.1. I have found a way of resolving the
Issue: I have a markup like this (only the important lines): <%@ Control Language=C#
This issue came up when I got different records counts for what I thought
The issue that prompted me to ask this is a web form that was
Issue: I am using the Microsoft.Office.Interop.Excel library in an ASP.NET application, and I have
Issue is that I have wrote a method to duplicate selected row in a

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.