{"id":297,"date":"2009-06-09T21:26:03","date_gmt":"2009-06-10T05:26:03","guid":{"rendered":"http:\/\/fernyb.net\/blog\/?p=297"},"modified":"2009-06-09T21:37:53","modified_gmt":"2009-06-10T05:37:53","slug":"iphone-sdk-30-gm","status":"publish","type":"post","link":"http:\/\/fernyb.net\/blog\/2009\/06\/09\/iphone-sdk-30-gm\/","title":{"rendered":"iPhone SDK 3.0 GM"},"content":{"rendered":"<p>While looking into my app for deprecated methods I have found one that did not have much documentation to it. It was a delegate method from UIImagePickerControllerDelegate and this is the way I use it for when an image is ready to be posted.<\/p>\n<div class=\"ruby\" style=\"width: 490px; height: 125px; overflow: scroll; padding: 10px; background: #0d0e24;\">\n<pre><span class=\"punct\">-<\/span> <span class=\"punct\">(<\/span><span class=\"ident\">void<\/span><span class=\"punct\">)<\/span><span class=\"ident\">imagePickerController<\/span><span class=\"punct\">: (<\/span><span class=\"constant\">UIImagePickerController<\/span> <span class=\"punct\">*)<\/span><span class=\"ident\">picker<\/span> <span class=\"ident\">didFinishPickingImage<\/span><span class=\"punct\">: (<\/span><span class=\"constant\">UIImage<\/span> <span class=\"punct\">*)<\/span><span class=\"ident\">img<\/span> <span class=\"ident\">editingInfo<\/span><span class=\"punct\">: (<\/span><span class=\"constant\">NSDictionary<\/span> <span class=\"punct\">*)<\/span><span class=\"ident\">editInfo<\/span> <span class=\"punct\">{<\/span>\r\n  <span class=\"punct\">[[<\/span><span class=\"ident\">picker<\/span> <span class=\"ident\">parentViewController<\/span><span class=\"punct\">]<\/span> <span class=\"ident\">dismissModalViewControllerAnimated<\/span><span class=\"symbol\">:YES<\/span><span class=\"punct\">];<\/span>\r\n  <span class=\"punct\">[<\/span><span class=\"ident\">image<\/span> <span class=\"ident\">setImage<\/span><span class=\"symbol\">:img<\/span><span class=\"punct\">];<\/span>\r\n  <span class=\"punct\">[<\/span><span class=\"constant\">self<\/span> <span class=\"ident\">confirmPhotoUpload<\/span><span class=\"punct\">];<\/span>\r\n<span class=\"punct\">}<\/span><\/pre>\n<\/div>\n<p>Now the only problem with that method above is that it is now deprecated in the iPhone OS 3.0 SDK and you must now use a method called imagePickerController:didFinishPickingMediaWithInfo:<br \/>\nand the way I use that method is like this:<\/p>\n<div class=\"ruby\" style=\"width: 490px; height: 155px; overflow: scroll; padding: 10px; background: #0d0e24;\">\n<pre><span class=\"punct\">-<\/span> <span class=\"punct\">(<\/span><span class=\"ident\">void<\/span><span class=\"punct\">)<\/span><span class=\"ident\">imagePickerController<\/span><span class=\"punct\">: (<\/span><span class=\"constant\">UIImagePickerController<\/span> <span class=\"punct\">*)<\/span><span class=\"ident\">picker<\/span> <span class=\"ident\">didFinishPickingMediaWithInfo<\/span><span class=\"punct\">: (<\/span><span class=\"constant\">NSDictionary<\/span> <span class=\"punct\">*)<\/span><span class=\"ident\">info<\/span>\r\n<span class=\"punct\">{<\/span>\r\n  <span class=\"punct\">[[<\/span><span class=\"ident\">picker<\/span> <span class=\"ident\">parentViewController<\/span><span class=\"punct\">]<\/span> <span class=\"ident\">dismissModalViewControllerAnimated<\/span><span class=\"symbol\">:YES<\/span><span class=\"punct\">];<\/span>\r\n  <span class=\"constant\">UIImage<\/span> <span class=\"punct\">*<\/span> <span class=\"ident\">img<\/span> <span class=\"punct\">=<\/span> <span class=\"punct\">[<\/span><span class=\"ident\">info<\/span> <span class=\"ident\">objectForKey<\/span><span class=\"symbol\">:@<\/span><span class=\"punct\">\"<\/span><span class=\"string\">UIImagePickerControllerEditedImage<\/span><span class=\"punct\">\"];<\/span>\r\n  <span class=\"punct\">[<\/span><span class=\"ident\">image<\/span> <span class=\"ident\">setImage<\/span><span class=\"symbol\">:img<\/span><span class=\"punct\">];<\/span>\r\n  <span class=\"punct\">[<\/span><span class=\"constant\">self<\/span> <span class=\"ident\">confirmPhotoUpload<\/span><span class=\"punct\">];<\/span>\r\n<span class=\"punct\">}<\/span><\/pre>\n<\/div>\n<p>So if your stuck trying to figure out what method to now use, use imagePickerController:didFinishPickingMediaWithInfo: and what will have a NSDictionary with all the needed information about the image.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While looking into my app for deprecated methods I have found one that did not have much documentation to it. It was a delegate method from UIImagePickerControllerDelegate and this is the way I use it for when an image is ready to be posted. &#8211; (void)imagePickerController: (UIImagePickerController *)picker didFinishPickingImage: (UIImage *)img editingInfo: (NSDictionary *)editInfo { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27,6,53,3,9],"tags":[120,116,113,121],"_links":{"self":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts\/297"}],"collection":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":11,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":301,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions\/301"}],"wp:attachment":[{"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fernyb.net\/blog\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}