Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9639] IOS: Network module crash

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-06-19T13:58:45.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-13 API
ComponentsiOS
Labelsapi, module_network, qe-testadded
ReporterVishal Duggal
AssigneeVishal Duggal
Created2012-06-19T13:06:57.000+0000
Updated2012-07-03T15:47:10.000+0000

Description

Noticed while running the test case from TIMOB-8906 that the simulator automatically exits. Getting BAD_ACCESS in XCode in the_destroy method of Network Module

Comments

  1. Michael Pettiford 2012-06-19

    Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK 2.1.0.v20120619142258 hash r5982b78e OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown *QE use the code below when porting this*
       var win1 = Ti.UI.createWindow({
           backgroundColor: 'white',
       });
       var text = Ti.UI.createLabel({
           text: '',
       });
       win1.add(text);
       win1.open();
       charsetTest("http://kangaechu.com/utf8.html");
       charsetTest("http://kangaechu.com/shiftjis.html");
       charsetTest("http://kangaechu.com/eucjp.html");
       charsetTest("http://kangaechu.com/iso2022jp.html");
        
       function charsetTest(url){
           var xhr = Ti.Network.createHTTPClient();
            
           xhr.onload = function() {
               if(this.status == 200) {
                   var html = this.responseText;
                   if(html == null){
                       text.text = text.text + url + ' is null.\n\n';
                   }
                   else if(html.match(/<body>([\s\S]*)<\/body>/)){
                       var body = RegExp.$1;
                       text.text = text.text + url + body;
                   }else{
                       text.text = text.text + url + ' is 200, but no body element.\n\n';
                   }
               }else{
                   text.text = text.text + url + ' status code is ' + this.status + '\n\n';
               }
           };
           xhr.onerror = function() {
               text.text = text.text + url + ' status code is ' + this.status + '\n\n';
        
           };
           xhr.open("GET", url, false);
           xhr.send();
            
       }
       

JSON Source