• 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
Re: Method Sees Populated Array As Empty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Method Sees Populated Array As Empty


  • Subject: Re: Method Sees Populated Array As Empty
  • From: Graham Cox <email@hidden>
  • Date: Sun, 6 Jul 2008 14:39:32 +1000


On 6 Jul 2008, at 8:29 am, Mark Wales wrote:

@interface MyDocument : NSDocument
{
	....
	....
	NSMutableArray *arrayOfReferences;
}



NSLog(@"%@", [self arrayOfReferences]); // <== Shows the array as empty



Do you actually have an accessor method for arrayOfReferences? If not, referring to the ivar using [self arrayOfReferences] isn't correct. The fact it appears to work in some cases may be a blind fluke.


You need a method:

- (NSArray*)	arrayOfReferences
{
	return arrayOfReferences;
}

or just refer directly to the ivar:

NSLog(@"%@", arrayOfReferences);




hth,


Graham _______________________________________________

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: Method Sees Populated Array As Empty
      • From: Mark Wales <email@hidden>
References: 
 >Method Sees Populated Array As Empty (From: Mark Wales <email@hidden>)
 >Re: Method Sees Populated Array As Empty (From: Markus Spoettl <email@hidden>)
 >Re: Method Sees Populated Array As Empty (From: Mark Wales <email@hidden>)

  • Prev by Date: [Moderator] Re: IBTool and .XIB files
  • Next by Date: Re: Using deprecated methods
  • Previous by thread: Re: Method Sees Populated Array As Empty
  • Next by thread: Re: Method Sees Populated Array As Empty
  • Index(es):
    • Date
    • Thread