Created
November 22, 2012 02:35
-
-
Save tedhagos/4129140 to your computer and use it in GitHub Desktop.
deleteme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
You do not need to write individual getter and setter methods for | |
members of the class. This can be accomplished using | |
@property and @synthesize. The @property directive is done on the | |
header source and synthesize on the implementation source | |
The method name convention is; | |
set[InstanceVar], the first letter of instance var is capitalized | |
*/ | |
#import <Foundation/Foundation.h> | |
#import "Prop.h" | |
@implementation Prop | |
@synthesize one, two; | |
- (void) printem { | |
NSLog(@ "One is %i and Two is %i", one, two); | |
} | |
- (void) divideem { | |
NSLog(@ "%i / %i = %f ", one, two, one/(float)two); | |
} | |
- (void) multiplyem { | |
NSLog(@ "%i * %i = %i ", one, two, one * two); | |
} | |
- (void) addem { | |
NSLog(@ "%i + %i = %i ", one, two, one + two); | |
} | |
@end | |
///////////////////////////////////////////////// | |
int main() { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
Prop * prop = [[Prop alloc] init]; | |
[prop setOne: 1]; | |
[prop setTwo: 2]; | |
[prop divideem]; | |
[prop addem]; | |
[prop printem]; | |
[prop multiplyem]; | |
[pool drain]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment