Im a C# developer whom is new to Objective C and this migration has not been easy due to the difference between the two languages.
What im try do is to create a class that has properties similar to as you do in C#. If for ex have a C# class which looks like:
public class X
{
private int _d, _y;
public int D { get {return _d; } set{ _d= value;}}
public int Y { get{ return _y;} set {_y = value;}}
}
Who does one write this in objective C?
I have tried but been unable to do this. My objective C class for the moment looks like this:
@interface X : NSObject
{
@private
int _d ,_y;
}
@property (nonatomic, readwrite, retain) int d;
@property (nonatomic, readwrite, retain) int y;
@end
@implementation X
@synthesize d = _d;
@synthesize y = _y;
-(void)dealloc
{
[d release];
[y release];
[super dealloc];
}
@end
Thank you in advance.