Q:

Saving a Managed Object with a To One type

I am new to iOS development and I am trying to get my head around using multiple managed objects.  
For example the test app has a two entities one for Folder, and another for Planner.  It is a To One type so for every folder there is a planner.  Planner has an attribute called notes to save the text from the text field.  
After creating a folder, tapping on the cell in the tableView the user segues to the planner view controller passing on the selectedFolder object.  Within the Planner View Controller I am trying to make sure when the savePlanner function is executed this should save the the 'UITextView' text to the 'notes' property of the managed planner object which has a direct relation with the 'selectedFolder'.  
I am unsure how I make sure there is a relation between the Planner and Selected Folder when saving.  
In the Planner View Controller I have; 
class PlannerViewController: UIViewController {

//SelectedFolder is the managed object of the cell row
var selectedFolder: Folder! 
var planner: Planner? 

@IBOutlet weak var plannerTextField: UITextView! 

override func viewDidLoad() {
    super.viewDidLoad()

//Load Planner Data in text field here..

}

@IBAction func savePlanner(sender: AnyObject) {

    //Save Planner Notes To Folder

    //Get the context
    let moc = (UIApplication.sharedApplication().delegate as!  AppDelegate).managedObjectContext
    //get entity details
    let entity = NSEntityDescription.entityForName("Planner", inManagedObjectContext: moc!) 
    //Create the managed object to be inserted
    let note = Planner(entity: entity!,  insertIntoManagedObjectContext: moc!) 

    //Add current Planner to selectedFolder
    selectedFolder.planner = note

    //Error
    var error: NSError? 
    if moc!.save(nil){}

    //Storing Data
    note.notes = plannerTextField.text

    moc?.save(&error)

}

}

A:

To create a one-to-one relationship you can set it from either side.  Do this before saving.  Thus: 
selectedFolder.planner = note
// or
note.folder = selectedFolder

Of course, this will only work if you have set up the relationship and reverse relationship correctly in the Core Data model editor.