Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created August 18, 2013 20:22
Show Gist options
  • Save pbrewczynski/6263806 to your computer and use it in GitHub Desktop.
Save pbrewczynski/6263806 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface MyQuiz : NSObject
@property (nonatomic, strong) NSMutableArray *quoteArray;
-(id) initWithTheQuiz : (NSString *) plistName;
@end
#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
#import <UIKit/UIKit.h>
@class MyQuiz;
@interface QuoteQuizViewController : UIViewController
@property (nonatomic, assign) NSInteger quizIndex;
@property (nonatomic, strong) MyQuiz * quiz;
@end
#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