Fall (2011-12) quarter's lectures are available on iTunesU.
Demo posted with comments inserted which will walk you through the demo step by step.
The entire demo will be posted after Lecture 18.
Lecture version of demo and "plus" version both posted.
The plus version lets you turn the faucet on and off in the action sheet, gets the camera's image in a popover (instead of modal view controller), and lets you tilt the device to move the things in the sink toward the center of the earth (using Core Motion).
Posted Kitchen Sink.
Added a few bar buttons to show off different modal transition and presentation styles. You won't really appreciate the "Page" presentation style unless you rotate the iPad to landscape mode (that's when it is different than the default presentation style).
We'll continue this demo on Thursday.
The attached assignment is due next Wednesday.
Code posted. Added a lot of comments (which hopefully didn't break anything!). If you start at viewWillAppear: in PhotographersTableViewController.m, you'll see that there are comments that are "numbered steps" approximating the flow through the demo. Hopefully that'll help you recreate in your minds the concepts touched upon at each stage of the demo.
Two things were added to the code after lecture: a prepareForSegue:sender: for the ImageViewController transition and also a save of the document where the database is loaded up (not having this would probably work fine because of UIManagedDocument's autosaving, but it's more correct to do this explicit save when we update a Core Data database).
Added a couple of slides to show how to create a category .m and .h.
As mentioned in lecture, I updated the slide about search path directory lookup to use the NSFileManager url-based method instead (slide 8).
This week's assignment is due next Wednesday, so you have a couple of extra days to work on it. You know all you need to know to do this assignment, though this one explicitly requires you to use the documentation to figure out how to do one of its required tasks (the filesystem caching). Having said that, there will be some discussion in Thursday's lecture about your application's sandbox which will be relevant to that, so you might want to leave the filesystem cache feature until last and work on everything else first.
This lecture also briefly covers UITabBarController and UINavigationItem.
Code from in-class demo posted.
Another version, with sections in the table view (and which works on iPhone), also posted. This was originally going to also push an MVC to view the photo, but we'll leave that up to you in your homework. :)
That homework, by the way, is due next Monday. Don't leave it to the last minute!
There are two versions of today's demo attached. The first is exactly what we did during lecture. You will have to integrate this into your assignment 3 solution to make it work (this will be great experience). There is a README in the .zip which will guide you through this process.
The second fixes a problem we didn't have time to address in lecture (multiple popovers) and adds support for deleting a row from the table view (just for fun). It also describes how to make this extension work in your iPhone storyboard as well. There is a separate README for these changes.
Posting code this way is much more perilous than just posting the whole project, so if you run into any problems, please report them so that we can fix and re-post the code.
The attached homework is due by the end of the day next Monday.
You know everything you need to do your assignment 3, so get to it (it is due next Monday).
Demo code (Psychologist) posted.
A second version (Psychologist with Dr Pill) is also posted and is described below.
YOU DO NOT NEED TO LOOK AT THIS VERSION TO DO YOUR HOMEWORK.
The Dr. Pill part was implemented using Replace (Detail) segues (as opposed to Push segues on the iPhone). No code change is required to do this (just create the Replace segues and give them the proper identifiers), EXCEPT for the fact that the split view bar button item must be transferred to the replacement view controller instance.
This transfer code can be found in prepareForSegue:sender:. Note that at the time prepareForSegue:sender: is happening, the destination view controller's outlets are not set up (specifically, the toolbar outlet), so a drop of code has to be added to HappinessViewController's viewDidLoad method to add the bar button item later (viewDidLoad is always called AFTER all outlets are set up--we'll be covering this View Controller Lifecycle method in lecture on Thursday).
Don't worry too much about the transfer code. For your homework, you will not be using Replace segues (just use target/action like Dr. Freud does).
The "Go to Dr. Pill Website" button was also added to the Dr. Pill version by simply creating a Popover segue to the DrPillWebsiteViewController scene. No code is necessary to make this work. You will also NOT need to use Popovers for your homework.
Demo code (for both demos) is posted!
A few people asked after class "how would you implement that Go to the Website" button? I've added that to Psychologist as a bonus! All it requires is a new, very simple View Controller (found in the Bonus group in the Navigator) to display the website and a segue from that button.
We also covered Autorotation and View initialization today.
As will always be the case with Tuesday lectures, you do not need any information from this lecture to do the assignment which is due the next day.
Code from today's lecture posted. A few comments have been sprinkled through it.
We still have two things left to do: 1. delegate the View's "data" (it's smileyness) and 2. add a gesture recognizer to modify our Model (the happiness). We'll do that on Thursday.
You do not need any information from today's slides (about Views) to do your second homework assignment, however, you will likely want to incorporate code from today's demo (attached as CalculatorBrain.[mh]) into your Calculator project.
The Friday section this week is about Source Control.
Welcome to CS193p for Fall 2011!