Merkwürdiger crash seit R4.1

Hi,

ich benutze eine Listbox mit einem Popupmenü und erhalte seit R4.1 sporadisch diesen Fehler.
Hat jemand eine Idee woher das kommen könnte und was das genau bedeutet?

RuntimeException: TypeMismatchException
Location: App-Level
Error Stack:
rbframework.dylib$2136
rbframework.dylib$4
VariantArrayAssignmentWithTypeCheck
ListBoxPopup.ShowMenu%%oi4i4
ListBoxPopup.Event_CellClick%b%oi4i4i4i4
rbframework.dylib$7397
rbframework.dylib$7403
rbframework.dylib$7404
rbframework.dylib$7865
rbframework.dylib$7388
rbframework.dylib$8213
rbframework.dylib$8906
-[NSWindow sendEvent:]
rbframework.dylib$10396
-[NSApplication sendEvent:]
rbframework.dylib$8619
rbframework.dylib$8620
Delegate.Invoke%%
Application._CallFunctionWithExceptionHandling%%op
rbframework.dylib$4109
rbframework.dylib$8619
-[NSApplication run]
rbframework.dylib$4111
RuntimeRun
REALbasic._RuntimeRun
_Main
% main
_start
start

Und was macht deine ShowMenu Methode?

Hier der Code, ich benutze diese Listbox seit ca 1 jahr unverndert und der Fehler trat erst mit R4.1 auf.

//X and Y will be different if you’re in a Container Control
dim x as integer = me.getcellx(col) + me.left + me.Window.left
dim y as integer = me.getcelly(row) + me.top + me.Window.top

//Create the base menu
dim base as new MenuItem

//Add our array data. Note, you could change the array data for each row if you wanted.
dim s() as string = me.celltag(row,col)
for i as integer = 0 to s.Ubound
base.Append New MenuItem(s(i))
next

//Do the popup
dim hitItem as menuitem = base.PopUp(x, y)

//Raise the event so the user can handle it however they want.
RaiseEvent MenuAction row, col, hititem

Wahrscheinlich liegts daran:

[quote]MenuItems in Cocoa
The Cocoa framework does not allow a MenuItem to be used in different places, e.g. several MenuBars. Trying to do so will raise a MenuHasParentException. In order to avoid the hassle of creating several times the same MenuItem, you can use the Clone method to make copies.[/quote]
Versuch mal:

RaiseEvent MenuAction row, col, hititem.Clone()

Danke, ich probiere es aus!

Nein, das tut nicht:

RaiseExceptionClass
RaiseNilObjectException
ListBoxPopup.ShowMenu%%oi4i4
ListBoxPopup.Event_CellClick%b%oi4i4i4i4

Ist im Debugger nichts zu erkennen?
Wird das Popup angezeigt oder passiert der Crash direkt beim Aufruf von base.PopUp(x, y)?

Dein zweites Resultat sieht wie eine ganze normale NOE aus. Passiert denn der Crash immer noch?

Ja, aber bei mir nicht, ich kann ihn nicht reproduzieren obwohl ich jetzt schon 4 Kunden habe, bei denen das gleiche passiert…

immer das gleiche, wenn ich es mal reproduzieren könnte, wäre es schnell gelöst…

RuntimeException: TypeMismatchException
Location: App-Level

OS version: 10.9.1
CPU type: Intel® Core™ i7-4750HQ CPU @ 2.00GHz

Benutzer Beschreibung:

Error Stack:
rbframework.dylib$2136
rbframework.dylib$4
VariantArrayAssignmentWithTypeCheck
ListBoxPopup.ShowMenu%%oi4i4
ListBoxPopup.Event_CellClick%b%oi4i4i4i4
rbframework.dylib$7397
rbframework.dylib$7403
rbframework.dylib$7404
rbframework.dylib$7865
rbframework.dylib$7388
rbframework.dylib$8213
rbframework.dylib$8906
-[NSWindow sendEvent:]
rbframework.dylib$10396
-[NSApplication sendEvent:]
rbframework.dylib$8619
rbframework.dylib$8620
Delegate.Invoke%%
Application._CallFunctionWithExceptionHandling%%op
rbframework.dylib$4109
rbframework.dylib$8619
-[NSApplication run]
rbframework.dylib$4111
RuntimeRun
REALbasic._RuntimeRun
_Main
% main
_start
start

Habe es herausgefunden. Seit R4.1 Klickt man in meine Listbox an eine Stelle, wo noch keine Zeile vorhanden ist, wird diese dort erstellt. Klickt man aber jetzt auf Column mit dem Menü in der Listbox wird das offensichtlich aufgerufen bevor der Listbox die Zeile hinzugefügt wurde.
Das kann ich jetzt lösen, danke!