sometimes it can get really annoying that the Crash Reporter (see below) shows up after your application just failed you and exit with an exception. The Crash Reporter looks like this (at least on my German OSX):
I just press [ignore] every time, but I don't want to be alerted in the first place.
Here is a class (UKCrashReporter.NSObject) I constructed as a helper to disable Crash Reporter in some situations:
- Code: Select all
Dim crashReporter As Boolean
Dim reportNone As Array
Dim reportCrash As Array
Function crashReporter() As Boolean
Return crashReporter
End Function
Sub setCrashReporter(state As Boolean)
crashReporter = state
If (crashReporter) Then
Run("/usr/bin/defaults", reportCrash)
Else
Run("/usr/bin/defaults",reportNone)
End If
End Sub
Sub setcrashReporter(state As Boolean)
setCrashReporter(state)
End Sub
Event Init()
reportNone = Array("write", "com.apple.CrashReporter","DialogType","none")
reportCrash = Array("write", "com.apple.CrashReporter", "DialogType", "crashreport")
End Event
Crash Reporter is controlled via user defaults and I could have used NSUserDefaults but the command line just comes in handy.
The methods are thought to work at the class level and should be used this way:
- Code: Select all
' Global Object:
' this method isn't there at all - just demo
Declare Function "NSString" + (void)helloWorld
Dim myArrRead As Array
Dim myArrWrite As Array
Event AwakeFromNib()
UKCrashReporter.crashReporter = No
' do something wrong
NSString.helloWorld()
End Event
Give it a try and comment back to me.
Regards
Udo
