Hammy Hammy - 1 year ago 46
iOS Question

Assistance with Schedule App

I am currently constructing a School schedule app as a beginner project and I could use some help with the final steps. My app essentially consists of two tableview controllers. THe first table contains the student's block schedule (My Schedule). My schedule's table has a dictionary and has keys for each block the student could fill. The second contains a list of all the potential classes a student could take (Class List). All the courses in class list are stored across several arrays. If the student wants to edit their schedule they press an edit button on My Schedule, this produces a "Change" button on every cell in the schedule. What I would like is to create an IBAction that would register the key of the cell that was pressed. Then the app would go over to class list and display all the classes. The user would select a new course and the app would take that course and use it to replace the course in the block that was "changed".

I guess what I really need to know how to do is:

  • register which cell was chosen

  • programmatically segue between view controllers

  • replace a value in a dictionary for a particular key

I realize that this is a lot of info and I apologize if it is confusing or I did not provide enough information. If you would like to see some of my code or need some clarification I would be more than happy to give it.

Answer Source

You can trigger a UIViewController's segue by invoking

[self performSegueWithIdentifier:@"SomeSegueIdentifierProbablySetInIB" sender:self];