• 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
Using dot syntax for non-@property properties?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using dot syntax for non-@property properties?


  • Subject: Using dot syntax for non-@property properties?
  • From: Joshua Emmons <email@hidden>
  • Date: Tue, 6 Nov 2007 19:30:45 -0600

One of the dot syntax "Usage Summaries" from "The Objective-C 2.0 Programming Language" is:

xOrigin = aView.bounds.origin.x;

This leads me to believe that I can replace the following code:

-(void)viewClicked:(id)sender{
   NSSize size = [sender bounds].size;
   size.height *= 2;
   [[sender animator] setBoundsSize:size];
}

with something like:

-(void)viewClicked:(id)sender{
   NSSize size = sender.bounds.size;
   size.height *= 2;
   sender.animator.boundsSize = size;
}

However, when I do so, I get errors like "request for member 'bounds' in something not a structure or a union". It sounds to me like the compiler has no idea what's going on with the dot there. Or, at least, it's definitely not [sender bounds], which is what I would have expected. What am I overlooking here?

Many thanks,
-Joshua Emmons

_______________________________________________

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: Using dot syntax for non-@property properties?
      • From: email@hidden
    • Re: Using dot syntax for non-@property properties?
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: NSLayoutManager and avoiding widows and orphans
  • Next by Date: Re: Using dot syntax for non-@property properties?
  • Previous by thread: Re: DO: Local objects passed back from the other side: Leopard vs. earlier systems
  • Next by thread: Re: Using dot syntax for non-@property properties?
  • Index(es):
    • Date
    • Thread