Hi all i have a following code.
XML
<TableView id="detailstable"></TableView>js
Alloy.Globals.Underscore.each(restaruntdetails, function(element, Index) { var arg = { "id" : Index, "restimage" : restaruntdetails[Index].imageUrl[0], "restname" : restaruntdetails[Index].name, "restid" : restaruntdetails[Index].restaurantsId, "restaddress" : restaruntdetails[Index].city }; var row = Alloy.createController('row', arg).getView(); detailsarrayvalue.push(row); }); $.detailstable.visible = true; $.detailstable.setData(detailsarrayvalue);row.js
var ARG = arguments[0] || {}; $.restarentimage.image = ""; Alloy.Globals.ImageLoader.LoadRemoteImage($.restarentimage, ARG.restimage); $.restarentname.text = ARG.restname; $.address.text = ARG.restaddress;row.xml
<Alloy> <TableViewRow id="rowview"> <View id="detailsview"> <ImageView id="restarentimage"></ImageView> <Label id="restarentname"></Label> <Label id="address"></Label> <Button id="viewdetails">View</Button> </View> </TableViewRow> </Alloy>Image loader
function LoadRemoteImage(obj, url) { var xhr = Ti.Network.createHTTPClient(); xhr.onload = function() { // Ti.API.info('image data=' + this.responseData); obj.image = this.responseData; }; // open the client xhr.open('GET', url); // send the data xhr.send(); } exports.LoadRemoteImage = LoadRemoteImage;when i scroll the table i'm getting out of memory exception and my application crash's pls help me to handel images in tabelview in a better way