Skip to content

Instantly share code, notes, and snippets.

@farcaller
Created October 15, 2009 20:25
Show Gist options
  • Select an option

  • Save farcaller/211251 to your computer and use it in GitHub Desktop.

Select an option

Save farcaller/211251 to your computer and use it in GitHub Desktop.
NSString *sPath = [[NSBundle mainBundle] pathForResource:@"pagetpl" ofType:@"html"];
NSMutableString *s = [NSMutableString stringWithContentsOfFile:sPath];
for(NSString *k in [NSArray arrayWithObjects:@"title", @"text", @"formattedDate", @"faviconDomain", nil]) {
[s
replaceOccurrencesOfString:[@"$" stringByAppendingString:k]
withString:[[entry valueForKey:k] description]
options:0
range:NSMakeRange(0, [s length])];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment