Re: Strange property/synthesized accessor behaviour

2011-04-10 Thread Matt Neuburg
On Sun, 10 Apr 2011 14:45:12 +0200, Philipp Leusmann said: >In this situation XCode4 did not show a warning. This reminds me of this: I was tromping on an undocumented exis

Re: Strange property/synthesized accessor behaviour

2011-04-10 Thread Quincey Morris
On Apr 10, 2011, at 03:25, Philipp Leusmann wrote: > This absolutely explains the observed behavior, but still leaves me wondering > about the feature of sending messages to id. > While I am still new to programming in objective-c and only having read the > basic language documentation, I remem

Re: Strange property/synthesized accessor behaviour

2011-04-10 Thread Philipp Leusmann
In this situation XCode4 did not show a warning. Philipp Am 10.04.2011 um 13:44 schrieb Anders Norlander: > You should get a warning about ambiguous messages, and it also tells you > which selector is actually used: > Multiple methods named 'width' found > Using '-(CGFloat)width' > > Then us

Re: Strange property/synthesized accessor behaviour

2011-04-10 Thread Anders Norlander
You should get a warning about ambiguous messages, and it also tells you which selector is actually used: Multiple methods named 'width' found Using '-(CGFloat)width' Then use static typing to resolve the ambiguity (i.e [(Resolution*)object width]) 'treat warnings as errors' is a big help in avo

Re: Strange property/synthesized accessor behaviour

2011-04-10 Thread Philipp Leusmann
Stephen, thanks to your detailed answer. This absolutely explains the observed behavior, but still leaves me wondering about the feature of sending messages to id. While I am still new to programming in objective-c and only having read the basic language documentation, I remember this feature t

Re: Strange property/synthesized accessor behaviour

2011-04-10 Thread Stephen J. Butler
On Sat, Apr 9, 2011 at 9:52 AM, Philipp Leusmann wrote: > Who can explain this behavior to me? Why is oWidth != object.mWidth ? How can > that happen? It's an artifact of how Objective-C searches for selector implementations. You're calling @selector(width) on an "id", and of course "id" doesn't

RE: Strange property/synthesized accessor behaviour

2011-04-10 Thread Lee Ann Rucker
Unless you've got @synthesize width = mWidth; ObjC has created a second set of variables for you named width and height with no connection to mWidth and mHeight. From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com [cocoa-dev-bounces+lrucker=vmware