I'm new to Objective-C 2.0, but very familiar with C++.
In C++ I would do the following inside a classes .h or header file, but I can't seem to do this in Objective-C 2.0 in XCode 4.0.
Is there an 'Objective-C 2.0' way to do this?
Example
In HEADER FILE:
// Header File
class MyClass
{
private:
float _myFloat;
public:
(float) getMyFloat { return _myFloat; }
};
The idea being that I don't have to go into the .cpp file to add the 'getMyFloat' method, I can just do that inside the header.
When I try and do this in XCode 4.0 with Objective-C 2.0 it gives me errors.
-(float) getMyFloat { return _myFloat; }
Thanks for any advice.