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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:40:53+00:00 2026-05-22T14:40:53+00:00

I am receiving NSCFSting leaks that are traced back to the method below. I

  • 0

I am receiving NSCFSting leaks that are traced back to the method below. I am parsing an XML file, and using the strings obtained from textForElement and setting them to variables in an object (EventArticleObject). I know the leaks are not coming from textForElement, as I have no leaks in another parsing method where I am not setting the strings to an object.

The array and dictionary I am filling are not being leaked, it is just the strings. When I goto the Stack Trace and click on one of the leaking strings, this is what shows up:
pic

The #2 CFRetain is traced back to setLink in the method below, that is what I believe that I am doing something wrong when using objects.

Does anyone see anything I am doing wrong here? Thanks a lot!

//Parse the weekly events are store. Must first get the date, format it, and attach it to
// the link; this is to get the events for the current week.
- (void)parseWeekEvents
{

TBXML *tbxml;
TBXMLElement *rootXMLElement;
TBXMLElement *node_channel;
TBXMLElement *node_item;
TBXMLElement *node_traverse;

NSString *fullEventURL;
fullEventURL = @"http://www.millersville.edu/calendar/rss.php?q=&c=&date=";
fullEventURL = [fullEventURL stringByAppendingString:dateURL];
fullEventURL = [fullEventURL stringByAppendingString:@"&mode=week"];

eventsDict = [[NSMutableDictionary alloc] init];
datesArray = [[NSMutableArray alloc] init];

tbxml = [TBXML tbxmlWithURL:[NSURL URLWithString:fullEventURL]];
rootXMLElement = tbxml.rootXMLElement;

if(rootXMLElement)
{
    node_channel = [TBXML childElementNamed:@"channel" parentElement:rootXMLElement];

    if(node_channel)
    {
        node_item = [TBXML childElementNamed:@"item" parentElement:node_channel];

        while(node_item)
        {
            NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

            EventArticleObject *currentEvent = [[[EventArticleObject alloc] init] autorelease];

            NSString *title;
            NSString *link;
            NSString *date;

            node_traverse = [TBXML childElementNamed:@"title" parentElement:node_item];
            title = [TBXML textForElement:node_traverse];
            title = [title stringByReplacingOccurrencesOfString:@"&" withString:@"&"];
            title = [title stringByReplacingOccurrencesOfString:@"'" withString:@"'"];

            [currentEvent setTitle:title];

            node_traverse = [TBXML childElementNamed:@"link" parentElement:node_item];
            link = [TBXML textForElement:node_traverse];
            [currentEvent setLink:link];

            node_traverse = [TBXML childElementNamed:@"pubDate" parentElement:node_item];
            date = [TBXML textForElement:node_traverse];
            NSRange stringRange = {0,16};
            date = [date substringWithRange:stringRange];
            [currentEvent setDate:date];

            if(![datesArray containsObject:date])
            {
                [datesArray addObject:date];
            }

            NSString *eventDate = [currentEvent date];
            NSMutableArray  *temp = [eventsDict objectForKey:eventDate];
            if(!temp)
            {
                temp = [NSMutableArray array];
                [temp addObject:currentEvent];
                [eventsDict setObject:temp forKey:eventDate];
            } else {
                [temp addObject:currentEvent];
            }
            node_item = node_item -> nextSibling;

            [pool drain];
        }
    }
}
}

Here is my EventArticleObject.m:

@implementation EventArticleObject

@synthesize link, date, title;

- (id)initWithTitle:(NSString *)title2
           date:(NSString *)date2
           link:(NSString *)link2;
{
    self = [super init];
if(!self)
    return nil;

    [self setLink:link2];
    [self setDate:date2];
    [self setTitle:title2];

    return self;
}

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

    Verify the EventArticleObject class if all the variables are released properly

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

Sidebar

Related Questions

I'm receiving the below xml response and I need to parse so that all
Am receiving null from json post using jquery. see my code below in order.
I'm receiving feedback from a developer that The only way visual basic (6) can
I'm receiving errors from Gtk that I can't track down. Every time my mouse
My app is receiving data from a BlueTooth device 4 times a second, parsing
I'm receiving JSON, that i need to Deserialize. I'm using JavaScriptSerializer to do so.
When receiving an array from flash, in C, how do I populate that array
I am receiving data from a web service, and some of the strings have
When receiving data through a socket using recv , I've noticed that, with: char
I'm receiving an XML via php://input and after using simpleXML to break the elements

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.