• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
"Controller cannot be nil" message when loading from file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Controller cannot be nil" message when loading from file


  • Subject: "Controller cannot be nil" message when loading from file
  • From: Tom Jones <email@hidden>
  • Date: Tue, 13 Dec 2005 09:06:02 -0600

I have a document-based project that uses bindings, and
programatically binds the columns of an NSTableView. There are two
ways this code gets called. One is when the user imports a playlist
from iTunes into the application, this always works. The other is when
the user opens a saved document created by my application, this never
works. The code comes from a call to MyDocument's setPlaylist method.

for (i = 0; i< [[playlist columns] count]; i++)
{
NSTableColumn *newColumn;
newColumn = [[[NSTableColumn
alloc]initWithIdentifier:[[playlist columns] objectAtIndex:i]]
autorelease];
[[newColumn headerCell] setStringValue:[[playlist columns]
objectAtIndex:i]];
[theTableView addTableColumn:newColumn];
NSString *keypathPrefix =@"arrangedObjects.properties.";

NSMutableString *theKeypath = [[keypathPrefix
stringByAppendingString:[[playlist columns] objectAtIndex:i]]
mutableCopy];
[newColumn bind:@"value"
toObject:playlistItemsController withKeyPath:theKeypath options:nil];
}

my solution was to move this code to a separate method in MyDocument,
playlistChanged, and to call playlistChanged from
windowControllerDidLoadNib. is this the correct way to handle
programatic bindings in Document-based applications?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: How a QTMovie determines if it can initialize itself from a URL
  • Next by Date: Re: event pressure:
  • Previous by thread: Re: [COREDATA] Assign NSManagedObject to persistent store
  • Next by thread: Updating System Menu bar
  • Index(es):
    • Date
    • Thread