• 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: NSDocument, setFileURL:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument, setFileURL:


  • Subject: Re: NSDocument, setFileURL:
  • From: Brian Amerige <email@hidden>
  • Date: Wed, 10 Oct 2007 18:55:57 -0400

Hi,

It seems no one has responded to this, which is typically a good indicator that it's an odd problem. And with an odd problem, comes an odd solution.

I'm typically (read: almost always) against using class-dump, using private/undocumented methods, etc., but as far as I can tell NSDocument is doing its job, and there is no public way of preventing it from doing so, which would be necessary in this case. That being said:

class-dump reveals a method, "_resetMoveAndRenameSensing", which, unsurprisingly, resets exactly what I need to. A quick subclass of setFileURL: in my NSDocument subclass allows me to do have setFileURL: do exactly what I need.

- (void)setFileURL:(NSURL *)absoluteURL
{
	[super setFileURL:absoluteURL];

	if ([super respondsToSelector:@selector(_resetMoveAndRenameSensing)])
	{
		[super performSelector:@selector(_resetMoveAndRenameSensing)];
	}
}

Best,
Brian Amerige
email@hidden




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSAutoreleasePool and static data member constructors
  • Next by Date: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Previous by thread: NSDocument, setFileURL:
  • Next by thread: Snarfing Keyboard Events
  • Index(es):
    • Date
    • Thread