Inherits from OCRBaseDetailTableViewController : UITableViewController
Conforms to NSFetchedResultsControllerDelegate
Declared in OCRResumeJobsTableViewController.h
OCRResumeJobsTableViewController.m

Overview

Manage the UITableView representing jobs objects.

Properties

jobsFetchedResultsController

Reference to the fetchResultsController.

@property (nonatomic, strong) NSFetchedResultsController *jobsFetchedResultsController

Declared In

OCRResumeJobsTableViewController.m

noSelectionView

Reference to the noSelection view, which is displayed when there is no object to manage, or a containing parent object is deleted.

@property (strong, nonatomic) OCRNoSelectionViewController *noSelectionView

Declared In

OCRResumeJobsTableViewController.m

tableView

IBOutlet to the tableView.

@property (strong, nonatomic) IBOutlet UITableView *tableView

Declared In

OCRResumeJobsTableViewController.h

Instance Methods

addJob:

Add a Jobs entity for this resume.

- (void)addJob:(NSString *)jobName

Parameters

jobName

The name to assign to the new jobs entity.

Declared In

OCRResumeJobsTableViewController.m

configureDefaultNavBar

Configure the default items for the navigation bar.

- (void)configureDefaultNavBar

Declared In

OCRResumeJobsTableViewController.m

configureFieldsForEditing:

Enables or disables all the UI text fields for editing.

- (void)configureFieldsForEditing:(BOOL)editable

Parameters

editable

A BOOL that determines whether the fields should be enabled for editing - or not.

Discussion

As a resume app, a major Use Case is the user sharing his/her experience by passing the iOS device around. To avoid accidently changing information, the app defaults to non-editable and there is an explicit Edit button when the user wants to change information. This method sets the enabled state as appropriate and also changes the background color to make “edit mode” more visually distinct.

Declared In

OCRResumeJobsTableViewController.m

configureUIForEditing:

Set the UI for for editing enabled or disabled.

- (void)configureUIForEditing:(BOOL)isEditingMode

Parameters

isEditingMode

YES if we are going into edit mode, NO otherwise.

Discussion

Called when the user presses the Edit, Done, or Cancel buttons.

Declared In

OCRResumeJobsTableViewController.m

configureView

Configure the view items.

- (void)configureView

Declared In

OCRResumeJobsTableViewController.m

didPressAddButton:

Invoked when the user taps the ‘+’ button in the section header

- (IBAction)didPressAddButton:(id)sender

Parameters

sender

The UIButton object sending the message.

Declared In

OCRResumeJobsTableViewController.m

didPressCancelButton

Invoked when the user taps the Cancel button.

- (void)didPressCancelButton

Discussion

  • End the undo group on the NSManagedObjectContext.
  • If the undoManager has changes it canUndo, undo them.
  • Cleanup the undoManager.
  • Reset the UI to its default state.

Declared In

OCRResumeJobsTableViewController.m

jobsFetchedResultsController

Singleton method to retrieve the jobsFetchedResultsController, instantiating it if necessary.

- (NSFetchedResultsController *)jobsFetchedResultsController

Return Value

An initialized NSFetchedResultsController.

Declared In

OCRResumeJobsTableViewController.m

loadViewFromSelectedObject

Update the data fields of the view - the resume.

- (void)loadViewFromSelectedObject

Declared In

OCRResumeJobsTableViewController.m

numberOfSectionsInTableView:

Asks the data source to return the number of sections in the table view.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

Parameters

tableView

An object representing the table view requesting this information.

Return Value

The number of sections in tableView. The default value is 1.

Declared In

OCRResumeJobsTableViewController.m

packageWasDeleted:

Update internal state of the view controller when a package has been deleted.

- (void)packageWasDeleted:(NSNotification *)aNotification

Parameters

aNotification

The NSNotification object associated with the event.

Discussion

Invoked by notification posted by OCRPackagesViewController when it performs a package deletion.

Declared In

OCRResumeJobsTableViewController.m

populateFieldsFromSelectedObject

