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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:26:41+00:00 2026-05-29T12:26:41+00:00

h #import <UIKit/UIKit.h> @interface LoginViewController : UIViewController <UITextFieldDelegate> @property (nonatomic, retain) NSDictionary *_data; @end

  • 0

h

#import <UIKit/UIKit.h>

@interface LoginViewController : UIViewController <UITextFieldDelegate>

@property (nonatomic, retain) NSDictionary *_data;

@end

m

#import "LoginViewController.h"
#import "XMLReader.h"

@implementation LoginViewController

static NSDictionary *_raceInformation;

@synthesize _data, bibInput, lastNameInput, error;

- (id)initWithCoder:(NSCoder *)aDecoder 
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        NSError *e = [NSError alloc];
        NSString *xml = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"testhalfmarathon" ofType:@"xml"] encoding:NSUTF8StringEncoding error:&e];

        NSDictionary *asdf = [XMLReader dictionaryForXMLString:xml error:nil];
        self._data = [XMLReader dictionaryForXMLString:xml error:nil];

        //[xml release];
        //[e release];

        // !! BREAKPOINT HERE
    }
    return self;
}

When I hit the breakpoint, the value for self._data is nil. However, the value for asdf is the correct dictionary value I would expect in self._data. What gives?

backstory: I’m a n00b when it comes to MRC as I usually use ARC/GC languages.

  • 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-29T12:26:43+00:00Added an answer on May 29, 2026 at 12:26 pm

    What line of code did you put the breakpoint against? If it was just a blank line it will actually break at the previous valid line of code, which may have been before self._data was set.

    Try putting NSLog(@”data %@”, self._data); instead of your breakpoint and see what gets logged.

    BTW, I see you had [xml release], which you commented out, presumably because it wasn’t working. The reason this line is wrong is that [XMLReader dictionaryForXMLString…] returns an autoreleased object that shouldn’t be released again.

    In general, in Objective-C if a method name doesn’t begin with “new”, “alloc” or “copy” then it returns an autoreleased object that you don’t need to release yourself.

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

Sidebar

Related Questions

Say I have this code: #import <UIKit/UIKit.h> @interface MyView : UIView @end @implementation MyView
#import <UIKit/UIKit.h> @interface quartzViewController : UIViewController { IBOutlet UIView *myView; } @end #import quartzViewController.h
In this code: #import <UIKit/UIKit.h> @interface ViewController : UIViewController { UILabel *labelsText; } @property(strong,
QuestionsViewController.h: #import <UIKit/UIKit.h> @interface QuestionsViewController : UIViewController { int currentQuestionIndex; NSMutableArray *questions; IBOutlet UILabel
Here is my code: Header: #import <UIKit/UIKit.h> @interface ViewController : UIViewController { UIImageView *imageView;
//viewController.h file //--------------------- #import <UIKit/UIKit.h> @interface ItemClass : NSObject { NSString* name; } @property
FirstViewController.h: #import <UIKit/UIKit.h> @interface FirstViewController : UIViewController { NSArray *listData; } -(IBAction) GoToInsert: (id)
I have the following ViewController class #import <UIKit/UIKit.h> @interface SampleViewController : UIViewController { IBOutlet
I have my interface like. #import <UIKit/UIKit.h> @interface HistoryShow : UIViewController { } -(IBAction)
Adding UITableView Delegate to my ViewController Causing an Incomplete Implementation Error #import <UIKit/UIKit.h> @interface

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.