Created
May 31, 2010 04:20
-
-
Save jonsterling/419525 to your computer and use it in GitHub Desktop.
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
@interface SomeClass : SomeControllerClass <JSTutorialDelegate> | |
// ... | |
@end |
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
@implementation JSTutorial | |
@synthesize title; | |
@synthesize body; | |
@synthesize delegate; | |
- (void)generateTutorial { | |
// do something here? | |
if ([[self delegate] respondsToSelector:@selector(tutorialDidFinish:)]) { | |
[[self delegate] tutorialDidFinish:self]; | |
} | |
} | |
- (void)dealloc { | |
[title release]; | |
[body release]; | |
[super dealloc]; | |
} | |
@end |
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
@interface JSTutorial: NSObject { | |
NSString *title; | |
NSString *body; | |
} | |
- (void)generateTutorial; | |
@property (nonatomic, retain) NSString *title; | |
@property (nonatomic, retain) NSString *body; | |
@end |
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
@protocol JSTutorialDelegate; | |
@interface JSTutorial: NSObject { | |
NSString *title; | |
NSString *body; | |
id <JSTutorialDelegate> delegate; | |
} | |
- (void)generateTutorial; | |
@property (nonatomic, retain) NSString *title; | |
@property (nonatomic, retain) NSString *body; | |
@property (nonatomic, assign) id <JSTutorialDelegate> delegate; | |
@end | |
@protocol JSTutorialDelegate <NSObject> | |
@optional | |
- (void)tutorialDidFinish:(JSTutorial *)tutorial; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment