Odd Nil Object Exception

I have come into the habit to remove the handler immediately after use, when possible.

For instance, in a timer, I will do addhandler just before starting the timer, and removehandler from within the handler method when I stop the timer or when it is in single mode. That way It don’t have to clean up in cancelclose or close.

Yeah, Norman has written about why the symbols in the stack trace might not be right:

https://forum.xojo.com/44475-ios-project-from-xojo2017r1-won-t-run/p1#p361454

[quote=379739:@Michel Bujardet]I have come into the habit to remove the handler immediately after use, when possible.

For instance, in a timer, I will do addhandler just before starting the timer, and removehandler from within the handler method when I stop the timer or when it is in single mode. That way It don’t have to clean up in cancelclose or close.[/quote]

Agreed. So if the socket connects, then I do its thing and then remove the handler. But if the socket doesn’t connect then I need a way to remove it as well otherwise it would stick around.

[quote=379741:@Jason Parsley]Yeah, Norman has written about why the symbols in the stack trace might not be right:

https://forum.xojo.com/44475-ios-project-from-xojo2017r1-won-t-run/p1#p361454[/quote]
Cool. I’ll have to read that.

You could use a single timer which will be the timeout one. Set it to off in Connect, and if connect does not happen, then it fires.