{"id":1697,"date":"2011-09-24T16:40:45","date_gmt":"2011-09-24T20:40:45","guid":{"rendered":"http:\/\/www.acarlstein.com\/?p=1697"},"modified":"2011-10-21T15:23:14","modified_gmt":"2011-10-21T19:23:14","slug":"ios-programming-part-1","status":"publish","type":"post","link":"http:\/\/blog.acarlstein.com\/?p=1697","title":{"rendered":"iOS and OpenGL ES Programming &#8211; Part 1"},"content":{"rendered":"<p>After finish my last project, <a href=\"http:\/\/www.cupid-4-stupid.com\" target=\"_blank\">Cupid-4-Stupid<\/a>, for the Android Market, I decided to play around the iPhone\/iTouch.<\/p>\n<p>I have many books and tutorial at my disposal; however, most of them do not reflex the changes that Objective-C have being doing. I will be adding references as a work cities at the end of the posting<\/p>\n<p>Even do most of the code seems to work, many produce warning all around; so, I have to do what I do best&#8230; improvise.<\/p>\n<p>I am going to post the different steps I am taking in order to learn how to program on iOS and OpenGL using XCode and Objective-C.<\/p>\n<p>Just to clarify, iOS use OpenGL ES which is a lite version of OpenGL. At the momento of writing this post there are two versions of OpenGL ES: OpenGL ES 1.0 (ES1) and OpenGL ES 2.0 (ES2).<\/p>\n<p>I bought XCode version 4.0.2. It cost me around 5 dollars. Later on, I found out the negative reviews that this version had generated. I am hoping that soon Apple address all the issues that people are complaining around the web.<\/p>\n<p>(I am assuming that you have this version installed in your computer)<\/p>\n<p>First lets create a new application:<\/p>\n<ol>\n<li>Open the application by clicking here<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.12.57-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1701\" title=\"Screen shot 2011-09-24 at 4.12.57 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.12.57-PM.png\" alt=\"\" width=\"51\" height=\"30\" \/>\u00a0<\/a><\/li>\n<li>Select the option [Create a new Xcode project]<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.13.14-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1702\" title=\"Screen shot 2011-09-24 at 4.13.14 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.13.14-PM-300x194.png\" alt=\"\" width=\"300\" height=\"194\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.13.14-PM-300x194.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.13.14-PM.png 807w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u00a0<\/a><\/li>\n<li>Select OpenGL ES Application<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.02-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1705\" title=\"Screen shot 2011-09-24 at 4.15.02 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.02-PM-300x202.png\" alt=\"\" width=\"300\" height=\"202\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.02-PM-300x202.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.02-PM.png 728w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/a><\/li>\n<li>Fill the information such as product name (Example 01), company name (your.company.name), and the device family (iphone)<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.48-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1706\" title=\"Screen shot 2011-09-24 at 4.15.48 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.48-PM-300x201.png\" alt=\"\" width=\"300\" height=\"201\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.48-PM-300x201.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.15.48-PM.png 727w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/a><\/li>\n<li>A window will show up asking you where to save the project. Press [New Folder]<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.01-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1707\" title=\"Screen shot 2011-09-24 at 4.16.01 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.01-PM-300x212.png\" alt=\"\" width=\"300\" height=\"212\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.01-PM-300x212.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.01-PM.png 537w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u00a0<\/a><\/li>\n<li>Type the name of the folder (Example01) that will hold your project<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.34-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1709\" title=\"Screen shot 2011-09-24 at 4.16.34 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.34-PM-300x210.png\" alt=\"\" width=\"300\" height=\"210\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.34-PM-300x210.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.34-PM.png 541w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u00a0<\/a><\/li>\n<li>Access to the folder that you created and press the button [Create]<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.44-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1710\" title=\"Screen shot 2011-09-24 at 4.16.44 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.44-PM-300x210.png\" alt=\"\" width=\"300\" height=\"210\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.44-PM-300x210.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.16.44-PM.png 539w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u00a0<\/a><\/li>\n<li>Now you should see what I call the workbench, where you will be working on.<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-8.58.00-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1720\" title=\"Screen shot 2011-09-27 at 8.58.00 AM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-8.58.00-AM-300x189.png\" alt=\"\" width=\"300\" height=\"189\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-8.58.00-AM-300x189.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-8.58.00-AM-1024x645.png 1024w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-8.58.00-AM.png 1392w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>If you press [Run]<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.18.19-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1711\" title=\"Screen shot 2011-09-24 at 4.18.19 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.18.19-PM.png\" alt=\"\" width=\"93\" height=\"56\" \/><br \/>\n<\/a>you will see the iPhone simulator running your project<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.18.39-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1712\" title=\"Screen shot 2011-09-24 at 4.18.39 PM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.18.39-PM-154x300.png\" alt=\"\" width=\"154\" height=\"300\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.18.39-PM-154x300.png 154w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-24-at-4.18.39-PM.png 365w\" sizes=\"auto, (max-width: 154px) 100vw, 154px\" \/><br \/>\n<\/a>The code that makes this work is already done for you. Now you are ready to begin modifying and adding your own files.<\/li>\n<li>If for some reason you cannot find something such as the [Run] button, you can go to View menu that is on the top of your screen and select which part you wish to hide or show<br \/>\n<a href=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-9.13.04-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1723\" title=\"Screen shot 2011-09-27 at 9.13.04 AM\" src=\"http:\/\/www.elblender.com\/wordpress\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-9.13.04-AM-300x93.png\" alt=\"\" width=\"300\" height=\"93\" srcset=\"http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-9.13.04-AM-300x93.png 300w, http:\/\/blog.acarlstein.com\/wp-content\/uploads\/2011\/09\/Screen-shot-2011-09-27-at-9.13.04-AM.png 569w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>Check for the next part of this tutorial. We shall start\u00a0analyzing\u00a0the basic files that Xcode generates for your example to work.<\/p>\n<p><a title=\"iOS Programming \u2013 Part 2\" href=\"http:\/\/www.acarlstein.com\/?p=1727\">(iOS Programming &#8211; Part 2) Next &gt;<\/a><\/p>\n<p><strong>Notification<\/strong><\/p>\n<p>These examples are provided for educational purposes. Using this code is under your own responsibility and risk. The code and information is given \u2018as is\u2019. I do not take responsibilities of how they are used.<\/p>\n\n<script>\nvar zbPregResult = '0';\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>After finish my last project, Cupid-4-Stupid, for the Android Market, I decided to play around the iPhone\/iTouch. I have many books and tutorial at my disposal; however, most of them do not reflex the changes that Objective-C have being doing. I will be adding references as a work cities at the end of the posting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,514,149,527],"tags":[516,1315,151,152,1316,529,410,515],"class_list":["post-1697","post","type-post","status-publish","format-standard","hentry","category-programming","category-ios","category-objective-c","category-opengl","tag-apple","tag-ios","tag-iphone","tag-itouch","tag-opengl","tag-opengl-es","tag-programming-2","tag-xcode"],"_links":{"self":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts\/1697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1697"}],"version-history":[{"count":22,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts\/1697\/revisions"}],"predecessor-version":[{"id":1699,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=\/wp\/v2\/posts\/1697\/revisions\/1699"}],"wp:attachment":[{"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1697"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.acarlstein.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}