SlideShare a Scribd company logo
João Prado Maia Ipanema Labs, LLC http://ipanemalabs.com UIKit Programming (and some network stuff too)
Who? Web programmer by day, iOS developer by night. Consultant on iOS development projects. Contact me at  http://ipanemalabs.com Few apps on App Store since 2008. Personal site at  http://pessoal.org
Tonight’s session Hands on Lots of code to go through Ask questions at any time!
Table views Standard classes: UINavigationController UIViewController UITableViewController Goal: build a simple app with a drill down interface.
Saving data to SQLite FMDB! http://code.google.com/p/flycode/source/browse/trunk/fmdb Open source wrapper on top of SQLite. Actively maintained; easy to work with. Goal: change previous example to load information from a SQLite database.
Dealing with an API ASIHTTPRequest http://allseeing-i.com/ASIHTTPRequest/ Much more convenient than NSURLConnection. Open source; very easy to use. Goal: modify previous example to load data from an API dynamically.
ASIHTTPRequest Advanced features available to you in an easy to use wrapper: Download data to memory or directly to file Easy to upload files through POST Automatic progress indicators for downloads/uploads Asynchronous/Synchronous requests and persistent connections etc Good documentation with lots of examples
ASIHTTPRequest (2) - (IBAction)grabURL:(id)sender { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request startSynchronous]; NSError *error = [request error]; if (!error) { NSString *response = [request responseString]; } }
ASIHTTPRequest (3) - (IBAction)grabURLInBackground:(id)sender { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; } - (void)requestFinished:(ASIHTTPRequest *)request { // Use when fetching text data NSString *responseString = [request responseString]; // Use when fetching binary data NSData *responseData = [request responseData]; } - (void)requestFailed:(ASIHTTPRequest *)request { NSError *error = [request error]; }
JSON JSON - JavaScript Object Notation Serialization format much less verbose than XML Perfect for web services that need to return information for mobile clients iOS library: json-framework http://code.google.com/p/json-framework/ Open source (BSD) library
JSON (2) Serialized hash/dictionary: {“key1”: “value1”, “key2”: “value2”} Serialized array: [“value1”, “value2”, “value3”] Mixed object (array of dictionaries): [{“name”: “Joao”, “ssn”:”12345678”}, {“name”:”Barry”, “ssn”:”98765432”}]
JSON parsing example NSArray *list; NSString *jsonString = @"[\"Meetup\", \"is\", \"cool\"]"; list = [jsonString JSONValue]; NSLog(@"first entry: %@", [list objectAtIndex:0]); NSLog(@"second entry: %@", [list objectAtIndex:1]); NSLog(@"third entry: %@", [list objectAtIndex:2]); [json release];
Q&A Any questions?

More Related Content

What's hot (20)

PDF
Apache Sling as an OSGi-powered REST middleware
Robert Munteanu
 
PDF
xml-motor ~ What,Why,How
Abhishek Kumar
 
PDF
Active scripting
Makoto Kato
 
PDF
Django REST Framework
Load Impact
 
PDF
What Is Async, How Does It Work, And When Should I Use It?
emptysquare
 
PPTX
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Caktus Group
 
PDF
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
崇之 清水
 
PDF
I18n of java script
Junichi Shinohara
 
PDF
The First 10M Pulls: Building The Official Curl Image for Docker Hub
Docker, Inc.
 
PPTX
Introduction tomongodb
Lee Theobald
 
PDF
Unleashing the Rails Asset Pipeline
Kenneth Kalmer
 
PDF
Selenium sandwich-3: Being where you aren't.
Workhorse Computing
 
PDF
10 Useful Asciidoctor Tips
Andres Almiray
 
PDF
Nikola, a static blog & site generator python meetup 19 feb2014
Areski Belaid
 
PDF
Asciidoctor, because documentation does not have to suck
Andres Almiray
 
PDF
Lies, Damn Lies, and Benchmarks
Workhorse Computing
 
PPTX
From Web Developer to Hardware Developer
alexshenoy
 
PDF
Provisioning with Puppet
Joe Ray
 
PPTX
Broccoli.js presentation
John Fahey
 
PDF
aiohttp intro
Anton Kasyanov
 
Apache Sling as an OSGi-powered REST middleware
Robert Munteanu
 
xml-motor ~ What,Why,How
Abhishek Kumar
 
Active scripting
Makoto Kato
 
Django REST Framework
Load Impact
 
What Is Async, How Does It Work, And When Should I Use It?
emptysquare
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Caktus Group
 
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
崇之 清水
 
I18n of java script
Junichi Shinohara
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
Docker, Inc.
 
Introduction tomongodb
Lee Theobald
 
Unleashing the Rails Asset Pipeline
Kenneth Kalmer
 
Selenium sandwich-3: Being where you aren't.
Workhorse Computing
 
10 Useful Asciidoctor Tips
Andres Almiray
 
Nikola, a static blog & site generator python meetup 19 feb2014
Areski Belaid
 
Asciidoctor, because documentation does not have to suck
Andres Almiray
 
Lies, Damn Lies, and Benchmarks
Workhorse Computing
 
From Web Developer to Hardware Developer
alexshenoy
 
Provisioning with Puppet
Joe Ray
 
Broccoli.js presentation
John Fahey
 
aiohttp intro
Anton Kasyanov
 

Similar to Meetup uikit programming (20)

PDF
Developing iOS REST Applications
lmrei
 
PDF
Elements for an iOS Backend
Laurent Cerveau
 
PPT
iOS Multithreading
Richa Jain
 
PDF
Concurrent networking - made easy
Amazing Applications AB
 
KEY
Effective iOS Network Programming Techniques
Ben Scheirman
 
PDF
MFF UK - Advanced iOS Topics
Petr Dvorak
 
PPTX
iPhone Development For Experienced Web Developers
lisab517
 
PPT
Connecting to a REST API in iOS
gillygize
 
PPTX
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
MobileNepal
 
PDF
Webエンジニアから見たiOS5
Satoshi Asano
 
PDF
Adventures in Multithreaded Core Data
Inferis
 
PDF
iOS 2 - The practical Stuff
Petr Dvorak
 
PDF
FI MUNI 2012 - iOS Basics
Petr Dvorak
 
PDF
iPhone Coding For Web Developers
Matt Biddulph
 
PDF
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Fábio Pimentel
 
PDF
Working with AFNetworking
waynehartman
 
PDF
07 objective-c session 7
Amr Elghadban (AmrAngry)
 
PDF
iPhone: Http Connection
Jussi Pohjolainen
 
PDF
MFF UK - Introduction to iOS
Petr Dvorak
 
KEY
Hdc09 I Phone Dev Connecting To Web
Andy Peters
 
Developing iOS REST Applications
lmrei
 
Elements for an iOS Backend
Laurent Cerveau
 
iOS Multithreading
Richa Jain
 
Concurrent networking - made easy
Amazing Applications AB
 
Effective iOS Network Programming Techniques
Ben Scheirman
 
MFF UK - Advanced iOS Topics
Petr Dvorak
 
iPhone Development For Experienced Web Developers
lisab517
 
Connecting to a REST API in iOS
gillygize
 
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
MobileNepal
 
Webエンジニアから見たiOS5
Satoshi Asano
 
Adventures in Multithreaded Core Data
Inferis
 
iOS 2 - The practical Stuff
Petr Dvorak
 
FI MUNI 2012 - iOS Basics
Petr Dvorak
 
iPhone Coding For Web Developers
Matt Biddulph
 
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Fábio Pimentel
 
Working with AFNetworking
waynehartman
 
07 objective-c session 7
Amr Elghadban (AmrAngry)
 
iPhone: Http Connection
Jussi Pohjolainen
 
MFF UK - Introduction to iOS
Petr Dvorak
 
Hdc09 I Phone Dev Connecting To Web
Andy Peters
 
Ad

More from joaopmaia (7)

PPTX
AFNetworking
joaopmaia
 
PDF
Core Data presentation
joaopmaia
 
PDF
SQLite Techniques
joaopmaia
 
KEY
SQLite Techniques
joaopmaia
 
PPT
Web App Testing With Selenium
joaopmaia
 
PDF
Eventum Presentation
joaopmaia
 
PDF
Form Validation NG
joaopmaia
 
AFNetworking
joaopmaia
 
Core Data presentation
joaopmaia
 
SQLite Techniques
joaopmaia
 
SQLite Techniques
joaopmaia
 
Web App Testing With Selenium
joaopmaia
 
Eventum Presentation
joaopmaia
 
Form Validation NG
joaopmaia
 
Ad

Meetup uikit programming

  • 1. João Prado Maia Ipanema Labs, LLC http://ipanemalabs.com UIKit Programming (and some network stuff too)
  • 2. Who? Web programmer by day, iOS developer by night. Consultant on iOS development projects. Contact me at http://ipanemalabs.com Few apps on App Store since 2008. Personal site at http://pessoal.org
  • 3. Tonight’s session Hands on Lots of code to go through Ask questions at any time!
  • 4. Table views Standard classes: UINavigationController UIViewController UITableViewController Goal: build a simple app with a drill down interface.
  • 5. Saving data to SQLite FMDB! http://code.google.com/p/flycode/source/browse/trunk/fmdb Open source wrapper on top of SQLite. Actively maintained; easy to work with. Goal: change previous example to load information from a SQLite database.
  • 6. Dealing with an API ASIHTTPRequest http://allseeing-i.com/ASIHTTPRequest/ Much more convenient than NSURLConnection. Open source; very easy to use. Goal: modify previous example to load data from an API dynamically.
  • 7. ASIHTTPRequest Advanced features available to you in an easy to use wrapper: Download data to memory or directly to file Easy to upload files through POST Automatic progress indicators for downloads/uploads Asynchronous/Synchronous requests and persistent connections etc Good documentation with lots of examples
  • 8. ASIHTTPRequest (2) - (IBAction)grabURL:(id)sender { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request startSynchronous]; NSError *error = [request error]; if (!error) { NSString *response = [request responseString]; } }
  • 9. ASIHTTPRequest (3) - (IBAction)grabURLInBackground:(id)sender { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; } - (void)requestFinished:(ASIHTTPRequest *)request { // Use when fetching text data NSString *responseString = [request responseString]; // Use when fetching binary data NSData *responseData = [request responseData]; } - (void)requestFailed:(ASIHTTPRequest *)request { NSError *error = [request error]; }
  • 10. JSON JSON - JavaScript Object Notation Serialization format much less verbose than XML Perfect for web services that need to return information for mobile clients iOS library: json-framework http://code.google.com/p/json-framework/ Open source (BSD) library
  • 11. JSON (2) Serialized hash/dictionary: {“key1”: “value1”, “key2”: “value2”} Serialized array: [“value1”, “value2”, “value3”] Mixed object (array of dictionaries): [{“name”: “Joao”, “ssn”:”12345678”}, {“name”:”Barry”, “ssn”:”98765432”}]
  • 12. JSON parsing example NSArray *list; NSString *jsonString = @"[\"Meetup\", \"is\", \"cool\"]"; list = [jsonString JSONValue]; NSLog(@"first entry: %@", [list objectAtIndex:0]); NSLog(@"second entry: %@", [list objectAtIndex:1]); NSLog(@"third entry: %@", [list objectAtIndex:2]); [json release];