• 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
check if app opens with a document on startup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

check if app opens with a document on startup


  • Subject: check if app opens with a document on startup
  • From: Torsten Curdt <email@hidden>
  • Date: Tue, 20 May 2008 15:31:58 +0200

I have a document based application. The AppController prevents empty documents to be created at startup with

- (BOOL) applicationShouldOpenUntitledFile:(NSApplication *)sender
{
    return NO;
}

All good. But I was wondering if it is possible to find out if the application has been opened by dragging a document onto it.

First though was to hook into

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType;

and set a flag in the AppController. But loadDataRepresentation is called after the AppController has been executed awakeFromNib.
So I cannot distinguish it from a normal "Open" from the menu.


Any suggestion on how to do this? ...I am not really sure what to search for.

cheers
--
Torsten
_______________________________________________

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


  • Follow-Ups:
    • Re: check if app opens with a document on startup
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Initialize a subclass object with a base class object
  • Next by Date: Re: bindings tutorial doesn't work
  • Previous by thread: Re: Accessing [event modifierFlags] in an action method?
  • Next by thread: Re: check if app opens with a document on startup
  • Index(es):
    • Date
    • Thread