I'm writing an iPhone app for a web service and I need to upload image to the service. In the web version, it's using AJAX. But I know little about that. I find the following code on the web page for the upload button:
if (button.length) {
new AjaxUpload(button, {
action: '/Media/UploadFile',
responseType: 'json',
onSubmit: function (file, ext) {
$('#bBar').progressBar(0);
var uid = createUUID();
timerID = setTimeout(function () { checkImageUploadProgress(uid, 1, 'image') }, 1000);
startUpload();
this.setData({ fileType: 1, guid: uid, DJUploadStatus: '::DJ_UPLOAD_ID::' + uid });
},
onComplete: function (file, response) {
}
});
}
How should I implement this function using the NSConnection class?