• 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
dot syntax issue? (Newb Question?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dot syntax issue? (Newb Question?)


  • Subject: dot syntax issue? (Newb Question?)
  • From: Gregor Brandt <email@hidden>
  • Date: Thu, 08 Nov 2007 10:08:10 -0700

Hello,

I am new at Objective-C and Cocoa and have a quick question about the includes. The following codes gives me the error noted in the comment:

statusItem.menu = mainMenu; // works fine
statusItem.enabled = YES; // error: request for member 'enabled' in something not a structure or union
statusItem.highlightMode = YES; // works fine



I notice that enabled is not defined in NSStatusItem.h and that is the reason for the error, when I change the code to:


      statusItem.menu = mainMenu;
      [statusItem setEnabled:YES];
      statusItem.highlightMode = YES;

I don't get the error. This seems to be a hole in the dot syntax in objective-c 2.0. To me it seems odd that I can use dot syntax on some properties and not others.

Can someone explain to me why enabled does not exist in the NSStatusItem.h and why NSStatusItem.h does not use @property for its properties?

Thanks,

Gregor



_______________________________________________

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: dot syntax issue? (Newb Question?)
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: How to talk with a kernel extension?
  • Next by Date: Re: How to talk with a kernel extension?
  • Previous by thread: Re: How to talk with a kernel extension?
  • Next by thread: Re: dot syntax issue? (Newb Question?)
  • Index(es):
    • Date
    • Thread