Date   

Re: When does AppDelegate:applicationDidFinishLaunching get called?

Dave
 

Hi,

Ahhh, you mean, awakeFromNib in the AppDelegate not the window/view controller. I think I was trying to avoid tying the initialisation to a NIB (in case I ever created it programmatically), but I guess in the case of the NSApplication object it will always be from a NIB so it’s safe.

Thanks a lot
Dave

On 15 Jan 2020, at 13:49, Sandor Szatmari <admin.szatmari.net@gmail.com> wrote:

I see different behaviour. Here’s a test app. No matter what I do, -awakeFromNib is always called first. I tried it both in the AppDelegate, and in the ViewController subclass.

Cheers,
Sandor


On Jan 15, 2020, at 05:51, Dave <dave@looktowindward.com> wrote:

Hi,

A little more on this.

If I uncheck “Is Initial Controller”, then applicationDidFinishLaunching gets calls as expected.

So I put the code back to instantiate it manually and all works as expected.

All the Best
Dave






<tester.zip>


Re: When does AppDelegate:applicationDidFinishLaunching get called?

Sandor Szatmari
 

There’s a test app attached to demonstrate…

Sandor

On Jan 15, 2020, at 07:49, Sandor Szatmari via Groups.Io <admin.szatmari.net=gmail.com@groups.io> wrote:

I see different behaviour. Here’s a test app. No matter what I do, -awakeFromNib is always called first. I tried it both in the AppDelegate, and in the ViewController subclass.

Cheers,
Sandor


On Jan 15, 2020, at 05:51, Dave <dave@looktowindward.com> wrote:

Hi,

A little more on this.

If I uncheck “Is Initial Controller”, then applicationDidFinishLaunching gets calls as expected.

So I put the code back to instantiate it manually and all works as expected.

All the Best
Dave






<tester.zip>


Re: When does AppDelegate:applicationDidFinishLaunching get called?

Sandor Szatmari
 

I see different behaviour. Here’s a test app. No matter what I do, -awakeFromNib is always called first. I tried it both in the AppDelegate, and in the ViewController subclass.

Cheers,
Sandor

On Jan 15, 2020, at 05:51, Dave <dave@looktowindward.com> wrote:

Hi,

A little more on this.

If I uncheck “Is Initial Controller”, then applicationDidFinishLaunching gets calls as expected.

So I put the code back to instantiate it manually and all works as expected.

All the Best
Dave





Re: When does AppDelegate:applicationDidFinishLaunching get called?

Dave
 

Hi,

A little more on this.

If I uncheck “Is Initial Controller”, then applicationDidFinishLaunching gets calls as expected.

So I put the code back to instantiate it manually and all works as expected.

All the Best
Dave


Re: When does AppDelegate:applicationDidFinishLaunching get called?

Dave
 

Hi,

This is a Mac project but I will be doing an IOS version too.

I’ve tried applicationWillFinishLaunching and applicationDidFinishLaunching, but the View Controller gets control before either are called.

This is a Single Window based App.

The difference is that before I was manually instantiating the View Controller in applicationDidFinishLaunching (after initialising the App), now its being instantiated automatically by the OS.

Seems a bit weird to be honest, the fact that the Window has displayed means that the App

What dictates whether an App has launched? I’m guessing that the automatic loading is considered part of the Launch process, which would make sense given the naming of the methods.

Maybe there should be a “applicationDidBeginLauching”.

If there really isn’t a safe place to perform this type of initialisation then I guess I could always go back to manually instantiating the Window/View Controller…..

All the Best
Dave


Is this a document-based app or a single-window type app?

In my single-window apps, AppDelegate:applicationDidFinishLaunching is called first, and instantiates and displays the main window, so the window’s init and awakeFromNib methods are called before AppDelegate:applicationDidFinishLaunching ends.

In my document-based app, the DocumentWIndowController:windowDidLoad (and presumably viewDidAppear) are called before the AppDelegate:applicationDidFinishLaunching.

Jim Crate


Re: When does AppDelegate:applicationDidFinishLaunching get called?

Jim
 

On Jan 14, 2020, at 10:59 AM, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?
Is this a document-based app or a single-window type app?

