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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:05:21+00:00 2026-05-12T05:05:21+00:00

I seem to have a probably newbie problem but here it is. How do

  • 0

I seem to have a probably newbie problem but here it is.
How do I get my dictionary from my parser class , which has building a tree for a drill down table back to my drilldowntabledelegate class.
my app looks something like this.

@implementation DrillDownAppAppDelegate

@synthesize window;

@synthesize navigationController;

@synthesize data;

-(void)StartParser
{   
    //NSURL *url = [[NSURL alloc] initWithString:@"http://sites.google.com/site/virtuagymtestxml/testxml/Books.xml"];
    //NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
    //local
    NSString *Path = [[NSBundle mainBundle] bundlePath];
    NSString *DataPath = [ Path stringByAppendingPathComponent:@"exercises.xml"];
    NSData *Data = [[NSData alloc] initWithContentsOfFile:DataPath];

    NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:Data];
    //Initialize the delegate.
    XMLParser *parser = [[XMLParser alloc] initXMLParser];

    //Set delegate
    [xmlParser setDelegate:parser];

    //Start parsing the XML file.
    BOOL success = [xmlParser parse];

    if(success){
        NSLog(@"No Errors");
    }
    else
    {
        NSLog(@"Error Error Error!!!"); 
    }

}


- (void)applicationDidFinishLaunching:(UIApplication *)application {

        [self startParser];

    NSString *Path = [[NSBundle mainBundle] bundlePath];
    NSString *DataPath = [Path stringByAppendingPathComponent:@"Tree2.plist"];

    NSDictionary *tempDict = [[NSDictionary alloc] initWithContentsOfFile:DataPath];


         //this is what needs to happen
         **NSDictionary *tempDict = dictionaryFromMyParser**

    self.data = tempDict;
    [tempDict release];

    // Configure and show the window
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];

}

My parser file looks something like this

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName 
    attributes:(NSDictionary *)attributeDict {

    if([elementName isEqualToString:@"exercises"]) {

      //init tree 
        Tree = [NSMutableDictionary new];
        Rows = [NSMutableArray new];
        [Tree setObject:Rows forKey:@"Rows"];

        //Initialize the array.
             ... all kinds of arrays here 
    }

if([elementName isEqualToString:@"menu_mob"]) {
        amenuMob = [[menuMob alloc]init];
    }

    if([elementName isEqualToString:@"menuitem"]) {
        amenuItem = [[menuItem alloc] init];
        amenuItem.IDE = [[attributeDict objectForKey:@"id"] integerValue];
        amenuItem.text = [attributeDict objectForKey:@"text"];

        NSLog(@"reading id menuitem %i", amenuItem.IDE);
        NSLog(@"reading text menuitem %@", amenuItem.text);
        [appDelegate.menuitems addObject:amenuItem];
}

I’ve been getting my inspiration and information from all over the internet
What works :

  1. Building a nice tree which can be read into by my app ( tested it with writetoFile)
  2. xmlparsing works ( I decent xmlfile )
  3. the drilldowntable example

conclusion: how do I get my (build by parser)Tree which has been build by my parser to my drilldowntableappdelegate ?

ps. if this doesn’t work can I also build my parser in my delegate file ( i know sloppy but I assume my filled tree will work there )

  • 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-12T05:05:21+00:00Added an answer on May 12, 2026 at 5:05 am

    I sovled my problem.
    I solved my problem by creating the dictionary objects in my drilldownappdelegate file and then using them through the singleton UIApplication in my parser file.

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

Sidebar

Related Questions

I seem to have a problem passing some strings on from one form to
Git newbie here. I am probably making a simple mistake here, but I can't
I've looked around here but can't seem to find an answer to my problem.
This is probably a newbie question, but I can't seem to think of a
I seem to have hit a snag while building my project using Ant. The
I seem to have looked through many solution on here and the web and
I seem to have a problem with getting MVC to fill in my custom
I seem to have the exact opposite problem than this question on stopping dock
Alright, I know questions like this have probably been asked dozens of times, but
I am probably doing something very wrong and noobish but I can't seem to

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.