Inherits from OCRBaseDetailViewController : UIViewController
Conforms to NSFetchedResultsControllerDelegate
OCRDetailViewProtocol
UIPopoverPresentationControllerDelegate
UIScrollViewDelegate
UISplitViewControllerDelegate
UITableViewDataSource
UITableViewDelegate
UITextFieldDelegate
UITextViewDelegate
Declared in OCRResumeJobsDetailViewController.h
OCRResumeJobsDetailViewController.m

Tasks

Other Methods

Other Methods

Extension Methods

Properties

accFetchedResultsController

Reference to the fetchResultsController.

@property (nonatomic, strong) NSFetchedResultsController *accFetchedResultsController

Declared In

OCRResumeJobsDetailViewController.m

contentView

IBOutler to the content view.

@property (weak, nonatomic) IBOutlet UIView *contentView

Declared In

OCRResumeJobsDetailViewController.h

datePickerController

Reference to the date picker view controller.

@property (nonatomic, strong) OCRDatePickerViewController *datePickerController

Discussion

We keep a reference so we can dismiss it in horizontal compact size, where it is presented as a modal.

Declared In

OCRResumeJobsDetailViewController.m

infoButton

IBOutlet to the infoButton.

@property (weak, nonatomic) IBOutlet UIButton *infoButton

Declared In

OCRResumeJobsDetailViewController.h

jobCity

IBOutlet to job’s city.

@property (weak, nonatomic) IBOutlet UITextField *jobCity

Declared In

OCRResumeJobsDetailViewController.h

jobEndDate

IBOutlet to the job’s end date.

@property (weak, nonatomic) IBOutlet UITextField *jobEndDate

Declared In

OCRResumeJobsDetailViewController.h

jobName

IBOutlet to the name of the Job.

@property (weak, nonatomic) IBOutlet UITextField *jobName

Declared In

OCRResumeJobsDetailViewController.h

jobStartDate

IBOutlet to the job’s start date.

@property (weak, nonatomic) IBOutlet UITextField *jobStartDate

Declared In

OCRResumeJobsDetailViewController.h

jobState

IBOutlet to the job’s state.

@property (weak, nonatomic) IBOutlet UITextField *jobState

Declared In

OCRResumeJobsDetailViewController.h

jobSummary

IBOutlet to the job’s summary.

@property (weak, nonatomic) IBOutlet UITextView *jobSummary

Declared In

OCRResumeJobsDetailViewController.h

jobTitle

IBOutlet to the title of the job.

@property (weak, nonatomic) IBOutlet UITextField *jobTitle

Declared In

OCRResumeJobsDetailViewController.h

jobUri

IBOutlet to the job’s uri text field.

@property (weak, nonatomic) IBOutlet UITextField *jobUri

Declared In

OCRResumeJobsDetailViewController.h

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

OCRResumeJobsDetailViewController.m

scrollView

IBOutlet to the scroll view.

@property (weak, nonatomic) IBOutlet UIScrollView *scrollView

Declared In

OCRResumeJobsDetailViewController.h

tableHeaderView

IBOutlet to the tableHeaderView.

@property (weak, nonatomic) IBOutlet UIView *tableHeaderView

Declared In

OCRResumeJobsDetailViewController.h

tableView

IBOutlet to the tableView.

@property (weak, nonatomic) IBOutlet UITableView *tableView

Declared In

OCRResumeJobsDetailViewController.h

Instance Methods

accFetchedResultsController

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

- (NSFetchedResultsController *)accFetchedResultsController

Return Value

An initialized NSFetchedResultsController.

Declared In

OCRResumeJobsDetailViewController.m

adaptivePresentationStyleForPresentationController:

Asks the delegate for the new presentation style to use.

- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller

Parameters

controller

The presentation controller that is managing the size change. Use this object to retrieve the view controllers involved in the presentation.

Return Value

The new presentation style, which must be either UIModalPresentationFullScreen or UIModalPresentationOverFullScreen.

Discussion

The presentation controller calls this method when the app is about to change to a horizontally compact environment. Use this method to indicate that you want the presented view controller to transition to one of the full-screen presentation styles.

If you do not implement this method or return any style other than UIModalPresentationFullScreen or UIModalPresentationOverFullScreen, the presentation controller adjusts the presentation style to the UIModalPresentationFullScreen style.

Declared In

OCRResumeJobsDetailViewController.m

