This file contains hidden or 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
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| static NSString *MyIdentifier = @"MyReuseIdentifier"; | |
| UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; | |
| if (cell == nil) { | |
| cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault | |
| reuseIdentifier:MyIdentifier]; | |
| } | |
| // format the cell | |
| cell.textLabel.text =@""; | |
| cell.imageView.image =[UIImage imageNamed:@"icon"]; |
This file contains hidden or 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
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| static NSString *MyIdentifier = @"MyReuseIdentifier"; | |
| UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; | |
| if (cell == nil) { | |
| cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]; | |
| } | |
| // format the cell | |
| return cell; | |
| } |
This file contains hidden or 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 "Deck.h" | |
| @implementation Deck | |
| -(instancetype)init{ | |
| if(self= [super init]){ | |
| _questions = [NSMutableArray new]; | |
| } | |
| return self; | |
| } |
This file contains hidden or 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 Deck : NSObject | |
| @property(nonatomic, strong) NSMutableArray * questions; | |
| @property(nonatomic, strong) NSString * name; | |
| @end |
This file contains hidden or 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
| // XMLParser.m | |
| // CDT | |
| // Created by Janusz Chudzynski on 1/13/14. | |
| #import "XMLParser.h" | |
| #import "Deck.h" | |
| #import "Question.h" | |
| typedef void (^SuccessBlock)(NSData *); |
This file contains hidden or 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
| -(BOOL)checkIfOnline{ | |
| NSURL *scriptUrl = [NSURL URLWithString:@"http://google.com/m"]; | |
| NSData *data = [NSData dataWithContentsOfURL:scriptUrl]; | |
| if (data){ | |
| NSLog(@"Device is connected to the internet"); | |
| return YES;} | |
| else | |
| NSLog(@"Device is not connected to the internet"); | |
| return NO; |
This file contains hidden or 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 KVOOperationQueue() | |
| @property(nonatomic, strong) NSOperationQueue *queue; | |
| @end | |
| @implementation KVOOperationQueue | |
| -(id)init{ | |
| self = [super init]; | |
| if(self){ | |
| filePath = filename; |
This file contains hidden or 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
| NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
| NSEntityDescription *entity = [NSEntityDescription entityForName:@"Slide" inManagedObjectContext:[[manager getAppDelegate]managedObjectContext]]; | |
| [request setEntity:entity]; | |
| // Specify that the request should return dictionaries. | |
| [request setResultType:NSDictionaryResultType]; | |
| NSExpression *keyPathExpression = [NSExpression expressionForKeyPath:@"order"]; | |
| // Create an expression to represent the minimum value at the key path 'creationDate' | |
| NSExpression *minExpression = [NSExpression expressionForFunction:@"min:" arguments:[NSArray arrayWithObject:keyPathExpression]]; |
This file contains hidden or 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 "AppDelegate.h" | |
| #import "WebServicesHelper.h" | |
| @interface AppDelegate() | |
| @property (nonatomic,strong)WebServicesHelper * helper; | |
| @end | |
| @implementation AppDelegate | |
This file contains hidden or 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
| /*! | |
| @class WebServicesHelper | |
| @abstract | |
| Contains methods that are making networking calls and parse the response | |
| @discussion | |
| respond to, e.g., authentication challenges | |
| */ |