advertisement

Article:
  Creating a Color Meter Using Cocoa
Subject:   builds... but still problems.
Date:   2001-06-18 15:19:19
From:   snoyes
Response to: builds... but still problems.

"
[blueField setFloatValue:sender];
"


try


[blueField setFloatValue:[sender floatValue]];
.
.
.


"On an unrelated topic, is there a C++ interface to the Cocoa APIs? I really hate Objective-C"


No. Not to belittle C++, but it would not be possible for C++ to talk Objective-C and Cocoa is way beyond the languages capabilities. C++ is a class based language but not really object oriented. You loose some things like templates and operator overloading and gain things like name parameters, pose-as, and categories. In all, you pick-up much much more than you loose. Many of C++ "features" are required to make up for its lack of dynamic execution.


As for the syntax... You get used to it pretty fast. I did C++ for 3-5 years before seeing Obj-C and thought it was strange for the first couple weeks. Now, I can't imagine going back. I have NEVER missed operator overloading, defaults, templates and C++'s horrid syntax.


1 to 1 of 1
  1. Why setFloatvalue:sender?
    2002-03-12 10:09:28  spiffyman [View]

    • Why setFloatvalue:sender?
      2002-03-12 10:13:30  spiffyman [View]

1 to 1 of 1