• 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: applicationDidHide - Not Getting Triggered?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applicationDidHide - Not Getting Triggered?


  • Subject: Re: applicationDidHide - Not Getting Triggered?
  • From: Jason Teagle <email@hidden>
  • Date: Sat, 19 May 2012 13:23:50 +0100
  • Organization: Organised Bytes Software

It was not minimized.  Apps can't be minimized, only windows can.
Thank you for this patient and in-depth reply.


>Your app was simply running with no windows open.

Understood. A little freaky, coming from a PC perspective, but it is something I will get used to.


When you click on the Dock icon for a running app, it is a "relaunch"
or "reopen app" event.
...
In this case, it is expected that the app will created a new window if
>there isn't already a window open.  However, that behavior is not
>entirely free.  You have to implement some stuff.
...
So, the short story is to implement -applicationOpenUntitledFile: to
>do whatever you want, either when your app is first launched or when
>it is "relaunched".

Again, understood. I will look at tackling that and make sure I can get a replacement window started when necessary.


This is documented in Cocoa Scripting Guide: How Cocoa Applications
>Handle Apple Events<https://developer.apple.com/library/mac/#documentation/
Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/SAppsHandleAEs.html>.

Thanks, I'll give this a good read.


You may be confused by the default project template for a Cocoa application in
Xcode.  In that project, the MainMenu NIB contains a window and that window is
"visible at launch" (which really means "visible when the NIB is loaded").

I was a little disappointed that a skeleton app project didn't provide a handy hook in just before the NIB is loaded, as iOS apps do. I get the feeling I'm going to end up building the UI manually in code much of the time (I'm familiar with sizeToFit and thus getting the required space for controls - that is the core of the iOS project I am working on, a conversion from a platform I am writing to turn generic controls and behaviour (protocols, in Objective-C-speak) into platform-specific UI for easy building of phone apps across multiple platforms).


In general, windows should be in separate NIBs, each of which should be
>owned and loaded by a window controller.  If a window is to be loaded at
>application launch, that should be done in code in the
-applicationOpenUntitledFile: method.

As a general rule of thumb, then, would you say a developer *should* use IB to design the interface, or is manually building a UI with careful consideration for size (due, for example, to localization in another language) an acceptable practice? I realise there are times when manually building is just best, as in my iOS project, but I don't want to get into bad habits.

--
Jason Teagle
_______________________________________________

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: applicationDidHide - Not Getting Triggered?
      • From: Ken Thomases <email@hidden>
    • Re: applicationDidHide - Not Getting Triggered?
      • From: Roland King <email@hidden>
References: 
 >applicationDidHide - Not Getting Triggered? (From: Jason Teagle <email@hidden>)
 >Re: applicationDidHide - Not Getting Triggered? (From: Ken Thomases <email@hidden>)
 >Re: applicationDidHide - Not Getting Triggered? (From: Jason Teagle <email@hidden>)
 >Re: applicationDidHide - Not Getting Triggered? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: applicationDidHide - Not Getting Triggered?
  • Next by Date: Re: applicationDidHide - Not Getting Triggered?
  • Previous by thread: Re: applicationDidHide - Not Getting Triggered?
  • Next by thread: Re: applicationDidHide - Not Getting Triggered?
  • Index(es):
    • Date
    • Thread