addAccomplishment:

Add an Accomplishments entity for this resume.

- (void)addAccomplishment:(NSString *)accomplishmentName

Parameters

accomplishmentName

The name to assign to the new entity.

Declared In

OCRResumeJobsDetailViewController.m

configureDefaultNavBar

Configure the default items for the navigation bar.

- (void)configureDefaultNavBar

Declared In

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.m

configureView

Configure the view items.

- (void)configureView

Declared In

OCRResumeJobsDetailViewController.m

datePickerDidChangeDate:

Called by the datePicker when the user changes the date.

- (void)datePickerDidChangeDate:(UIDatePicker *)datePicker

Parameters

datePicker

The UIDatePicker managing the date change. Use this object to retrieve the date.

Declared In

OCRResumeJobsDetailViewController.m

didPressAddButton:

Handles presses of the addButton (+ image) on the section header views.

- (IBAction)didPressAddButton:(id)sender

Parameters

sender

the UIButton that was pressed.

Discussion

The tableView:viewForHeaderInSection: method sets the tag field to the section number in order to differentiate between adding jobs vs. education.

Declared In

OCRResumeJobsDetailViewController.h

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

OCRResumeJobsDetailViewController.m

didPressDoneButton:

Called when the user taps the Done button of a presented OCRDatePickerViewController.

- (void)didPressDoneButton:(id)sender

Parameters

sender

The object initiating the dismiss action (the Done UIBarButtonItem).

Declared In

OCRResumeJobsDetailViewController.m

didPressInfoButton:

Handles presses of the infoButton.

- (IBAction)didPressInfoButton:(id)sender

Parameters

sender

the UIButton that was pressed.

Discussion

The infoButton behavior depends on the editing state. In normal (browse) mode, tapping it opens a browser window with the job.uri as the address. In editing mode tapping it opens an actionSheet that allows the user to edit the job.uri.

Declared In

OCRResumeJobsDetailViewController.h

keyboardWillBeHidden:

Invoked when the keyboard is about to be hidden

- (void)keyboardWillBeHidden:(NSNotification *)aNotification

Parameters

aNotification

the NSNotification containing information about the keyboard

Discussion

Reset the contentInsets to “zero”

Declared In

OCRResumeJobsDetailViewController.m

keyboardWillShow:

Invoked when the keyboard is about to show

- (void)keyboardWillShow:(NSNotification *)aNotification

Parameters

aNotification

the NSNotification containing information about the keyboard

Discussion

Scroll the content to ensure the active field is visible

Declared In

OCRResumeJobsDetailViewController.m

loadViewFromSelectedObject

Update the text fields of the view from the selected managed object.

- (void)loadViewFromSelectedObject

Declared In

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.m

parentCellForView:

Search the UIView hierarchy to find the UITableViewCell that is the parent of the view.

- (UITableViewCell *)parentCellForView:(UIView *)view

Parameters

view

The UIView for whom the caller would like the parent UITableViewCell.

Return Value

The UITableViewCell that is the parent of view, or nil if none is found.

Discussion

This is a recursive method, searching through the superviews of the view. Eventually either a UITableViewCell is found, or the top of the superview chain is reached and the method returns nil.

Declared In

OCRResumeJobsDetailViewController.m

populateFieldsFromSelectedObject

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

- (void)populateFieldsFromSelectedObject

Declared In

OCRResumeJobsDetailViewController.m

presentationController:viewControllerForAdaptivePresentationStyle:

Asks the delegate for the view controller to display when adapting to the specified presentation style.

- (UIViewController *)presentationController:(UIPresentationController *)controller viewControllerForAdaptivePresentationStyle:(UIModalPresentationStyle)style

Parameters

controller

The presentation controller that is managing the size class change.

style

The new presentation style that is about to be employed to display the view controller.

Return Value

The view controller to display in place of the existing presented view controller.

Discussion

When a size class change causes a change to the underlying presentation style, the presentation controller calls this method to ask for the view controller to display in that new style. This method is your opportunity to replace the current view controller with one that is better suited for the new presentation style. For example, you might use this method to insert a navigation controller into your view hierarchy to facilitate pushing new view controllers more easily in the compact environment. In that instance, you would return a navigation controller whose root view controller is the currently presented view controller. You could also return an entirely different view controller if you prefer.

If you do not implement this method or your implementation returns nil, the presentation controller uses its existing presented view controller.

Declared In

OCRResumeJobsDetailViewController.m

promptForJobUri

Prompts the user to enter a name for the new Jobs entity.

- (void)promptForJobUri

Declared In

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.m

tableView:accCellForIndexPath:

Configure a jobs cell for the resume.

- (UITableViewCell *)tableView:(UITableView *)tableView accCellForIndexPath:(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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.m

textFieldDidBeginEditing:

Tells the delegate that editing began for the specified text field.

- (void)textFieldDidBeginEditing:(UITextField *)textField

Parameters

textField

The text field for which an editing session began.

Discussion

This method notifies the delegate that the specified text field just became the first responder. You can use this method to update your delegate’s state information. For example, you might use this method to show overlay views that should be visible while editing.

Implementation of this method by the delegate is optional.

Declared In

OCRResumeJobsDetailViewController.m

textFieldDidEndEditing:

Tells the delegate that editing of the specified text view has ended.

- (void)textFieldDidEndEditing:(UITextField *)textField

Parameters

textField

The text view in which editing ended.

Discussion

Implementation of this method is optional. A text view sends this message to its delegate after it closes out any pending edits and resigns its first responder status. You can use this method to tear down any data structures or change any state information that you set when editing began.

Declared In

OCRResumeJobsDetailViewController.m

textFieldShouldBeginEditing:

Asks the delegate if editing should begin in the specified text field.

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField

Parameters

textField

The text field for which editing is about to begin.

Return Value

YES if an editing session should be initiated; otherwise, NO to disallow editing.

Discussion

When the user performs an action that would normally initiate an editing session, the text field calls this method first to see if editing should actually proceed. In most circumstances, you would simply return YES from this method to allow editing to proceed.

Implementation of this method by the delegate is optional. If it is not present, editing proceeds as if this method had returned YES.

Declared In

OCRResumeJobsDetailViewController.m

textFieldShouldReturn:

Asks the delegate if the text field should process the pressing of the return button.

- (BOOL)textFieldShouldReturn:(UITextField *)textField

Parameters

textField

The text field whose return button was pressed.

Return Value

YES if the text field should implement its default behavior for the return button; otherwise, NO.

Discussion

The text field calls this method whenever the user taps the return button. You can use this method to implement any custom behavior when the button is tapped.

Declared In

OCRResumeJobsDetailViewController.m

textViewDidEndEditing:

Tells the delegate that editing of the specified text view has ended.

- (void)textViewDidEndEditing:(UITextView *)textView

Parameters

textView

The text view in which editing ended.

Discussion

Implementation of this method is optional. A text view sends this message to its delegate after it closes out any pending edits and resigns its first responder status. You can use this method to tear down any data structures or change any state information that you set when editing began.

Declared In

OCRResumeJobsDetailViewController.m

textViewShouldBeginEditing:

Asks the delegate if editing should begin in the specified text view.

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView

Parameters

textView

The text view for which editing is about to begin.

Return Value

YES if an editing session should be initiated; otherwise, NO to disallow editing.

Discussion

When the user performs an action that would normally initiate an editing session, the text view calls this method first to see if editing should actually proceed. In most circumstances, you would simply return YES from this method to allow editing to proceed.

Implementation of this method by the delegate is optional. If it is not present, editing proceeds as if this method had returned YES.

Declared In

OCRResumeJobsDetailViewController.m

updateSelectedObjectFromUI

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

- (void)updateSelectedObjectFromUI

Declared In

OCRResumeJobsDetailViewController.m

updateSourceObjectWithString:forTag:atIndexPath:

Update the object represented by the tagged field in the cell at indexPath.

- (void)updateSourceObjectWithString:(NSString *)string forTag:(int)tag atIndexPath:(NSIndexPath *)indexPath

Parameters

string

The string data

tag

The tag of the UITextField representing the object.

indexPath

An index path locating the new selected row in tableView.

Declared In

OCRResumeJobsDetailViewController.m

userTextSizeDidChange:

Handle the notification that the user changed the dynamic text size.

- (void)userTextSizeDidChange:(NSNotification *)aNotification

Parameters

aNotification

The NSNotification associated with the event.

Discussion

This method is invoked by notification when the user changes the text size. We apply a new UIFont instance to each label, text field, and text view that uses dynamic font styles.

Declared In

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.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

OCRResumeJobsDetailViewController.m