RosettaCodeData/Task/Classes/Objective-C/classes-2.m

18 lines
306 B
Mathematica
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
@implementation MyClass
// Was not declared because init is defined in NSObject
2015-02-20 00:35:01 -05:00
- (instancetype)init
2013-04-10 22:43:41 -07:00
{
2015-02-20 00:35:01 -05:00
if (self = [super init]) {
variable = 0; // not strictly necessary as all instance variables are initialized to zero
}
2013-04-10 22:43:41 -07:00
return self;
}
- (int)variable
{
return variable;
}
@end