如何让TTPhotoViewController显示UIImage?

Eri*_*k B 3 iphone uiimage three20 ttphotoviewcontroller

我有一个UIImage,我想用TTPhotoViewController显示,但TTPhotoViewController不会将UIImage作为参数.它确实需要一个TTPhoto作为参数,所以我想知道是否有办法将UIImage转换为TTPhoto,或者是否有任何其他方法可以让TTPhotoViewController显示我的UIImage,而不是设置defaultImage,它没有'工作得太好了.

eli*_*ife 7

我用一点点黑客来做:

NSString *url = [[TTURLCache sharedCache] createUniqueTemporaryURL];    
[[TTURLCache sharedCache] storeImage:baseImage forURL:url force:YES];

PEPhotoViewController *album=[[[PEPhotoViewController alloc] initWithImageURL:url] autorelease];
Run Code Online (Sandbox Code Playgroud)