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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:28:04+00:00 2026-05-19T14:28:04+00:00

I have a problem that I can’t figure out even after a couple of

  • 0

I have a problem that I can’t figure out even after a couple of hours of testing different ways to achieve what I need: Here is the code I have a problem with:

AppDelegate.h

#import <Three20/Three20.h>

#import "NewsRssParser.h"
#import "NewsRss.h"

@class NewsRssParser;
@class NewsRss;

@interface AppDelegate : NSObject <UIApplicationDelegate,NewsRssParserDelegate> {
 NewsRssParser * _rssParser; 
 NSMutableArray * _newsRssArray;
}

@property(readwrite, retain) NewsRssParser * rssParser;
@property(readwrite, retain) NSMutableArray * newsRssArray;

@end

AppDelegate.m

@implementation AppDelegate

@synthesize rssParser = _rssParser;
@synthesize newsRssArray = _newsRssArray;

[...]

- (void)myFunction{

 NSMutableArray *dsItems = [[[NSMutableArray alloc] init] autorelease];

 for(NSMutableArray *rssItem in self.rssParser.rssItems)
 {
  NSString * rssItemTitle = [(NewsRss *)rssItem title];
  NSString * rssItemAuthor = [@"par " stringByAppendingString:[(NewsRss *)rssItem author]];
  NSString * rssItemDescription = [(NewsRss *)rssItem description];
  NSString * rssItemLinkUrl = [(NewsRss *)rssItem linkUrl];
  NSString * rssItemImageUrl = [(NewsRss *)rssItem mediaUrl];

  TTTableMessageItem *tMsgItem = [TTTableMessageItem itemWithTitle:rssItemTitle caption:rssItemAuthor text:rssItemDescription timestamp:nil imageURL:rssItemImageUrl URL:rssItemLinkUrl];
  [self.newsRssArray addObject:tMsgItem];
  [dsItems addObject:tMsgItem];
 }

 NSLog(@"AppDelegate/count/rssItems=%d", [self.rssParser.rssItems count]);
 NSLog(@"AppDelegate/count/newsRssArray=%d", [self.newsRssArray count]);
 NSLog(@"AppDelegate/count/dsItems=%d", [dsItems count]);

}

When I run the code, my RSS parser works properly and I can loop on 10 items in self.rssParser.rssItems. I need to access these items in another view to show them in a table, hence I prepare the data in NSMutableArray * newsRssArray that I have declared in my .h file

However if I try to add those 10 objects in the NSMutableArray * newsRssArray, I have nothing in the end (see the code output in the debugger). I test my code successfully if I use NSMutableArray *dsItems declared inside my function.

Here is gdb output:

Attaching to process 47209.
2011-01-29 14:55:24.813 TestApp[47209:207] AppDelegate/count/rssItems=10
2011-01-29 14:55:24.814 TestApp[47209:207] AppDelegate/count/newsRssArray=0
2011-01-29 14:55:24.815 TestApp[47209:207] AppDelegate/count/dsItems=10
(gdb) 

What am I doing wrong?

Thanks for your help!

  • 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-19T14:28:05+00:00Added an answer on May 19, 2026 at 2:28 pm

    Just glancing over the code you have supplied, I don’t see where you initialize newsRssArray. Is this in another place or did you forget to init?

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

Sidebar

Related Questions

I have a weird problem that i can't figure out a solution for: I've
I have a problem with Lucene's scoring function that I can't figure out. So
I have a problem that I can't figure out what to do next. I
So I have a problem that I can not figure out. I am writing
I have a problem that I can't figure out myself. I've tried using LEFT
I have a problem that I can't figure out. I'm building a small framework
I have an interesting problem that i can't seem to figure out. I am
I have simple LINQ problem that I can't figure out. I have a table
I have a strange problem that I can't figure out when trying to do
I have a little problem that I can't figure out how to solve. I

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.