• 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: When to register binding transformers (applicationDidFinishLaunching)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When to register binding transformers (applicationDidFinishLaunching)?


  • Subject: Re: When to register binding transformers (applicationDidFinishLaunching)?
  • From: Tod Cunningham <email@hidden>
  • Date: Mon, 22 Mar 2004 02:40:11 -0500

I ended up doing it in my awakeFromNib method, and I just checked to make sure it wasn't already in the transfer list. However, I will move it to the initialize method as you suggest. I was concerned about putting in the initialize method due to potential early load time. I wasn't sure those classes would be safe to call (Event loop autorelease pools setup, etc).


if( [NSValueTransformer valueTransformerForName:@"PosixToHFSTransformer"] == nil )
{
PosixToHFSTransformer *posixToHFSTransformer = [[[PosixToHFSTransformer alloc] init] autorelease];

[NSValueTransformer setValueTransformer:posixToHFSTransformer
forName:@"PosixToHFSTransformer"];
}


Tod




On Mar 22, 2004, at 12:42 AM, mmalcolm crawford wrote:


On Mar 21, 2004, at 8:58 PM, Tod Cunningham wrote:

According to the binding documentation from apple (http://developer.apple.com/documentation/Cocoa/Conceptual/ ValueTransformers/index.html): "Value transformers are typically registered by an applications delegate, in response to receiving a applicationDidFinishLaunching: message."

Please file a bug.

However if I setup manual binding with a custom transform in awakeFromNib controller, the application will assert with NSInternalInconsistencyException because my transform hasn't been registered yet. Also the application will assert when the nib is loaded, if the transform is specified in the NIB file itself. So where is the best place to register the transform? I should mention that this is a non-document based application...

In the initialize method of a class that will be loaded when the application starts.

mmalc
_______________________________________________
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: When to register binding transformers (applicationDidFinishLaunching)?
      • From: Allan Odgaard <email@hidden>
References: 
 >When to register binding transformers (applicationDidFinishLaunching)? (From: Tod Cunningham <email@hidden>)
 >Re: When to register binding transformers (applicationDidFinishLaunching)? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Should I even bother
  • Next by Date: Problem with NSArrayController and passing data to an NSTableColumn
  • Previous by thread: Re: When to register binding transformers (applicationDidFinishLaunching)?
  • Next by thread: Re: When to register binding transformers (applicationDidFinishLaunching)?
  • Index(es):
    • Date
    • Thread