Articles Tagged 'NSURLRequest'

Very short snippet: NSConnection POST with parameters

che in modalità POST . The object NSMutableURLRequest can be used in either GET mode in POST . . The parameters, however, must be formatted as if they were in GET , ie in the sequence nome_campo1=valore1&nome_campo2=valore2&... . Here's a useful snippet to simplify the construction of fields:

Continued ...

UIWebView: catch the opening of a Link

The object UIWebView component is a very useful and versatile, ideal for solving many problems. Not only is perfect to display an HTML page on the net, but you can use it for other useful purposes such as:

  • Quickly display PDF documents
  • View videos or pictures
  • Display content HTML / CSS local
  • Contained in the prototype stage fake ...

Continued ...

Very short snippet: NSURL, and various possible

Returns the name of a file from the object NSURLRequest , allowing you to decide whether or not its extension:

Continued ...

NSURLConnection: Example of use

NSURLConnection allows for controlled from a connection to a remote server. To use it simply:

1
2
3
4
5
6
7
8
9
10
11
/ / The objects sufficient to perform a NSURLConnection
urlConnection; NSURLConnection * URLConnection;
mutableData; NSMutableData mutableData *;

/ / ...

urlString = @ "http://www.miodominio.com/documento.txt" ; NSString * urlString @ = "http://www.miodominio.com/documento.txt";

urlRequest = [ NSURLRequest requestWithURL : [ NSURL URLWithString : urlString ] ] ; NSURLRequest URLRequest = * [ NSURLRequest requestWithURL: [ NSURL URLWithString: urlString]];
/ / The delegate will respond to the states of the connection
NSURLConnection alloc ] initWithRequest : urlRequest delegate : self ] ; URLConnection = [[ NSURLConnection alloc] initWithRequest: URLRequest delegate: self];

Here are delegate methods to check the status of the connection:

[Cc_objc]

Continued ...

Very short snippet: UIWebView, and display PDF files inside

The object UIWebView can be used to display several files. For example you can use it to display - as well as QuickTime movies or YouTube - PDF or HTML file included in our code.

Continued ...

Very short snippet: streaming mp3 files on the Apple iPhone

An alternative very simple to run a stream a mp3 file on the Apple iPhone could be:

Continued ...


Stop SOPA