Working with Regular Report Note Selection Controller

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example displays creating and displaying a regular report note selection controller, and also creating a new note

Source Code

Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Displaying of Regular Report section):

// Get regular report controller
MAProceduralReportDataViewController<MADataViewControllerProtocol> *contr = (MAProceduralReportDataViewController<MADataViewControllerProtocol> *)[(MAProceduralReportViewController *)m_controller activeDataViewController];
// Create a regular report note selection controller
NotesViewController *notes = [NotesViewController new];
// Set controller delegate
[notes setDelegate: contr];
// Set note selection container size
[notes setContentSizeForViewInPopover: CGSizeMake(200, 300)];
// Specify 12:33:05 as the current time
NSDateComponents *comps = [NSDateComponents new];
[comps setHour: 12];
[comps setMinute: 33];
[comps setSecond: 5];
// Get current calendar
NSCalendar *gregorian = [NSCalendar currentCalendar];
// Determine note creation date
NSDate *date = [gregorian dateFromComponents: comps];
NSTimeInterval timestamp = [date timeIntervalSince1970];
// Add a new note
[contr addNote: CGPointMake(0, 0) withText:@"Note 1" timestamp: timestamp];
// Display view of regular report note selection controller
[self showViewControllerInPopover: notes];

After executing the example a popup window for note selection is displayed, and a new note is also created with the Note 1 text:

See also:

Examples of Component Use