45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
#import <Fondation/Fondation.h>
|
|
|
|
// Simple class
|
|
@interface MyClass : Object <beginfold id='1'>{</beginfold id='1'>
|
|
// instance variables
|
|
int myVariable
|
|
<endfold id='1'>}</endfold id='1'>
|
|
// Class methods
|
|
+ myClassMethod;
|
|
+ (int)myClassMethod2;
|
|
+ (int)myClassMethod3:(NSString *)parameter;
|
|
|
|
// Instance methods
|
|
- (int)myInstanceMethod:(NSString *)text;
|
|
- (NSString *)myInstanceMethod2:(int)parameter
|
|
withText:(NSString *)text;
|
|
@end
|
|
|
|
@implementation MyClass
|
|
+ (int)classMethod <beginfold id='1'>{</beginfold id='1'>
|
|
return [self myVariable];
|
|
<endfold id='1'>}</endfold id='1'>
|
|
- (NSString *)instanceMethod <beginfold id='1'>{</beginfold id='1'>
|
|
NSString *string = [[NSString alloc]initWithUTF8String:"Good string ©"];
|
|
NSLog(@"String:%@",string);
|
|
return string;
|
|
<endfold id='1'>}</endfold id='1'>
|
|
@end
|
|
|
|
|
|
// Protocol
|
|
@protocol MyKeyProtocol
|
|
- (void)lock;
|
|
- (void)unlock;
|
|
@end
|
|
|
|
// Class that implements a protocol
|
|
@interface MyClass2 : Object <MyKeyProtocol> <beginfold id='1'>{</beginfold id='1'>
|
|
|
|
<endfold id='1'>}</endfold id='1'>
|
|
// Protocol methods
|
|
- (void)lock;
|
|
- (void)unlock;
|
|
@end
|