| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Points:
* Okay, confusion setting in. The following declaration makes sense in
it's own circumstance:
-(void) setWidth:(float)width height:(float)height;
but the abstraction loses consistency in:
-(void) mouseDown:(NSEvent *)theEvent;
Here, the method name has nothing to do with the parameter passed, where in
the first example, setWidth:height:, the words setWidth have everything to
do with describing the first parameter.
My ambiguity meter just blew up and landed across the room in pieces.
Why not just declare the first as:
-(void) setWidthHeight:(float)width :(float)height;
Then, when I call the method, it looks like:
[myRect setWidthHeight:10.0 :10.5];
Much more readable to me.
Or, would this be correct/possible?
-(void)setBounds width:(float)width height:(float)height;
^
* Are Obj-c method calls ordered as to parameters?
Is:
-(void) setTop:(float)top left:(float)left bottom:(float)bottom
right:(float)right;
The same as:
-(void) setTop:(float)top bottom:(float)bottom left:(float)left
right:(float)right;
* So, when Obj-c gets compiled, does this mean there's an extra layer to
the calling structure? It sounds like a message is interpreted before the
runtime system figures out where to direct the pc.
* the "+" vs. "-" thing:
I can't for the life of me conceive of a time when I would care about the
difference btwn class and instance methods, but I'm sure someone put it in
there for a reason. Anyone got some examples of when I would use a class
method over an instance method?
* Doc site:
I'm creating a site with tips, tricks, hints, general info for c++->obj-c
converts like myself. If anyone has any additional insights on how to
approach obj-c with a c++ mentality, please send them to me at:
mailto:email@hidden
Also, please send me any GOTCHAs -- i.e. Stuff you found frustrating because
it worked differently than you expected, whether it be re: obj-c syntax,
mindset required for obj-c or the IB or PB interaces. Come on, there has to
be something that got you when you were learning. <g> Come on, what was it?
| References: | |
| >More fun, curious obj-c questions (From: Scott <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.