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 using my array for the plist file count defined above but i get an error saying its undeclared in that function because i declared it in the viewDidLoad. so do i need to declare it again? – i had to dump the person object into an array and then get it back out again.

One Reply to “Presence 2 Stanford CS193P Strategy”

  1. Ok, here is the CONCEPTUAL Solution to my problem.

    1. Get the filepath to your plist file (datasource).
    2. Check if it exists & create Array for its contents, so you can count its items.
    3. Create another Array to put usernames in (aside from your Person Object).
    4. Now create for loop with count to cycle thru and EACH TIME do this:
    – create a dictionary containing the username at each loop position
    – create a new person class object for each new loop position
    – add the name key from dictionary to newly created person class obj
    – add the Person Class’ displayName to the Array for usernames
    5. Now you can add the usernames Array count to your numberOfRowsInSection and usernames Array objectAtIndex:indexPath.row to your cell.text

    VOILA…

    This means that once you have your Array with File Path, (which as Chris Garman cleared up for me, must be alloc/init outside of the loop, or else youre erasing your new

Leave a Reply