• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
objects aren't added to NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

objects aren't added to NSMutableArray


  • Subject: objects aren't added to NSMutableArray
  • From: Daniel Richman <email@hidden>
  • Date: Tue, 17 Jun 2008 17:02:51 -0700

I've got an object which has an NSMutableArray as an instance variable. If, in one of my methods, I try to call
[myArray addObject:@"this is a test"]; (for example),


I get no error, but the object isn't added. If I try to do
[myArray objectAtIndex:0];
I get (null), and
[myArray count];
returns zero.

However, if I just declare the NSMutableArray inside one of the methods of the object, everything works fine. However, this is clearly not an optimal solution because the array is destroyed after the method finishes executing.

I posted a sample project at http://danielrichman.com/tmp/NSMutableArray_Problem.tar.gz .

Thanks!
Daniel
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: objects aren't added to NSMutableArray
      • From: Jens Alfke <email@hidden>
    • Re: objects aren't added to NSMutableArray
      • From: James Walker <email@hidden>
    • Re: objects aren't added to NSMutableArray
      • From: Robert Kukuchka <email@hidden>
  • Prev by Date: Re: Rethinking my approach; rather overwhelmed.
  • Next by Date: Re: Rethinking my approach; rather overwhelmed.
  • Previous by thread: Re: Cocoa-dev Digest, Vol 5, Issue 1071
  • Next by thread: Re: objects aren't added to NSMutableArray
  • Index(es):
    • Date
    • Thread