Presence2 CLEARED Topics CS193P iPhone

1. Why is Person *twit = [Person *twit]alloc init] yield local declaration error hides instance variable, but twit = [Person *twit]alloc init] works fine? Because Person *object = is used to declare the object for the first time.  So if you call this line in your implementation code, it will give that warning.  Whereas object = works fine because youre just alloc/initing an object after it has been declared in the h file…it must have been declared in the h file or in the imported Class Object File for it to work. 2. NSIndex & indexPath.row knows to get more elements in the array because we passed it a value for… Read More

Continue Reading

Presence 2 Stanford CS193P Strategy

CONCEPTUALLY speaking, we must read the dictionary objects, therefore getting the users name and use it to: 1. populate our Person Object 2. get the count value to set the number of Rows in Section 3. set the cell values to the names of these guys. So far Ive: 1. gotten the filepath 2. check if exists and create array for count 3. initwithdictionary with object@index:count 4. create Person Class Instance alloc/init 5. set my Persons displayName, userName & imageURL to the data from the dictionary on twitter via fetchusername. 6. now i have a person object with 3 usernames. i need the count to set the number of rowsinsection. i tried… Read More

Continue Reading

Memory Management Stanford CS193P iPhone Dev

Im not so clear on memory management; i understand what you create you must release, ok, but when?!  Because i just saw the MyTabBar example which creates ViewControllers, 3 of them i think, programatically, and a few lines down in the same m file, the delegate, the controllers get released.  Release means they get destroyed right?  I guess im not understanding conceptually what actually happens because to me, if you create in line 10 and release in line 20, even saying it sounds stupid to me, but its what i see, the user wont have time to use it :). Or is it because they get created, then added to… Read More

Continue Reading

View Controllers Stanford CS193P iPhone Dev

From looking at the MyTabBar app from Lecture 7 you can see that ViewControllers can be created with IB or programatically, like many other things in Xcode/IB.  The important thing is that in IB its not flexible; the way i see it if you create it in IB youre pretty much stuck with the design but in Xcode you can add things based on variables you get from the user or a data source.  EXAMPLE: 1. I went thru a tutorial from LittleComputers.net where we created a tabBarController with 2 tabs and later on added a NavigationController to one of the tabs.  Basically i dragged a tabcontroller from the IB… Read More

Continue Reading

Presence1 CS193P Stanford iPhone Dev

This was a great assignment for me.  I was able to get the PersonListViewController up and running.  I started by: a) Adding the navigationController ivar in the delegate file (h) and adding its view to the window (m) as well as releasing it in dealloc.  Remember its EITHER OR. You EITHER add the nav or tab or table VIEWCONTROLLER as a CONTROL in the XIB FILE. OR you add it in code, by ALLOC/INITING it in the Class File. b) then i added the IBAction in the PersonListViewController (h) and implementing that method (m) by instantiating the PersonDetailViewController, pushing it to the stack and releasing it.  Creating in my mind… Read More

Continue Reading

Stanford Assignment 3 HelloPoly: 1 Control/Multiple Actions

I should have known this from my experience in Flash!  The solution to why it only draws the first polygon is that the same buttons, Increase and Decrease, required multiple, in this case 2, actions, not just one.  Basically you need to define another method, inside the polygonview, which calls setNeedsDispaly.  And hook up the same buttons in the nib file to that method.

Continue Reading