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")




But then, either of these do not compile:

   path = set.anyObject.path ;
   path = (set.anyObject).path ;

In either case,

error: request for member 'path' in something not a structure or union

Then why did it work fine when in url.path by itself?

Because anyObject returns id, and since there are no properties of id, you get an error.
When you did:
   url = set.anyObject ;
   path = url.path ;


url had an explicit type (NSURL *) which had a path property.



Glenn Andreas                      [EMAIL PROTECTED]
 <http://www.gandreas.com/> wicked fun!
JSXObjC | the easy way to unite JavaScript and Objective C




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to