• 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
Re: Frustrating...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frustrating...


  • Subject: Re: Frustrating...
  • From: Quentin Mathé <email@hidden>
  • Date: Tue, 14 Jan 2003 03:37:07 +0100

Le mardi, 14 jan 2003, ` 02:49 Europe/Paris, Jeff LaMarche a icrit :

I've hit a bit of a frustrating problem. I've got a document-based app
I'm working on. I've implemented loadDataRepresentation: ofType: to
handle opening files. I have a method called updateUI that I use to
populate text fields from the document's data, which I call after
unarchiving the data:


- (BOOL)loadDataRepresentation:(NSData *)uData ofType:(NSString *)aType
{
[self setData:[NSUnarchiver unarchiveObjectWithData:uData]];
[self updateUI];
return data != nil;
}

Here's the first part of updateUI (with some calls to NSLog) to
illustrate the problem I'm having:

- (void)updateUI
{
NSLog(@"Updating User Interface");
NSLog(@"Value for Line1: %@", [[data clientAddress] line1]);
[billingAddress1TF setStringValue:[[data clientAddress] line1]];
NSLog(@"Line 1 Set to: %@", [billingAddress1TF stringValue]);
....

When you open a document :
1. The data is loaded by your NSDocument subclass
2. The nib file associated with this document is loaded by the window controller
3. You fill the document with the loaded data

To know when the nib file is loaded, it's very simple because the NSWindowController call the method windowControllerDidLoadWindowNib:, then you just need to override this method like that :
- (void)windowControllerDidLoadWindowNib:(NSWindowController *)windowController {
[super windowControllerDidLoadWindowNib:windowController];
 // fill my document here
}

--
Quentin Mathi
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Frustrating...
      • From: Jeff LaMarche <email@hidden>
References: 
 >Frustrating... (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Frustrating...
  • Next by Date: Hardware question
  • Previous by thread: Re: Frustrating...
  • Next by thread: Re: Frustrating...
  • Index(es):
    • Date
    • Thread