In my single-window apps, AppDelegate:applicationDidFinishLaunching is called first, and instantiates and displays the main window, so the window’s init and awakeFromNib methods are called before AppDelegate:applicationDidFinishLaunching ends.

In my document-based app, the DocumentWIndowController:windowDidLoad (and presumably viewDidAppear) are called before the AppDelegate:applicationDidFinishLaunching.

Jim Crate


Re: When does AppDelegate:applicationDidFinishLaunching get called?

Sandor Szatmari
 

On Jan 14, 2020, at 11:47, Alex Zavatone via Groups.Io <zav=mac.com@groups.io> wrote:

You can also look at other methods in the AppDelegate, such as init,
If you’re going to look at -init, if it’s an object coming from a NIB then look at overriding -initWithCoder:
applicationWillFinishLaunchingWithOptions and so on.

Just look at the header. They are easy to try.
On Jan 14, 2020, at 9:59 AM, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave






Re: When does AppDelegate:applicationDidFinishLaunching get called?

Jonathan Prescott
 

Since you referenced a Window, I’m assuming MacOS application, not iOS. Probably the same, but not sure since I don’t program for iOS.

According to the documentation, applicationDidFinishLaunching is called by NSApplication just before entering into the application event loop. You could try applicationWillFinishLaunching, which is called just after the application object is initialized, which should be before any controllers are created, if that is appropriate. You could also override the init() method (Swift or Objective-C) if that makes sense.

Jonathan

On Jan 14, 2020, at 10:59 AM, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave




Re: When does AppDelegate:applicationDidFinishLaunching get called?

Dave
 

The thing is, this Code is supposed to initialize the App Sub-system before any other parts of the App get called. If I put it in AwakeFromNib then the initalization will be dependant of which Window or View Controller gets called first.

I had thought that applicationDidFinishLaunching was a safe place to put this code, but for some reason it doesn’t seem to work anymore.

All the Best
Dave

On 14 Jan 2020, at 17:32, Sandor Szatmari <admin.szatmari.net@gmail.com> wrote:

-(void)awakeFromNib might work for you.

Sandor

On Jan 14, 2020, at 11:13, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave





Re: When does AppDelegate:applicationDidFinishLaunching get called?

Dave
 

Hi,

It seems that whichever method I use, the view get called first. I need a way of initialising App Sub-systems before any view gets called. I’m not sure if this has changed or not or whether its because I’m using Storyboards. I have a "main.storyboard” that’s gets setup automatically be the OS. I think before I was manually instantiating the Window/View Controller from a NIB file.

So, does the Views inside "main.storyboard” get initialized before applicationWillFinishLaunching/applicationDidFinishLaunching get called?

Thanks a lot for your help
Dave

On 14 Jan 2020, at 17:25, Alex Zavatone via Groups.Io <zav=mac.com@groups.io> wrote:

You can also look at other methods in the AppDelegate, such as init, applicationWillFinishLaunchingWithOptions and so on.

Just look at the header. They are easy to try.
On Jan 14, 2020, at 9:59 AM, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave






Re: When does AppDelegate:applicationDidFinishLaunching get called?

Sandor Szatmari
 

-(void)awakeFromNib might work for you.

Sandor

On Jan 14, 2020, at 11:13, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave




Re: When does AppDelegate:applicationDidFinishLaunching get called?

Alex Zavatone
 

You can also look at other methods in the AppDelegate, such as init, applicationWillFinishLaunchingWithOptions and so on.

Just look at the header. They are easy to try.

On Jan 14, 2020, at 9:59 AM, Dave <dave@looktowindward.com> wrote:

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave




When does AppDelegate:applicationDidFinishLaunching get called?

Dave
 

Mac Project.
MacOS 10.14.6

Hi All,

I have some code that needs to be initialized before any Window/View are displayed. The App was working ok, but it looks like something has changed?

I have a call to initialise AppDelegate:applicationDidFinishLaunching BUT, the Initial Window/View Controller viewDidAppear method is being called before applicationDidFinishLaunching. Is this correct behaviour and if so where is the best place to initialise things?

Thanks a lot
All the Best
Dave


Flipped Views not Appearing Correctly when Loaded from Storyboard

