objective c - Displaying image from asset library -


I am trying to get an image selected with imagePickerControl and open it using the provided URL to open it Image View I'm displaying on If I use UIImagePickerControllerOriginalImage to set my image, then it works fine, but I do not want to store the image in my database, I just want to store the URL. Before I moved this into my code, I wanted to make sure that it would work as a BELO code that gives the selected image to the PickRCentron and attempts to display the image.

image picture controller: (UIImagePickerController *) Picker didFinishPickingMediaWithInfo: (NSDictionary *) Information {[Dismissed ViewControllerAnimated: Yes Completed: Zero]; Self.imageURL = [for information object: UIImagePickerControllerReferenceURL]; CCLog (@ "image =% @", [information object: foreki: UIImagePickerControllerReferenceURL]); // self.image = [For information object: UIImagePickerControllerOriginalImage]; ALAuthorizationStatus Status = [Allsets Library Authority]; Switch (status) {Case ALAuthorizationStatusDenied: {CCLog (@ "Not authorized"); break; } Case ALAuthorizationStatusRstricted: {CCLog (@ "restricted"); break; } Case ALAuthorizationStatusNotDetermined: {CCLog (@ "undefined"); break; } Case ALAuthorizationStatus Authorized: {CCLog (@ "Authorized"); CCLog (@ "self.imageURL =% @", self.imageURL); Elasette Library * Library = [[Elsace Library Library] init]; __bok UIImage * returnValue = Zero; [Library Property for URL: self.imageURL Results: ^ (ALSSset * Asset) {Return Value = [UIIMAGE Image with CGImage: [[Asset Default Reference] Fullsion Image]]; } FailureBlock: ^ (NSError * error) {NSLog (@ "error:% @", error); }]; [Self.imageDisplay setImage: returnValue]; [Self.imageDisplay setNeedsDisplay]; break; } Default: {CCLog (@ "unknown hit default"); break; }} // You have the image you can use to present the image in the next scene as you are required in `# 3`.

When it moves, return Value is coming in the form of zero when I find it and no image is displayed. I got the code from

assetForURL: Results: Block

Thank you

: failure Blocked: is asynchronous you want something like:

  case ALAuthorizationStatus authorized: {CCLog (@ "authorized"); CCLog (@ "self.imageURL =% @", self.imageURL); Elasette Library * Library = [[Elsace Library Library] init]; [Library Asset URL: Self Imejayuarel results: block: ^ (* Elaset asset) {UIImage * returnValue = [UIImage imageWithCGImage: [[asset default report] Puarnrswikrn image]]; Dispatch_Assicant (transmitted_tot_me_q ()), ^ {[self. Image display set image: return value]; [Self. Image display set nights display;}); } FailureBlock: ^ (NSError * error) {NSLog (@ "error:% @", error); }]; break; }  

BTW - What does this mean? You can get a lot of image from image picker delegation method. There is no need to get the image again from the Asset Library.

Just:

  - (minus) image picture Controller: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {self.imageDisplay.image = [information object For: UIImagePickerControllerOriginalImage]; [Self shotgun viewer unpowered: yes complete: zero]; }  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -