• 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: What are the limitations of Dot Syntax?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What are the limitations of Dot Syntax?


  • Subject: Re: What are the limitations of Dot Syntax?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 5 Dec 2008 17:24:09 -0800


On 2008 Dec, 05, at 16:44, glenn andreas wrote:


On Dec 5, 2008, at 6:32 PM, Jerry Krinock wrote:

I've been having some unexpected results trying to compile code using Objective-C's Dot Syntax. I realize that this may be due to an important question that I didn't find the answer to when I read about Objective-C 2.0 Properties is: Can you use the dot syntax for "regular" messages that take 0 arguments?
You can, but you shouldn't (it's considered "dot abuse")

Thanks for the quick answer to Glenn and Bill. So now, knowing what was legal, I was able to compile the following using "as many dots as legally possible":


    NSString* name = ((Bird*)[foo.bar.birds anyObject]).name ;

    where
       bar is an @property Bar* of Foo
       birds is an @property NSSet* of Bar
       name is an @property NSString* of Bird

Interestingly, it will not compile without the (Bird*) typecast.

So I filed two bugs on gcc/Xcode:

6423994: Editor does not line up colons in Obj-C messages also using Dot Syntax
6424037: Error message does not know about Obj-C 2.0 Properties


Jerry

_______________________________________________

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: What are the limitations of Dot Syntax?
      • From: Chris Hanson <email@hidden>
References: 
 >What are the limitations of Dot Syntax? (From: Jerry Krinock <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: What are the limitations of Dot Syntax?
  • Next by Date: Re: Getting a substring
  • Previous by thread: Re: What are the limitations of Dot Syntax?
  • Next by thread: Re: What are the limitations of Dot Syntax?
  • Index(es):
    • Date
    • Thread