iPhoto v5 のメソッド対応
@@ -34,6 +34,7 @@ | ||
34 | 34 | - (unsigned long)originalImageFormatAtIndex:(unsigned int)fp8; |
35 | 35 | - (BOOL)originalIsRawAtIndex:(unsigned int)fp8; |
36 | 36 | - (BOOL)originalIsMovieAtIndex:(unsigned int)fp8; |
37 | +- (id)imageCaptionAtIndex:(unsigned int)fp8; | |
37 | 38 | - (id)imageTitleAtIndex:(unsigned int)fp8; |
38 | 39 | - (id)imageCommentsAtIndex:(unsigned int)fp8; |
39 | 40 | - (float)imageRotationAtIndex:(unsigned int)fp8; |
@@ -40,7 +40,13 @@ | ||
40 | 40 | photo = [[PUPhoto alloc] init]; |
41 | 41 | |
42 | 42 | [photo setValue:[mgr imagePathAtIndex:i] forKey:@"path"]; |
43 | - [photo setValue:[mgr imageTitleAtIndex:i] forKey:@"title"]; | |
43 | + if ([mgr respondsToSelector:@selector(imageCaptionAtIndex:)]) { | |
44 | + // iPhoto v5 | |
45 | + [photo setValue:[mgr imageCaptionAtIndex:i] forKey:@"title"]; | |
46 | + } else if ([mgr respondsToSelector:@selector(imageTitleAtIndex:)]) { | |
47 | + // iPhoto v7 | |
48 | + [photo setValue:[mgr imageTitleAtIndex:i] forKey:@"title"]; | |
49 | + } | |
44 | 50 | [photo setValue:[mgr imageCommentsAtIndex:i] forKey:@"comment"]; |
45 | 51 | [photo setValue:[mgr imageKeywordsAtIndex:i] forKey:@"keyword"]; |
46 | 52 | [photos addObject:photo]; |