Populate the user interface fields with data from the object we are managing.

- (void)populateFieldsFromSelectedObject

Declared In

OCRResumeJobsTableViewController.m

prepareForSegue:sender:

Notifies the view controller that a segue is about to be performed.

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Parameters

segue

The segue object containing information about the view controllers involved in the segue.

sender

The object that initiated the segue. In this case, we set sender to be the Job or Education object represented by the selected tableViewCell. based on which control (or other object) initiated the segue.

Discussion

The default implementation of this method does nothing. Your view controller overrides this method when it needs to pass relevant data to the new view controller. The segue object describes the transition and includes references to both view controllers involved in the segue.

Because segues can be triggered from multiple sources, you can use the information in the segue and sender parameters to disambiguate between different logical paths in your app. For example, if the segue originated from a table view, the sender parameter would identify the table view cell that the user tapped. You could use that information to set the data on the destination view controller.

Declared In

OCRResumeJobsTableViewController.m

reloadFetchedResults:

Reloads the fetched results

- (void)reloadFetchedResults:(NSNotification *)aNote

Parameters

aNote

the NSNotification describing the changes (ignored)

Discussion

Invoked by notification when the underlying data objects may have changed

Declared In

OCRResumeJobsTableViewController.m

setEditing:animated:

Sets whether the view controller shows an editable view.

- (void)setEditing:(BOOL)editing animated:(BOOL)animated

Parameters

editing

If YES, the view controller should display an editable view; otherwise, NO. If YES and one of the custom views of the navigationItem property is set to the value returned by the editButtonItem method, the associated navigation controller displays a Done button; otherwise, an Edit button.

animated

If YES, animates the transition; otherwise, does not.

Discussion

Subclasses that use an edit-done button must override this method to change their view to an editable state if editing is YES and a non-editable state if it is NO. This method should invoke super’s implementation before updating its view.

Declared In

OCRResumeJobsTableViewController.m

tableView:canEditRowAtIndexPath:

Asks the data source to verify that the given row is editable.

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The table-view object requesting this information.

indexPath

An index path locating a row in tableView.

Return Value

YES to allow editing, NO otherwise,

Declared In

OCRResumeJobsTableViewController.m

tableView:cellForRowAtIndexPath:

Asks the data source for a cell to insert in a particular location of the table view.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

A table-view object requesting the cell.

indexPath

An index path locating a row in tableView.

Return Value

An object inheriting from UITableViewCell that the table view can use for the specified row. An assertion is raised if you return nil.

Discussion

The returned UITableViewCell object is frequently one that the application reuses for performance reasons. You should fetch a previously created cell object that is marked for reuse by sending a dequeueReusableCellWithIdentifier: message to tableView. Various attributes of a table cell are set automatically based on whether the cell is a separator and on information the data source provides, such as for accessory views and editing controls.

Declared In

OCRResumeJobsTableViewController.m

tableView:commitEditingStyle:forRowAtIndexPath:

Asks the data source to commit the insertion or deletion of a specified row in the receiver.

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The table-view object requesting the insertion or deletion.

editingStyle

The cell editing style corresponding to a insertion or deletion requested for the row specified by indexPath. Possible editing styles are UITableViewCellEditingStyleInsert or UITableViewCellEditingStyleDelete.

indexPath

An index path locating the row in tableView.

Discussion

When users tap the insertion (green plus) control or Delete button associated with a UITableViewCell object in the table view, the table view sends this message to the data source, asking it to commit the change. (If the user taps the deletion (red minus) control, the table view then displays the Delete button to get confirmation.) The data source commits the insertion or deletion by invoking the UITableView methods insertRowsAtIndexPaths:withRowAnimation: or deleteRowsAtIndexPaths:withRowAnimation:, as appropriate.

To enable the swipe-to-delete feature of table views (wherein a user swipes horizontally across a row to display a Delete button), you must implement this method.

You should not call setEditing:animated: within an implementation of this method. If for some reason you must, invoke it after a delay by using the performSelector:withObject:afterDelay: method.

Declared In

