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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:47:38+00:00 2026-05-24T03:47:38+00:00

Hi everybody that’s my first post here, so i’ll try to be as clear

  • 0

Hi everybody that’s my first post here, so i’ll try to be as clear as possible.

So, in my project, I need to get an xml document from a webService, with SOAP, and then parse it in a NSMutableArray (This is done). Then I would like to display my table’s content in a tableview. Problem is, in my delegate I can’t access anything of my viewController.

I have 3 classes, SOAP_TestViewController, SOAP_TestAppDelegate and XMLParser. I’m sending the array containing the parsed file from XMLParser to the Appdelegate, and then I would like to update an array in my viewController to use it in order to update my tableview.

Here’s a bit of code, may help to understand.

#import "SOAP_TestAppDelegate.h"
#import "SOAP_TestViewController.h"
#import "XMLParser.h"

@implementation SOAP_TestAppDelegate

@synthesize window;
@synthesize viewController;


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

[window addSubview:viewController.view];

NSLog(@"%@", viewController.donnees);  //Here I can get what I want.

[window makeKeyAndVisible]; 

}

-(void)afficher{

NSLog(@"%@", viewController.donnees);  //But there, it returns (null)...

[viewController reload];

}


- (void)dealloc {

[viewController release];

[window release];

[super dealloc];

}

@end

I spent like hours to find a solution. AND, I noticed something. Like the comments say in my code, I can access what I want in the applicationDidFinishLaunching function, but not outside. So am I working on copies or something when i’m out of this function ? And what should I do to access my “donnees” table ?

I’m such a beginner in cocoa coding so please tell me if i’m doing things wrong.

(Please be indulgent with my English 🙂 I’m not bilingual yet ^^’)

EDIT

My afficher function looked like this at the beginning. I call it from XMLParser with the parsed array as parameter. I was sur it would work but…

-(void) afficher:(NSMutableArray *)array
{
    NSLog(@"%@", array);  //returns the array sent by XMLParser.
    [viewController.donnees addObjectsFormArray:array];
    NSLog(@"%@", viewController.donnees);  //returns null.
}

That’s weird, it’s like donnees wasn’t even allocated and initialized…

  • 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-24T03:47:39+00:00Added an answer on May 24, 2026 at 3:47 am

    Are you sure your viewController is not nil? Ok, that’s unlikely. Then are you sure your donnees array is not nil AND it is NSMutableArray, but not NSArray?

    And, btw, you CAN access the properties out of appDelegate from anywhere. I’m not fond of this solution, but just to make a clarification on that. In any class you can do smth like:

    #include "YourAppDelegate.h"
    
    - (void)someMethod {
        YourAppDelegate *yourDelegate = [[UIApplication sharedApplication] delegate];
        yourDelegate.donnees = self.anotherArray;
    }
    

    Of course, donnees should be a property in this case. Cheers!

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

Sidebar

Related Questions

hope that everybody here is OK. We are using VS 2008 as development tool,
Having a weird problem here. Everybody knows that if you use web.config's customErrors section
everybody knows that interrupt handler should be short as possible. and adding functions like
It seems that everybody knows you're supposed to have a clear distinction between the
It seems that everybody says that it is possible to send over 126 chars
If there's something that everybody hates about Magento it's endlessly configuring your modules before
Can everybody help me on how to create a tooltip that contain the x
Greetings everybody. I have seen examples of such operations for so many times that
Heyy Everybody! I am trying to create a memory management system, so that a
Hi everybody. The problem: elcipse-3.5.0 (Galileo) spits with an error when I try 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.