Titanium.Network.HTTPClient.setTimeout error on iphone

You must Login before you can answer or comment on any questions.

I'm still getting an error when trying to use setTimeout on Titanium.Network.HTTPClient on iPhone.

[ERROR] Script Error = *** -[NSCFNumber objectAtIndex:]: 
unrecognized selector sent to instance 0x509e910 at restaurant_detail.js 
(line 10).
The ticket is marked resolved in 1.1

https://appcelerator.lighthouseapp.com/projects/32238/tickets/543-xhr-settimeout-causes-runtime-error

Anyone else got this to work? What's the procedure for updating a ticket?

Using mobile SDK 1.1.0 and iphone os 3.1.3 on latest apple sdk

1 Answer

Accepted Answer

Hi,

The release notes don't have any information and even the lighthouse ticket isn't very descriptive in the answer. The status changed from new to resolved with no explanation and the docs aren't updated. Turns out you need to use an array in the method argument. Not sure why this is so, since you are only submitting one value. This works, although I haven't checked if the client really waits 10 seconds:

var xhr = Ti.Network.createHTTPClient();

xhr.setTimeout([10000]);

Hope that helps.

Bruce

Your Answer

Think you can help? Login to answer this question!