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
- (void)insertNewObject { | |
// Create a new instance of the entity managed by the fetched results controller. | |
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; | |
NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; | |
// Loop through array of hashes and save | |
for (NSMutableDictionary *story in stories) { | |
NSManagedObject *storiesData = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; |
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
Stories *story = (Stories *)[self.fetchedResultsController objectAtIndexPath:indexPath]; | |
cell.textLabel.text = story.title; |
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
// dump to database | |
[self insertNewObject]; |
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
[item setObject:currentTitle forKey:@"title"]; | |
[item setObject:currentLink forKey:@"link"]; | |
[item setObject:currentSummary forKey:@"summary"]; | |
[item setObject:currentDate forKey:@"date"]; | |
[stories addObject:[item copy]]; |
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
NSString * path = @"http://feeds.feedburner.com/TheAppleBlog"; | |
[self parseXMLFileAtURL:path]; |
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
- (void)parseXMLFileAtURL:(NSString *)URL; | |
- (void)parserDidStartDocument:(NSXMLParser *)parser; | |
- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError; | |
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName ... | |
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName ... | |
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string; | |
- (void)parserDidEndDocument:(NSXMLParser *)parser; |
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
entityForName:@"Event" |
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
entityForName:@"Stories" |
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
UIImageView *iconView = [[[UIImageView alloc] initWithFrame:CGRectMake( | |
50, | |
25, | |
24, | |
16 | |
)] autorelease]; | |
UIImage *iconImage = [UIImage imageNamed:@"eye.png"]; | |
iconView.image = iconImage; | |
[[cell contentView] addSubview:iconView]; |
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
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
OlderNewer