Skip to content

Instantly share code, notes, and snippets.

@ccgus
Created February 15, 2013 17:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccgus/4961749 to your computer and use it in GitHub Desktop.
Save ccgus/4961749 to your computer and use it in GitHub Desktop.
replacing NSImage reps
NSImage *iRep = [NSImage imageNamed:[fileName stringByDeletingPathExtension]];
if (iRep) {
NSImage *ni = [[NSImage alloc] initByReferencingFile:output];
for (NSImageRep *r in [[iRep representations] copy]) {
[iRep removeRepresentation:r];
}
[iRep addRepresentations:[ni representations]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment