Search Results

Search found 3 results on 1 pages for 'themikeswan'.

Page 1/1 | 1 

  • What are the correct bindings for an NSComboBox for use with Core Data

    - by theMikeSwan
    Imagine if you will a Core Data app with two entities (Employee, and Department). Employees have a to-one relationship with department (department) and the inverse is a to-many relationship (employees). In the UI you can select individual Employee entities and edit the details in a detail area (there are of course other attributes and there is UI for adding and editing Department entities). When using a popup button the bindings are: content = PopUpArrayController.arrangedObjects content values = PopUpArrayController.arrangedObjects.name (name is an NSString) selected object = EmployeeArrayController.selection.department.name This allows for viewing of all departments in the popup menu, correct selection of the current Employee's department, and allows that department to be changed as expected. The goal is to change this for an NSComboBox so that the user can tab to the box and type the department name in without switching to the mouse. I have tried numerous different bindings to accomplish this. I even had it work for one run with these bindings: content = PopUpArrayController.arrangedObjects.name value = EmployeeArrayController.selection.department.name At least once this worked as expected (it even added a new department when the entered text did not match any existing department). Now however it will display the available Departments and auto complete but will not update the model with the correct value when the value is changed in the combo box. If the Department is set or changed with the popup the correct department is shown in the combo box. Does anyone know what I am missing? Thanks.

    Read the article

  • What would cause objectForKey: to return null with a valid string in place?

    - by theMikeSwan
    I am having an issue with NSDictionary returning null for an NSString even though the string in in the dictionary. Here is the code: - (void)sourceDidChange:(NSNotification *)aNote { NSDictionary *aDict = [aNote userInfo]; DLog(@"%@", aDict); NSString *newSourceString = [aDict objectForKey:@"newSource"]; DLog(@"%@", newSourceString); newSourceString = [newSourceString stringByReplacingOccurrencesOfString:@" " withString:@""]; DLog(@"%@", newSourceString); NSString *inspectorString = [newSourceString stringByAppendingString:@"InspectorController"]; DLog(@"%@", inspectorString); newSourceString = [newSourceString stringByAppendingString:@"ViewController"]; DLog(@"%@", newSourceString); } And I get the following log statements: 2010-04-17 23:50:13.913 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] newSource = "Second View"; 2010-04-17 23:50:13.914 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) 2010-04-17 23:50:13.916 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) 2010-04-17 23:50:13.917 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) 2010-04-17 23:50:13.917 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) As you can see the string is in the dictionary under the key newSource, yet when I call objectForKey: I get null. I have even tried the fallback option of cleaning the project. Has anyone ever run into this, or have I just forgotten something really basic?

    Read the article

  • What is the flag to show the nesting of views in a Mac app?

    - by theMikeSwan
    I have just spet the last few hours trying to find the flag to use in Terminal to launch an app with the colored outlines around the various view elements to show how they are nested. I know that Matt Gemmell covered it during the Cocoa Face Off session of NSConference 2009 (at about the 13minute mark in the video). Unfortunately I can't actually read what he types and he doesn't speak the exact command. I know it has to be in the Apple docs somewhere but the search system is currently not being of any use. It looks like her just adds -showAllViews YES to the end of the command to open TextEdit but that command has no effect in 10.6.6. I have also tried every other capitalization I can think of as well as using view instead of views. Every command opens TextEdit just fine but doesn't show the colored outlines.

    Read the article

1