Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

iphone - When should I use UIImagePickerControllerSourceTypePhotoLibrary instead of UIImagePickerControllerSourceTypeSavedPhotosAlbum?

I have an application that allows the user to pick a photo from their device. To do this, I'm using the UIImagePickerController, but the problem is that I'm unsure whether I should be using a source type of UIImagePickerControllerSourceTypePhotoLibrary or UIImagePickerControllerSourceTypeSavedPhotosAlbum.

On my iPhone 4 running iOS 5 the saved photos album gives a much better experience, but when I try to use my iPod Touch running iOS 4.3 using a photo that I synced from iTunes, it doesn't even show up. If I switch to PhotoLibrary my iPod works but my iPhone experience is worse. When I ask the UIImagePickerController it says the SavedPhotosAlbum is available on my iPod, but I don't seem to have a way to determine that it's empty.

What is the best way to determine which source type to use? If I have a way to determine if the Saved Photo Album is empty, I guess that would work, but I don't see one.

question from:https://stackoverflow.com/questions/8087405/when-should-i-use-uiimagepickercontrollersourcetypephotolibrary-instead-of-uiima

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

UIImagePickerControllerSourceTypePhotoLibrary references the entire photo library, letting the user choose which album. UIImagePickerControllerSourceTypeSavedPhotosAlbum goes straight to the camera roll album without giving the user a choice as to which album to choose from. They're similar, but different. You can get to the camera roll from PhotoLibrary; you can access only the camera roll from UIImagePickerControllerSourceTypeSavedPhotosAlbum.

Reference.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...