Dave
 

Hi All,

I am using Flipped Views (isFlipped = YES) in a window. The window is loaded from a Storyboard file. Initially the window appears Bottom Up instead of Top Down. When I resize the window all Snaps into place ok. How can I get the window to display correctly when first loaded from a Storyboard file?

Thanks a lot
All the Best
Dave


Re: [OT] Cocoa Developer Needed

Dave
 

On 13 Dec 2019, at 01:24, Sandor Szatmari <admin.szatmari.net@gmail.com> wrote:


I’m looking for a macOS developer to join our team in Northern NJ. This is for mid-level candidates or higher.

Candidates must be well versed or fluent in the following:
Objective-C/C
SQL (preferably Postgres)
GIT/SVN
Shell scripting (Bash)

Some Experience:
DocBook
XML
32 -> 64 bit conversion
MRC -> ARC

Additional skills:
4D
Java

Local candidates preferred, but remote work from home is not out of the question. We are not offering relocation.

Please contact me directly for more details.

Thanks,
Sandor


How to Initial Views using Manual Layout?

Dave
 

XCode 11
Mac

Hi,

I have the following view hierarchy in a Storyboard file

Window->RootView-BottomView->BoardView->CellView1
Window->RootView-BottomView->BoardView->CellView2
Window->RootView-BottomView->BoardView->CellView3
…..
…..
Window->RootView-BottomView->BoardView->CellView81

I’m laying out the view manually because it is so much easier than using Auto Layout and I had no luck on making it work anyway.

I’m overriding in all classes:

-(void) resizeWithOldSuperviewSize:(NSSize) theOldSuperViewSize

Which handles the resizing.


However when the Window/WindowController is first display from the storyboard the View Hierarchy is not initialised and the Initial view window content is as it was in the Storyboard file (all over the place!), Also I’m using “Flipped” coordinates (isFlipped = YES) and so it appears bottom up instead of top down.

If I resize the window, everything snaps into place nicely! How can I initialise the View System so that it appears ok when the Window it first displayed?

Thanks a lot for any help.
All the Best
Dave


Silencing deprecation warnings in Swift

Steve Christensen
 

I’m in the process of porting some Obj-C code to Swift. Several Core Data entity properties are marked as deprecated for general use but, at least in several migration methods, they still need to be accessed legitimately.

With Obj-C the code in specific methods is bracketed with #pragmas where the deprecated properties are accessed:

- (void) MigrateFoo
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations”

// touch deprecated properties

#pragma clang diagnostic pop
}

Note that I do not want the warnings silenced project-wide nor, ideally, for an entire source file.

Is there a way of doing this when compiling Swift? Older posts on stackoverflow, etc., mention that it wasn’t doable at the time, but I haven’t seen more recent mentions either way.

Thanks,
Steve


Specializing NSPredicateEditor

Steve Mills
 

Can anyone think of a way to subclass NSPredicateEditor so a shift-click in the + button will cause the same template as the clicked row to be inserted instead of the next unused template? If there are multiple templates, the default behavior will add each one in sequence. Most of the time I want to add multiples of the same criteria type, e.g. “keyword is blah” and “keyword is gort”. Having to always change the criteria type after clicking + is bothersome.

Steve via iPhone


Where is my crash log?

Gerriet M. Denkmann
 

Console.app told me:
default 22:57:28.157905+0700 ReportCrash Saved crash report for chronyd[15863] version 0 to chronyd_2019-12-14-225728_Spinat.crash

But I cannot find this.
Where should I look?

Gerriet.


[OT] Cocoa Developer Needed

Sandor Szatmari
 

I’m looking for a macOS developer to join our team in Northern NJ. This is for mid-level candidates or higher.

Candidates must be well versed or fluent in the following:
Objective-C/C
SQL (preferably Postgres)
GIT/SVN
Shell scripting (Bash)

Some Experience:
DocBook
XML
32 -> 64 bit conversion
MRC -> ARC

Additional skills:
4D
Java

Local candidates preferred, but remote work from home is not out of the question. We are not offering relocation.

Please contact me directly for more details:

opportunity [at] infoplusonline [dot] com

Thanks,
Sandor

301 - 320 of 1454