redribben

displayImage

Oct 28th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. - (void)displayImage {
  2. NSString *imagePath;
  3. NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  4. NSString *documentDirectoryPath = dirPaths[0];
  5. NSString *calendarDir = [documentDirectoryPath stringByAppendingString:[NSString stringWithFormat:@"/CalendarFolder/"]];
  6. NSArray *list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:calendarDir error:nil];
  7. for (NSString* file in list) {
  8. if ([[file pathExtension] isEqualToString: @"png"]) {
  9. // [[NSFileManager defaultManager] copyItemAtPath:file toPath:calendarDir error:nil];
  10. imagePath = [calendarDir stringByAppendingPathComponent:file];
  11. }
  12. }
  13. UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagePath];
  14. [self.scheduleImage setImage:image];
  15. }
Advertisement
Add Comment
Please, Sign In to add comment