Posts

Showing posts from June, 2010

WebServices solution for iPhone - First Stage

The FileDownload Class After reviewing some examples of how to download a file from an URL and after implementing it by myself, I came to the idea to do it as a separate class. The objective of the new class was to handle the connection and processing needed to do the job. The published methods are: - ( FileDownload *) initWithURL:( NSString *)url callBack:( id < FileDownloadProtocol >)delegate; This initializer is used to immediately start the download process given the desired URL to download and the delegate, which is the object which will receive the downloaded data. Its implementation is as follows: /** Initialize with file to download **/ - ( FileDownload *)initWithURL:( NSString *)url callBack:( id < FileDownloadProtocol >)delegate { [ self init ]; [ self startDownloadFile :url callBack :delegate]; return self ; } I’m not checking if the object was created successfully before starting the download, that’s a to do activity for one day. - ( vo...

My WebServices solution for iPhone

I got into the necessity to call WebServices from within an iPhone application I was designing. After a small search with Google I found different implementations, even a “C” (or C++ I can’t recall) library, but nothing like the “easy way” used in Dot Net. My specific application needs to show address book, kind of, information in a table. Each row shows the contact’s picture and name; when selected, in a second screen, detailed information will be show. This functionality is similar to the contacts' section of Facebook or LinkedIn application. The source information has to be gathered from a WebService. Note: I will focus these articles in the WebService consumption, instead of the Graphical development and application logic. For simplification, the WebService contract will be: 1.List screen An XLM with up to 100 results with the next structure: <contact> <contactid>id for this item</contactid> <photo>Url of contact’s photo</photo> ...