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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:15:19+00:00 2026-05-26T18:15:19+00:00

Currently developing my first Native iPhone application, the application is going to be integrating

  • 0

Currently developing my first Native iPhone application, the application is going to be integrating within an existing .net application and will be using webServices. However the problem i am facing i believe is nothing more than my understanding of xcode.

I hope i can explain this…

OK within my first view, within the viewDidLoad i go off to the webservice and return my list of items (these populate the tableview) this works completely fine:

— snippet —

- (void)viewDidLoad {
//GET ALL ITEMS
    myArray = [[NSMutableArray alloc] init];    
    MyWebService *webService = [[MyWebService alloc] init]; 
    myArray = [webService getAllNewsFunction];
    [super viewDidLoad];

}

— snippet —

Ok so i now have my tableview populated and awaiting for you to select your item (in this case a news article) i need to determine the selectedItem in order to populate the next view with the details of the article. However it appears that within the didSelectRowAtIndexPath method my array list is no longer accessible. I am very confused at this point due to if i simply create a list of items within my viewDidLoad within the current view without using my webservice for example:

— snippet —

//  listOfItems = [[NSMutableArray alloc] init];
// [myArray addObject:@"Iceland"];
//  [listOfItems addObject:@"Greenland"];
//  [listOfItems addObject:@"Switzerland"];
//  [listOfItems addObject:@"Norway"];
//  [listOfItems addObject:@"New Zealand"];
//  [listOfItems addObject:@"Greece"];
//  [listOfItems addObject:@"Italy"];
//  [listOfItems addObject:@"Ireland"];

— snippet —

the above is accessible within didSelectRowAtIndexPath and i can populate the detailview.

Can you please help me pinpoint the problem i am facing and how this can be solved. I understand i have given you the very basics so if i need to provide more information i am happy to do so.

— update —

ok based on your response i have update the following.

I have now declared myArray as a property

@property (nonatomic, retain) NSMutableArray  *myArray;

and also updated the line to:

self.myArray = [webService getAllNewsFunction];

— update —

however i now receive an error “program received signal: “SIGABRT”” on the self.myArray line.

any ideas?

Thanks Again

  • 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-26T18:15:19+00:00Added an answer on May 26, 2026 at 6:15 pm

    If you are following naming conventions then the method [webService getAllNewsFunction] will return an autoreleased array. Therefore when you come to access it again it will most likely have been released already.

    If you have used a @property to declare myArray (which you should to save yourself from these problems) then you can resolve this by doing:

    self.myArray = [webService getAllNewsFunction];
    

    This line:

    myArray = [[NSMutableArray alloc] init];
    

    is also superflous and causing a memory leak as you are reassigning the value of myArray to [webService getAllNewsFunction] immediately after without releasing the new NSMutableArray you alloc/init’d

    UPDATE

    So from reading your update I think you need to firstly look at the warnings your project now has which will probably read something like:

    Property ‘myArray’ requires method ‘setMyArray’ to be defined – use @synthesize, @dynamic or provide a method implementation in …

    The next clue to the problem appears in the console I get something like this

    -[TestAppDelegate setMyArray:]: unrecognized selector sent to instance …

    So what it all boils down to is you either need to provide the methods

    - (NSMutableArray *)myArray;
    - (void)setMyArray:(NSMutableArray *)myArray;
    

    or let the compiler do it for you by adding a @synthesize statement like this

    .m
    @implementation YourClass
    
    @synthesize myArray;
    
    // The rest of your class methods
    
    - (void)dealloc
    {
        // release other ivars
        [myArray release];
        [super dealloc];
    }
    

    The synthesize is the easier, quicker options and the compiler will arrange for the coorect memory management depending on which options you use in your @property declaration.

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

Sidebar

Related Questions

I'm currently developing an app using ASP.NET MVC3 and Entity Framework 4.1 Code First
Currently developing an application using the newest version of symfony, obtained through PEAR. This
I was currently developing a desktop application in C# using mono and testing in
I am currently developing a Rails application using a database that was designed before
I'm currently developing a PHP application that's using an Access database as a backend.
I am currently developing my first Android application by reading Dev Documentation at Android
I am currently developing a mobile application using the latest version of Flash Builder
I am currently developing an online Auction system using ASP.NET 3.5 and SQLServer 2008.
I'm currently developing a C# application which will record registry changes, save them to
I am currently developing an application in where a user will dynamically choose dlls

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.