• 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: How dangerous is +load?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How dangerous is +load?


  • Subject: Re: How dangerous is +load?
  • From: Daniel Zitter <email@hidden>
  • Date: Wed, 30 Apr 2003 17:55:25 -0700

Georg,

I also initialize test code when the application has finished launching. My method works pretty well for my software-assisted UI testing.

Georg wrote:
But I really do not want to create any
dependancies between the class in question and NSApp or its delegate.

I am confused by this requirement. One line of initialization code in the app or app delegate class is a small dependancy. Could you elaborate on the motivation for this requirement? Can we not assume you have the ability to recompile the application(s) you wish to test?

Cheers,
Dan

Date: Wed, 30 Apr 2003 20:34:26 +0200
Subject: How dangerous is +load?
From: Georg Tuparev <email@hidden>
To: email@hidden

Folks,

Here a method that works:

+(void)load
{
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(configureTestingUI:)
name: NSApplicationDidFinishLaunchingNotification
object: nil];
}

... but is dangerous because there is no guarantee that at the time the
Notification Center is loaded. But I really do not want to create any
dependancies between the class in question and NSApp or its delegate. I
have done some digging, and it seams Foundation classes are always
loaded before the classes from my framework, so in all examples the
method above did not caused any trouble. But I would prefer to replace
it. (For good or bad, +initialize is not called if no other method is
sent to the class).

Any suggestions how can I achieve the same functionality in a more
kosher way?

TIA

Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Disabling NSToolbar toggle via "Pill" White Button??
  • Next by Date: Save features in Alert Sheets
  • Previous by thread: Re: How dangerous is +load?
  • Next by thread: Irritating crash with DiscRecording framework
  • Index(es):
    • Date
    • Thread