Created
August 18, 2013 20:22
-
-
Save pbrewczynski/6263806 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
#import <Foundation/Foundation.h> | |
@interface MyQuiz : NSObject | |
@property (nonatomic, strong) NSMutableArray *quoteArray; | |
-(id) initWithTheQuiz : (NSString *) plistName; | |
@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
#import "MyQuiz.h" | |
@implementation MyQuiz | |
-(id) initWithTheQuiz:(NSString *)plistName { | |
self = [super init]; | |
if(self) { | |
NSString *pathToResource = [[NSBundle mainBundle ] pathForResource: plistName ofType:@"plist"]; | |
NSMutableArray *quoteArray = [NSMutableArray arrayWithContentsOfFile:pathToResource]; | |
} | |
return self; | |
} | |
@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
#import <UIKit/UIKit.h> | |
@class MyQuiz; | |
@interface QuoteQuizViewController : UIViewController | |
@property (nonatomic, assign) NSInteger quizIndex; | |
@property (nonatomic, strong) MyQuiz * quiz; | |
@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
#import "QuoteQuizViewController.h" | |
#include "MyQuiz.h" | |
@interface QuoteQuizViewController () | |
@end | |
@implementation QuoteQuizViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
self.quizIndex = 999; | |
self.quiz = [[MyQuiz alloc] initWithTheQuiz:@"quotes"]; | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
- (void)didReceiveMemoryWarning | |
{ | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment