INFO1-CE9236 iOS App Development
http://oit2.scps.nyu.edu/~meretzkm/INFO1-CE9236/
mark.meretzky@nyu.edu

  1. Homework
    1. INFO1-CE9236 (Thursday) Section 2, Fall 2013
    2. INFO1-CE9704 (Saturday) Section 1, Spring 2011
  2. In-class examples: these constitute the two-semester course.
  3. Syllabus, instructor, catalog descriptions for INFO1-CE9236 and INFO1-CE9704.
  4. GitHub accounts for students.
  5. Setup: you will need an Intel Mac to do your homework. Is your Mac set up for this course?
  6. Setup at 7 East 12th Street, room 229: Overhead screen 1280 × 768, 60 Hertz, press POWER ON in the black cabinet and then PC. Wifi: guest501, get this week’s password from room 233. Room 233 has people who know what’s going on. OS X 10.8.5, Xcode 5.0.1, iOS 7.0. Xcode freezes: command-option-escape. Computer labs on campus have OS X 10.8.5, Xcode 5.0.2, iOS 6.1; use loginname nyuguest for iOS simulator. oitsupport@nyu.edu
  7. Documentation and portals
  8. Apple developer videos
  9. These courses parallel the instructor’s Android course.
  10. Google Maps API and examples, for people who don’t want to use MapKit
  11. Cocos2d: 2D game framework
  12. PhoneGap: HTML5 and Javascript.
  13. Data Mine: The New York City Data Mine has restaurant inspection results, etc. Traffic cams. Census Bureau. Solar Map.
  14. Meetup: New York iPhone Software Developers Meetup. Notes from the October 27, 2010 animation meetup.
  15. iPhone Boot Camp
  16. Certificate in iPhone and iPad App Development at SCPS. It requires INFO1-CE9786.
  17. Class photos

Spring 2014, INFO1-CE9236 Section 1 (Thursday)

  1. Thursday, February 6, 2014: up to ??? in objective.html in the in-class examples. Read the syllabus and grading policy. See how much homework there was last semester. Admire last semester’s class photo; soon we’ll have our own.

    Study objective.html and try the links in that file to Apple’s online documentation. Create bookmarks in your browser for NS (NextStep), UI (User Interface), and CG (Core Graphics; look under CGGeometry for the data type CGFloat and the structures CGPoint, CGSize, and CGRect). Finish reading objective.html and read ahead to Class and Hello so you won’t be seeing them for the first time when we do them in class on February 13.

    Put the application Xcode on your Intel Mac if you don’t already have it. The current version of Xcode (5.0.2, released on November, 11, 2013) requires at least version 10.8 (Mountain Lion) of OS X. Our classroom at 7 East 12th Street room 229 currently has Mac OS X 10.8.5 with Xcode 4.5.1 runing iOS 6.0. Use Xcode to create a project on your Macintosh Desktop like this one, but name it Feb13 (uppercase letter F, two lowercase lowercase, and the digits one, three) instead of Project. Insert some statements that create variables and call the function NSLog like the examples in objective.html and Project. Insert the new statements immediately before the return statement in the main function in the main.m file in the Supporting Files folder of your project.

    Create a GitHub account and email me its name, your NYU NetID, and your real name. (Your NetID is several lowercase letters followed by several digits; mine is meretzkm. Your NetID is not an uppercase N followed by lots of digits.) My email address is (mark.meretzky@nyu.edu). Look at your classmates’ accounts, and last semester’s accounts. In your GitHub account, create a repository named Feb13. Then upload your Feb13 project to your Feb3 repository. Here is my Feb14 repository I created on February 7, 2013. Click in the Feb14 folder and then on the main.m file.

    Your instructor would be happy to invite you to join the team for this class, thus saving you $99, if you give him your name, email address, NYU NetID, the name of your GitHub account, and the 40-hex-character identifier of your iPhone, iPad, or iPod Touch. Instructions for finding this identifier are in Register your device. I’m going to use the NYU NetID as the name of the “provisioning profile” that I create for you. The provisioning profile is one of the files you need to copy your apps onto your iPhone. Apple will send you an invitation to join and will send you an Apple ID. After you have joined the team, go here to see who else has joined the team (click on People), and go here to see your device and App ID (on the left, click on Devices and App IDs). See download.html. This offer is good from 9:30 p.m. EST on Thursday, February 6 until 9:30 p.m. EST on Saturday, February 8, 2014.

    Here’s a link to my Andoid course. You can hear it all in one day at Agile Las Vegas on Monday, June 2, 2014, or at QCon NY on Tuesday, June 10, 2014.

  2. Thursday, February 13, 2014:
  3. Thursday, February 20, 2014:
  4. Thursday, February 27, 2014:
  5. Thursday, March 6, 2014:
  6. Thursday, March 13, 2014:
  7. Thursday, March 27, 2014:
  8. Thursday, April 3, 2014:
  9. Thursday, April 10, 2014:
  10. Thursday, April 17, 2014:

Fall 2013, INFO1-CE9236 Section 2 (Thursday)

  1. Thursday, September 26, 2013: up to “Instance methods and class methods” in objective.html in the in-class examples. We also did Project. Read the syllabus and grading policy. See how much homework there was last semester. Admire our class photo. On October 17th, we’ll make the photo touch-sensitive.

    Study objective.html. Try the links in objective.html to Apple’s online documentation. Create bookmarks in your browser for NS (NextStep), UI (User Interface), and CG (Core Graphics; look under CGGeometry for the data type CGFloat and the structures CGPoint, CGSize, and CGRect). Finish reading objective.html and read ahead to Class and Hello so you won’t be seeing them for the first time when we do them in class on October 3.

    Put the application Xcode on your Intel Mac if you don’t already have it. The current version of Xcode (5.0, released on September, 18, 2013) requires at least version 10.8 (Mountain Lion) of OS X. Our classroom at 7 East 12th Street room 229 currently has Mac OS X 10.8.5 with Xcode 4.5.1 runing iOS 6.0. Use Xcode to create a project on your Macintosh Desktop like this one, but name it Oct3 (uppercase letter O, the other two letters lowercase, and the number three) instead of Project. Insert some statements that create variables and call the function NSLog like the examples in objective.html and Project. Insert the new statements immediately before the return statement in the main function in the main.m file in the Supporting Files folder of your project.

    Create a GitHub account and email me its name, your NYU NetID, and your real name. (Your NetID is several lowercase letters followed by several digits; mine is meretzkm.) My email address is (mark.meretzky@nyu.edu). Look at your classmates’ accounts, and last semester’s accounts. In your GitHub account, create a repository named Oct3. Then upload your Oct3 project to your Oct3 repository. Here is my Feb14 repository I created on February 7, 2013. Click in the Feb14 folder and then on the main.m file.

    Your instructor would be happy to invite you to join the team for this class, thus saving you $99, if you give him your name, email address, NYU NetID, the name of your GitHub account, and the 40-hex-character identifier of your iPhone, iPad, or iPod Touch. Instructions for finding this identifier are in Register your device. I’m going to use the NYU NetID as the name of the “provisioning profile” that I create for you. The provisioning profile is one of the files you need to copy your apps onto your iPhone. Apple will send you an invitation to join and will send you an Apple ID. After you have joined the team, go here to see who else has joined the team (click on People), and go here to see your device and App ID (on the left, click on Devices and App IDs). See download.html. This offer is good from 9:30 p.m. EDT on Thursday, September 26 until 9:30 p.m. EDT on Saturday, September 28, 2013.

    I’m teaching iOS and Android at QCon on November 14–15, 2013, so we have no class on Thursday, November 14. We will add a class on Thursday, December 19.

  2. Thursday, October 3, 2013: up to Hello. Memorize the two incantations, starting with the following. “The init method of the subclass always begins by calling the init method of the superclass.”

    Run the apps in Class and Hello and do the exercises, but don’t hand them in. Can you get the current price of IBM? Create a project named Oct10 that prints something interesting on the screen, and upload it to a GitHub repository named Oct10. Then look at the repositories of the other students in the class. Bring your NYU NetID (not the number that starts with an uppercase N). Read ahead to Internationalize and Japan.

  3. Thursday, October 10, 2013: up to Japan in the in-class examples. We also did Dictionary. Do the exercises in Hello and Japan, but don’t hand them in.

    Create a project named Oct17 and upload it to a GitHub repository named Oct17. The Oct17 project should display text and graphics (circles, rectangles, triangles, etc.), with a shadow. Internationalize it for at least one language other than English (note: Klingon does not have a two-letter ISO 639-1 code), and give it at least one icon and at least one launch image. (It’s okay if your icon is one of the stupid yellow icons I made, and it’s okay if your launch image is similarly unartistic.) Then look at the repositories of the other students in the class.

    The course will end as originally scheduled on Thursday, December 12th.

  4. Thursday, October 17, 2013: up to Animate in the in-class examples. To undo the transformations (translate, scale, rotate), see CGContextSaveGState and CGContextRestoreGState and let me know if they don’t work.

    Write and upload a touch-sensitive app named Oct24, maybe with animation. And why not an icon? Then click on the tip of each nose in the class photo. (See also the list under the photo.)

    We’ll have a presentation about winding numbers on October 24th. Here’s the flyer for the group at Stern.

    The student with the app in the app store will talk to us on November 21. His app is a tree map of Central Park, and they’re having a nature walk to promote it on Saturday, October 26, 2013 at 2:00 p.m., starting at the top of the Great Hill, Central Park West at 106th Street.

  5. Thursday, October 24, 2013: up to Button in the in-class examples. For Mike’s question about detecting which object was touched, see the new example Hit.

    On October 24th, we tried to run this project in class. We got the message “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1.” Here’s how I fixed it. In the Supporting Files folder in the Xcode Porject Navigator, I noticed that the PathTest-Prefix.pch file was listed in red. That means the file is missing from the project. When I copied the -Prefix.pch file from another project into this one, naming it PathTest-Prefix.pch, the filename changed from red to black. When I ran the project, I saw the app’s Line/Fill/Clear buttons.

    The coolest man who ever lived was Derek Flint. For example, he was the first person to have a ringtone. Write and upload an app named Oct31 for Mr. Flint to carry in his pocket, with background music or brief sound effects, buttons, and a swinging (or peeling) door.

  6. Thursday, October 31, 2013: up to Date Picker in the in-class examples, except that we skipped Page Control. Why is a button created with buttonWithType: rather than with the usual alloc and init like every other view? When you launch the Notification Center example on an iPhone or iPad, does it display the string “Unknown” when it first appears? Read ahead to view controllers to see what we’ll be doing next Thursday.

    Write and upload an app named Nov7 with lots of controls: buttons and segmented controls, sliders and date pickers. Audio and video a plus; you could even record audio. Would anyone volunteer to investigate how to record video?

    When adding a media file to your app (graphics, sound, video), follow the instructions in this project for adding the file to your project. Make sure you check the checkbox for “copy items into destiation group’s folder”. After you upload your project to GitHub, move it and all of its files to a different folder on your Mac. Then download the project from GitHub and see if you can run the downloaded copy.

  7. Thursday, November 7, 2013: up to L Train in the in-class examples. I got the Video example to work in iOS 7; the problem was that my video file was corrupted. Examples that are less than one month old are iOS 7; look for the date at the top of each .h and .m file. I really think you should do exercise #4 of Navigate (the “Go East” button) and exercise #2 of Modal (the “Done” button), but don’t hand them in.

    Please help me with three unsolved questions:

    1. In Text Field, what difference does it make whether textFieldShouldReturn: returns YES or NO?
    2. In Video, why do we see an echo of the status bar?
    3. In View Controller, why can’t we use edgesForExtendedLayout to prevent the view from growing to a height of 568 pairs of pixels and overlapping with the status bar?

    Write and upload an app named Nov21 with a navigation controller on top of a row of view controllers. No class on November 14th.

    Read About App Distribution in preparation for the November 21st talk by the student with the app in the app store. You can see him in this photo: red hair, beard, eyeglasses, white shirt.

  8. Thursday, November 21, 2013: up to Activity Indicator in the in-class examples. Nov21-master.zip has a navigation controller on top of a row of view controllers that display views with different images.

    Write and upload an app named Dec5 that does 60-times-per-second animation with a CADisplayLink in a view controller. See Pong and Pearls.

    No class on November 28th.
  9. Thursday, December 5, 2013: up to Goner in the in-class examples. Write and upload an app named Dec12 with a UITableViewController and a UITableView. See the Table View Programming Guide.

    Win a $500 raffle (there are four of them) by filling out the course evaluation at http://scps.nyu.edu/evaluate if you have not already done so.

  10. Thursday, December 12, 2013:

Spring 2011, X52.9704 Section 1

  1. Saturday, March 26, 2011: we did objective.html and hello in the in-class examples. Read the syllabus and grading policy. See how much homework X52.9705 had last semester. Put Xcode on your Intel Mac if you don’t already have it. Older versions of Xcode (for people with older versions of OS X) are available here under Downloads → Developer Tools. Create bookmarks in your browser for NS (NextStep) and UI (User Interface). Admire our class photo; next week we’ll make it touch-sensitive. My email is mark.meretzky@nyu.edu

    objective.html reviews the Objective-C language. date creates a class, and property changes the instance variables of a class into properties. rules.html summarizes the rules for the objects in an app. Memorize the following incantation. “The init method of the subclass always begins by calling the init method of the superclass. The dealloc method of the subclass always ends by calling the dealloc method of the superclass.”

    Read download.html. Your instructor would be happy to invite you to join the team if you give him your name and email address. He will also register your device (iPhone, iPad, iPod Touch) if you give him its 40-hex-character identifier (see iTunes in ¶ 6), and will create an App ID for you. After you have joined the team, go here to see who else has joined the team (click on People), and go here to see your device and App ID (on the left, click on Devices and App IDs).

    Read zip.html. Get your loginname (same as your NYU NetID) and secret password, if you don’t already have them, for our Fedora Linux server oit2.scps.nyu.edu. If you couldn’t get a secret password from start.nyu.edu, contact the accounts office. One way to conact them is by calling (212) 998-3333 option 1. Make it clear to the accounts office that you are trying to get a password for oit2.scps.nyu.edu, not for Blackboard. (They think everyone is a Blackboard user.)

    The following examples constitute a précis of iPhone Part I X52.9236.

    1. HelloWorld
    2. Japan: graphics
    3. Touch: touch the screen
    4. Animate: animation
    5. Button: the target/action pattern
    6. PLViewController. In the previous example, the application delegate created the view. In this example, the application delegate creates a view controller, and the view controller creates the view.
    7. Nib: create objects using the Interface Builder by dragging them off a pallet.

    Start playing with the examples in Still-life 2D graphics. Please email me an example of the web service you want to do.

  2. Saturday, April 2, 2011: up to the transformations in Manhattan. Click on the tip of each nose in the class photo. Can you find the rule about “An instance variable that points to an object must be retained and released” anywhere in Apple’s online documentation? Nothing to hand in this week. On April 9, we are at 48 Cooper Square, room 209.
  3. Saturday, April 9, 2011: up to the end of Tap, but we skipped Array. Pinch Gaddafi.
  4. Saturday, April 16, 2011: up to Distance. Nothing to hand in this week.
  5. Saturday, April 23, 2011: Still unknown: why the map and sound recording examples didn’t work in iOS 4.3. Both of them work in iOS 4.1. Any ideas?
  6. Saturday, April 30, 2011: Finished view controllers and sqlite. I fixed the roundoff-error in distance: the second call to sqlite3_mprintf in the getZipCodes method of the Model had to say %.15g to avoid rounding off.
  7. Saturday, May 7, 2011: up to the OpenGL ES project template in Xcode. We’ll do more Xcode and then animations.
  8. Saturday, May 14, 2011:

Fall 2010, X52.9704 Section 1 (Wednesday)

  1. Wednesday, October 6, 2010: up to Map in the in-class examples. Read the syllabus and grading policy. See how much homework X52.9236 had last semester. Put Xcode on your Intel Mac if you don’t already have it. Older versions of Xcode (for people with older versions of OS X) are available here under Downloads → Developer Tools. Create bookmarks in your browser for NS (NextStep) and UI (User Interface). Admire last semester’s class photo; next week we’ll have our own.

    objective.html reviews the Objective-C language. rules.html summarizes the rules for the objects in an app. Memorize the following incantation. “The init method of the subclass always begins by calling the init method of the superclass. The dealloc method of the subclass always ends by calling the dealloc method of the superclass.”

    Read download.html. Your instructor would be happy to invite you to join the team if you give him your name and email address. He will also register your device (iPhone, iPad, iPod Touch) if you give him its 40-hex-character identifier, and will create an App ID for you. After you have joined the team, go here to see who else has joined the team (click on People), and go here to see your device and App ID (on the left, click on Devices and App IDs).

    Read zip.html. Get your loginname (same as your NYU NetID) and secret password, if you don’t already have them, for our Fedora Linux server oit2.scps.nyu.edu. If you couldn’t get a secret password from start.nyu.edu, contact the accounts office. One way to conact them is by calling (212) 998-3333 option 1. Make it clear to the accounts office that you are trying to get a password for oit2.scps.nyu.edu, not for Blackboard. (They think everyone is a Blackboard user.)

    The following examples constitute a précis of iPhone Part I X52.9236.

    1. HelloWorld
    2. Japan: graphics
    3. Touch: touch the screen
    4. Animate: animation
    5. Button: the target/action pattern
    6. PLViewController. In the previous example, the application delegate created the view. In this example, the application delegate creates a view controller, and the view controller creates the view.
    7. Nib: create objects using the Interface Builder by dragging them off a pallet.

    Do the exercises in Map. Extra credit: instead of giving the MKAnnotationView an image such as nyu.png, could you give the MKAnnotationView a drawRect: method that is called whenever the MKAnnotationView needs to be drawn? Could the drawRect: draw a different picture depending on the location of the annotation? Another extra credit: can the overlay view be more elaborate than a solid colored region? How about a solid colored region with a border in another color? Hint: class MKPolyginView is derived from class MKOverlayPathView. (We did paths here.)

  2. Wednesday, October 13, 2010: up to Attitude, except that I forgot to mention the “first responder” methods in Motion. Click on the tip of each person’s nose in the class photo. Keep working on the map homeworks. The New York Times review of Euclid’s Elements suggests turning it into an app. This app from last semester lets you draw a line with your finger.

    Check it out: Android gives you the area and pressure of a finger touch. iPhone gives you only the location of the touch.

  3. Wednesday, October 20, 2010: up to the end of Attitude in the map section of the in-class examples. Could someone please tell me if Attitude actually works on an iPhone 4? Does the black line point in the same direction? Does the black line appear at all? Here is one of the Map.zip files we fixed in class. We also did Objective-C and C++.

    iPhone Animation meetup during the same time slot as next Wednesday’s class. Maybe I can convince some of my Thursday night iPhone Part I students to go.

    Research question. How can the shellscript at the bottom of this page run sftp non-interactively with the -b option on a Mac, eliminating the need for expect? Exactly how would we use ssh-keygen (or whatever) to allow sftp to connect to oit2.scps.nyu.edu?

    Research question. Could we run the shellscript from the Xcode Organizer, even though the shellscript require one command line argument (giving the name of the folder that holds the project)?

    Try to get the Triangle program to run on your Mac, even though it isn’t an iPhone app.

  4. Wednesday, October 27, 2010: Animation meetup notes.
  5. Wednesday, November 3, 2010: there’s a simple solution to my iOS 4.0 vs. iOS 4.1 problem with OpenGL. If you have 4.1, please create an iPhone project named Project, selecting
    Choose a template for your new project: OpenGL ES Application
    Do not make any change to this project that you get by default. Save it in a .zip file and email it to me. Do this after 12:45 p.m. on Saturday, November 6th, when I get out of my Android class. Thanks.

    Can you do two different animations with the same object at the same time? Does it work for explicit animations like the opacity and transform animations here? Does it work for implicit animations like the ones here?

    Can you find the official specs for the iPhone icon jiggle? How many hertz (cycles per second), how many degrees of rotation, does the center of the icon move, and if so, along what path does it move?

    For this remote database thing, can you point me in the right direction? Should I be looking at class NSURL in this document?

    HTML 5 conference on Tuesday, November 9th.

  6. Wednesday, November 10, 2010: Read the Xcode template for an OpenGL ES project. Can you modify this program to make a stop sign instead of a square? Can you modify this program to draw something more interesting than one triangle? Can you run this program?
  7. Wednesday, November 17, 2010: Here are the four groups of extensions we can make to the app that uploads an image file to a server.
    1. Configure the name of the server and the 16-bit TCP/IP port number in the Settings app, and inform the app when the settings have been changed. See Configuring a Settings Page.
    2. Let the app get the imagesfrom the iPhone camera or photo albums.
    3. Find out what the delegate of the connection object could do for us. See the “delegate methods” of the delegate of an NSURLConnection object.
    4. Instead of relying on Safari to display the shared image files, the app could download the image files and display them itself, with appropriate ruffles and flourishes (e.g., UIViewAnimationOptionTransitionCurlUp).
    My torus program is debugged.
  8. Wednesday, November 24, 2010: No homework.
  9. Wednesday, December 1, 2010: What projection is needed for a map printed on a sphere? Google Maps gives us the Mercator projection by default. Can we get the desired projection from Google Maps? Here is Google’s documentation for creating a custom projection using JavaScript.

    Is there any reason why tga format is the best format for texture files? How can we use a different format (png, jpg, etc.) instead? Find a beautiful image file of the Earth (or another planet) that we can print on a sphere. Anything we can use here?

    Is there an industry-standard layer we can put on top of OpenGL ES to group primitive objects into higher-order objects and move them together?

  10. Wednesday, December 8, 2010:

Class photos

  1. Part I INFO1-CE9236
    1. Fall 2013 Section 2 (Thursday)
    2. Summer 2013 Section 1 (Thursday)
    3. Spring 2013 Section 1 (Thursday)
    4. Fall 2012 Section 1 (Thursday)
    5. Summer 2012 Section 1 (Thursday)
    6. Spring 2012 Section 1 (Thursday)
    7. Fall 2011 Section 1 (Thursday)
    8. Summer 2011 Section 1 (Thursday)
    9. Spring 2011 Section 1 (Thursday)
    10. Fall 2010 Section 1 (Thursday)
    11. Summer 2010 Section 1 (Thursday) and Section 2 (Saturday)
    12. Spring 2010 Section 1 (Thursday)
  2. Part II INFO1-CE9704
    1. Spring 2011 Section 1 (Saturday)
    2. Fall 2010 Section 1 (Wednesday)