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
-(UITableView *) parentTableView { | |
// iterate up the view hierarchy to find the table containing this cell/view | |
UIView *aView = self.superview; | |
while(aView != nil) { | |
if([aView isKindOfClass:[UITableView class]]) { | |
return (UITableView *)aView; | |
} | |
aView = aView.superview; | |
} | |
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
- (NSFetchedResultsController *)fetchedResultsController | |
{ | |
if (_fetchedResultsController != nil) | |
{ | |
return _fetchedResultsController; | |
} | |
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; | |
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Tag" inManagedObjectContext:[CoreDataHelper sharedInstance].managedObjectContext]; | |
[fetchRequest setEntity:entity]; |
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
// | |
// CoreDataHelper.m | |
// Wired In | |
// | |
// Created by Caleb Hicks on 6/20/14. | |
// | |
// Readme: I use a version of this file in each Core Data project I create. It runs as a Shared Instance. | |
// Simply, it returns the default Managed Object Context for the app. Sample methods also provided to save, create sample | |
// data, and log all data within the app. Adjust the Imports and related methods for your model objects. | |
// |
NewerOlder