Manderby / NALib

General purpose C sourcecode collection
http://manderc.com/apps/nalib/index_en.php
The Unlicense
20 stars 5 forks source link

Solve Cocoa AppDelegate problem #20

Open Manderby opened 3 years ago

Manderby commented 3 years ago

After the postStartup, the NSApplication sets its application delegate in naStartApplication to the default. Desired would be to the delegate class of NALib to capture more notifications. This interfered with some other mechanisms though (don't quite remember now).

Please have a look at the following comments removed from naStartApplication to get back in the mood:

  //[NSApp setDelegate:(NA_COCOA_BRIDGE id)naGetUIElementNativePtr(app)];

//  SEL selector = @selector(doSomethingWithObject:afterDelay:);
//  IMP newImp = (IMP)swizzledDoSometingWithObjectAfterDelay;
//  Method method = class_getClassMethod([MyClass class], selector);
//  const char * encoding = method_getTypeEncoding(method);
//  class_replaceMethod([MyClass class], selector, newIMP, encoding);
Manderby commented 11 months ago

Note that there has been some development in starting up an application. It has become much more stable and maybe now it is possible to use the delegates properly. It has been an unresolved issue though and it is still not clear what is needed when.