iOS simulator error

ERROR: Runtime error  bad argument #-2 to '\_cachedRemoveSelf' (Proxy expected, got nil)  stack traceback:  [C]: in function '\_cachedRemoveSelf'  ?: in function 'removeSelf'  widget-extras.lua:431: in function '?'  ?: in function \<?:190\>

non-obvious - widget-extras.lua is 259 lines long.

                       call to removeSelf is line 230

The error is not thrown in Android.

Thoughts on where to look?

Dave

What is widget-extras.lua?

Rob

Wrapper that makes newTextField and NewTexBox OpenGL compatible.

The removeSelf() call is in a finalize function

Can you share the relevant code?

Here you go, Rob.

Thanks

Dave

btw, I did see eventually that I was looking at an older set of source for line numbers - so that part was solved.

There are 2 potential calls to removeSelf().  The error is on the second of the two in the finalize function.

Dave

So I looked through the widget library source and  cachedRemoveSelf() is part of the widget.newScrollView() API. Trying to put textFields into scrollViews could be problematic because while native.* objects can be added to groups to help move them there is a lot of other stuff going on under the hood with scrollViews.  The widget.newTextField() seems to have a lot of scrollView references in it, but since I don’t recognize that code, I’m not sure how much I can help with it.  

I know we did a tutorial that used a similar concept, but we didn’t have any scrollView support. I would look there first.

Rob

Thanks, Rob.

I’ll do that.  

We’ve done a bunch of things to handle newTextViews in scrollViews - such as moving the native control off screen when it scrolls out of the viewing area, 

Of all the places it can be, of course its in the scrollView.  :unsure:    Let’s see now, should I get coffee or beer.    It’s the scrollView - lets start with the beer.

Dave

What is widget-extras.lua?

Rob

Wrapper that makes newTextField and NewTexBox OpenGL compatible.

The removeSelf() call is in a finalize function

Can you share the relevant code?

Here you go, Rob.

Thanks

Dave

btw, I did see eventually that I was looking at an older set of source for line numbers - so that part was solved.

There are 2 potential calls to removeSelf().  The error is on the second of the two in the finalize function.

Dave

So I looked through the widget library source and  cachedRemoveSelf() is part of the widget.newScrollView() API. Trying to put textFields into scrollViews could be problematic because while native.* objects can be added to groups to help move them there is a lot of other stuff going on under the hood with scrollViews.  The widget.newTextField() seems to have a lot of scrollView references in it, but since I don’t recognize that code, I’m not sure how much I can help with it.  

I know we did a tutorial that used a similar concept, but we didn’t have any scrollView support. I would look there first.

Rob

Thanks, Rob.

I’ll do that.  

We’ve done a bunch of things to handle newTextViews in scrollViews - such as moving the native control off screen when it scrolls out of the viewing area, 

Of all the places it can be, of course its in the scrollView.  :unsure:    Let’s see now, should I get coffee or beer.    It’s the scrollView - lets start with the beer.

Dave