• 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: Public, private and protected variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Public, private and protected variables


  • Subject: Re: Public, private and protected variables
  • From: Andy Lee <email@hidden>
  • Date: Sun, 27 Jul 2003 18:28:21 -0400

At 2:55 PM -0700 7/27/03, John MacMullin wrote:
- (void)companyInfoTabSelected:(NSNotification *)notification
{
NSLog(@"Notification Action");
NSLog(@"%@-companyRecords", companyRecords);
NSLog(@"%@-ocCategoryFile", ocCategoryFile);
}

The result is:

2003-07-27 14:49:24.453 GLASS[6655] 2 tab view item
2003-07-27 14:49:24.454 GLASS[6655] Notification Action
2003-07-27 14:49:24.454 GLASS[6655] (null)-companyRecords
2003-07-27 14:49:24.454 GLASS[6655] (null)-ocCategoryFile


This doesn't have to do with the public or protected scoping. If the compiler allows you to reference the instance variable, you can do whatever you want with it.

Seems more likely to me the instance variables really are nil, and if they shouldn't be, there's a bug somewhere else in your code. Try adding something like:

if (companyRecords == nil)
{
NSLog(@"companyRecords really is nil");
}

--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Public, private and protected variables (From: John MacMullin <email@hidden>)

  • Prev by Date: Re: Memory Management
  • Next by Date: Re: Public, private and protected variables
  • Previous by thread: Public, private and protected variables
  • Next by thread: Re: Public, private and protected variables
  • Index(es):
    • Date
    • Thread