OCRResumeJobsTableViewController.m

tableView:didSelectRowAtIndexPath:

Tells the delegate that the specified row is now selected.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

A table-view object informing the delegate about the new row selection.

indexPath

An index path locating the new selected row in tableView.

Discussion

The delegate handles selections in this method. One of the things it can do is exclusively assign the check-mark image (UITableViewCellAccessoryCheckmark) to one row in a section (radio-list style). This method isn’t called when the editing property of the table is set to YES (that is, the table view is in editing mode). See “Managing Selections” in Table View Programming Guide for iOS for further information (and code examples) related to this method.

Declared In

OCRResumeJobsTableViewController.m

tableView:heightForHeaderInSection:

Asks the delegate for the height to use for the header of a particular section.

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

Parameters

tableView

The table-view object requesting this information.

section

An index number identifying a section of tableView .

Return Value

A nonnegative floating-point value that specifies the height (in points) of the header for section.

Discussion

This method allows the delegate to specify section headers with varying heights.

Declared In

OCRResumeJobsTableViewController.m

tableView:jobsCellForIndexPath:

Configure a jobs cell for the resume.

- (UITableViewCell *)tableView:(UITableView *)tableView jobsCellForIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

A table-view object requesting the cell.

indexPath

The indexPath of the section and row the cell represents.

Return Value

A configured table view cell.

Declared In

OCRResumeJobsTableViewController.m

tableView:moveRowAtIndexPath:toIndexPath:

Tells the data source to move a row at a specific location in the table view to another location.

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath

Parameters

tableView

The table-view object requesting this action.

fromIndexPath

An index path locating the row to be moved in tableView.

toIndexPath

An index path locating the row in tableView that is the destination of the move.

Discussion

The UITableView object sends this message to the data source when the user presses the reorder control in fromRow.

Declared In

OCRResumeJobsTableViewController.m

tableView:numberOfRowsInSection:

Tells the data source to return the number of rows in a given section of a table view.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

Parameters

tableView

The table-view object requesting this information.

section

An index number identifying a section in tableView.

Return Value

The number of rows in section.

Declared In

OCRResumeJobsTableViewController.m

tableView:viewForHeaderInSection:

Asks the delegate for a view object to display in the header of the specified section of the table view.

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

Parameters

tableView

The table-view object asking for the view object.

section

An index number identifying a section of tableView .

Return Value

A view object to be displayed in the header of section .

Discussion

The returned object can be a UILabel or UIImageView object, as well as a custom view. This method only works correctly when tableView:heightForHeaderInSection: is also implemented.

Declared In

OCRResumeJobsTableViewController.m

updateSelectedObjectFromUI

Update the selected object’s properties from the view’s data fields

- (void)updateSelectedObjectFromUI

Declared In

OCRResumeJobsTableViewController.m

viewDidLoad

Called after the controller’s view is loaded into memory.

- (void)viewDidLoad

Discussion

This method is called after the view controller has loaded its view hierarchy into memory. This method is called regardless of whether the view hierarchy was loaded from a nib file or created programmatically in the loadView method. You usually override this method to perform additional initialization on views that were loaded from nib files.

Declared In

OCRResumeJobsTableViewController.m

viewWillAppear:

Notifies the view controller that its view is about to be added to a view hierarchy.

- (void)viewWillAppear:(BOOL)animated

Parameters

animated

If YES, the view is being added to the window using an animation.

Discussion

This method is called before the receiver’s view is about to be added to a view hierarchy and before any animations are configured for showing the view. You can override this method to perform custom tasks associated with displaying the view. For example, you might use this method to change the orientation or style of the status bar to coordinate with the orientation or style of the view being presented. If you override this method, you must call super at some point in your implementation.

For more information about the how views are added to view hierarchies by a view controller, and the sequence of messages that occur, see “Responding to Display-Related Notifications”.

Note If a view controller is presented by a view controller inside of a popover, this method is not invoked on the presenting view controller after the presented controller is dismissed.

Declared In

OCRResumeJobsTableViewController.m