Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Objective-C

Name: Anonymous 2009-02-22 2:30

Any Objective-C programmers here?

I'm reading up on dot notation. How come this

[object method:arg1, arg2]

can't be replaced by

object.method(arg1, arg2);

??

Name: Anonymous 2009-02-22 3:07

It's a macro for sepples

Name: Anonymous 2009-02-22 4:06

Objective-C reminds me of my own vomit after I've eaten curry.

Name: Anonymous 2009-02-22 5:26

>>1
If you want to program Java, go program Java.

Name: Anonymous 2009-02-22 6:57

Objective-J#

Name: Anonymous 2009-02-22 7:15

Objective-C uses smalltalk style OO instead of Sepples or Java style OO, so the syntax is also based on Smalltalk.

Name: Anonymous 2009-02-22 8:02

hay everyone laern ruby its so aewsome and then we can have discussions about ruby.

Name: Anonymous 2009-02-22 8:31

>>1
Also, normal ObjC methods look like
[object method:arg1 secondPar:arg2];
Parameters separated by commas are only used for variadic methods.

Name: Anonymous 2009-02-22 10:41

>>1
Because SmalltalkObjective-C uses labeled arguments.

obj.method("bar", NULL, NULL, TRUE, 17, "quux");

vs.

[obj method:"bar" stackroot:NULL pizza:NULL macfag:TRUE aids:17 duckname:"quux"];

Objective-C object pointers are dynamically typed under the hood, so this is the only way to overload method names anyway.

Name: Anonymous 2009-02-22 10:52

>>9
Dynamically typed? What the fuck?

So Objectivist-C is Ruby with a C syntax. Great. No wonder Macs are so much slower.

Name: Anonymous 2009-02-22 10:52

apple is retarded
>>10

Name: Anonymous 2009-02-22 12:02

>>9
Objective-C object pointers are dynamically typed under the hood, so this is the only way to overload method names anyway.

That is to say, the parameter names are part of the signature of the selector, so hax:my:anus: refers to a different selector than hax:your:anus:

Name: Anonymous 2009-02-22 15:09

>>9

So you're saying that I *can't* do

obj.method("bar", NULL, NULL, TRUE, 17, "quux");

in Objective-C 2.0? Then how come I've seen code with dot notation in Objective-C 2.0 with stuff like

obj.foo = 42;

?

Name: Anonymous 2009-02-22 15:50

>>13
In Objective-C 2.0 the dot operator can be used as shorthand for accessing object properties.

i = obj.foo is shorthand for i = [obj foo]

and

obj.foo = i is shorthand for [obj setFoo:i]

And it really only is shorthand - the same things will happen under the hood. If you're unfamiliar with Objective-C and the Foundation framework you'll probably think this is terrible!, but this is what makes e.g. key-value coding work. And that shit is where the V-TEC really kicks in, yo.

Name: Anonymous 2009-02-23 0:05

>>14
V-TEC
I think you mean AIDS

Name: Anonymous 2010-11-15 12:12

Name: Anonymous 2011-02-03 4:41


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List