Enviar búsqueda
Cargar
iOS for ERREST - alternative version
•
0 recomendaciones
•
891 vistas
W
WO Community
Seguir
Tecnología
Educación
Denunciar
Compartir
Denunciar
Compartir
1 de 25
Descargar ahora
Descargar para leer sin conexión
Recomendados
ERGroupware
ERGroupware
WO Community
Beginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCA
Whymca
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
David Lapsley
Client-side Rendering with AngularJS
Client-side Rendering with AngularJS
David Lapsley
iOS5 NewStuff
iOS5 NewStuff
deenna_vargilz
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
David Lapsley
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
ITGinGer
Omnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the Things
Justin Edelson
Recomendados
ERGroupware
ERGroupware
WO Community
Beginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCA
Whymca
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
David Lapsley
Client-side Rendering with AngularJS
Client-side Rendering with AngularJS
David Lapsley
iOS5 NewStuff
iOS5 NewStuff
deenna_vargilz
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
David Lapsley
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
ITGinGer
Omnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the Things
Justin Edelson
Core Data with multiple managed object contexts
Core Data with multiple managed object contexts
Matthew Morey
iOSDevCamp 2011 Core Data
iOSDevCamp 2011 Core Data
Chris Mar
Oak Lucene Indexes
Oak Lucene Indexes
Chetan Mehrotra
20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final
David Lapsley
Taming the beast - how to tame React & GraphQL, one error at a time
Taming the beast - how to tame React & GraphQL, one error at a time
Susanna Wong
20140821 delapsley-cloudopen-public
20140821 delapsley-cloudopen-public
David Lapsley
High Performance Core Data
High Performance Core Data
Matthew Morey
20120121
20120121
komarineko
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
Create a Core Data Observer in 10mins
Create a Core Data Observer in 10mins
zmcartor
Demystifying Oak Search
Demystifying Oak Search
Justin Edelson
Memory Management on iOS
Memory Management on iOS
Make School
Persisting Data on SQLite using Room
Persisting Data on SQLite using Room
Nelson Glauber Leal
iOS Memory Management Basics
iOS Memory Management Basics
Bilue
Memory management in Objective C
Memory management in Objective C
Neha Gupta
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
Min Ming Lo
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
Inferis
Using redux and angular 2 with meteor
Using redux and angular 2 with meteor
Ken Ono
Arquitetando seu aplicativo Android com Jetpack
Arquitetando seu aplicativo Android com Jetpack
Nelson Glauber Leal
Migrating existing Projects to Wonder
Migrating existing Projects to Wonder
WO Community
Build and deployment
Build and deployment
WO Community
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
WO Community
Más contenido relacionado
La actualidad más candente
Core Data with multiple managed object contexts
Core Data with multiple managed object contexts
Matthew Morey
iOSDevCamp 2011 Core Data
iOSDevCamp 2011 Core Data
Chris Mar
Oak Lucene Indexes
Oak Lucene Indexes
Chetan Mehrotra
20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final
David Lapsley
Taming the beast - how to tame React & GraphQL, one error at a time
Taming the beast - how to tame React & GraphQL, one error at a time
Susanna Wong
20140821 delapsley-cloudopen-public
20140821 delapsley-cloudopen-public
David Lapsley
High Performance Core Data
High Performance Core Data
Matthew Morey
20120121
20120121
komarineko
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
Create a Core Data Observer in 10mins
Create a Core Data Observer in 10mins
zmcartor
Demystifying Oak Search
Demystifying Oak Search
Justin Edelson
Memory Management on iOS
Memory Management on iOS
Make School
Persisting Data on SQLite using Room
Persisting Data on SQLite using Room
Nelson Glauber Leal
iOS Memory Management Basics
iOS Memory Management Basics
Bilue
Memory management in Objective C
Memory management in Objective C
Neha Gupta
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
Min Ming Lo
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
Inferis
Using redux and angular 2 with meteor
Using redux and angular 2 with meteor
Ken Ono
Arquitetando seu aplicativo Android com Jetpack
Arquitetando seu aplicativo Android com Jetpack
Nelson Glauber Leal
La actualidad más candente
(19)
Core Data with multiple managed object contexts
Core Data with multiple managed object contexts
iOSDevCamp 2011 Core Data
iOSDevCamp 2011 Core Data
Oak Lucene Indexes
Oak Lucene Indexes
20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final
Taming the beast - how to tame React & GraphQL, one error at a time
Taming the beast - how to tame React & GraphQL, one error at a time
20140821 delapsley-cloudopen-public
20140821 delapsley-cloudopen-public
High Performance Core Data
High Performance Core Data
20120121
20120121
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Create a Core Data Observer in 10mins
Create a Core Data Observer in 10mins
Demystifying Oak Search
Demystifying Oak Search
Memory Management on iOS
Memory Management on iOS
Persisting Data on SQLite using Room
Persisting Data on SQLite using Room
iOS Memory Management Basics
iOS Memory Management Basics
Memory management in Objective C
Memory management in Objective C
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
Using redux and angular 2 with meteor
Using redux and angular 2 with meteor
Arquitetando seu aplicativo Android com Jetpack
Arquitetando seu aplicativo Android com Jetpack
Destacado
Migrating existing Projects to Wonder
Migrating existing Projects to Wonder
WO Community
Build and deployment
Build and deployment
WO Community
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
WO Community
iOS for ERREST
iOS for ERREST
WO Community
Filtering data with D2W
Filtering data with D2W
WO Community
Unit Testing with WOUnit
Unit Testing with WOUnit
WO Community
Advanced Apache Cayenne
Advanced Apache Cayenne
WO Community
Apache Cayenne for WO Devs
Apache Cayenne for WO Devs
WO Community
WOver
WOver
WO Community
D2W Stateful Controllers
D2W Stateful Controllers
WO Community
Life outside WO
Life outside WO
WO Community
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real World
WO Community
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
WO Community
Deploying WO on Windows
Deploying WO on Windows
WO Community
KAAccessControl
KAAccessControl
WO Community
High availability
High availability
WO Community
"Framework Principal" pattern
"Framework Principal" pattern
WO Community
In memory OLAP engine
In memory OLAP engine
WO Community
Destacado
(18)
Migrating existing Projects to Wonder
Migrating existing Projects to Wonder
Build and deployment
Build and deployment
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
iOS for ERREST
iOS for ERREST
Filtering data with D2W
Filtering data with D2W
Unit Testing with WOUnit
Unit Testing with WOUnit
Advanced Apache Cayenne
Advanced Apache Cayenne
Apache Cayenne for WO Devs
Apache Cayenne for WO Devs
WOver
WOver
D2W Stateful Controllers
D2W Stateful Controllers
Life outside WO
Life outside WO
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real World
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
Deploying WO on Windows
Deploying WO on Windows
KAAccessControl
KAAccessControl
High availability
High availability
"Framework Principal" pattern
"Framework Principal" pattern
In memory OLAP engine
In memory OLAP engine
Similar a iOS for ERREST - alternative version
201104 iphone navigation-based apps
201104 iphone navigation-based apps
Javier Gonzalez-Sanchez
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Mobivery
I os 11
I os 11
信嘉 陳
I os 04
I os 04
信嘉 陳
Understanding backbonejs
Understanding backbonejs
Nick Lee
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Mobivery
iOS Testing
iOS Testing
Derrick Chao
iOS Beginners Lesson 4
iOS Beginners Lesson 4
Calvin Cheng
Backbone js
Backbone js
husnara mohammad
前端MVC 豆瓣说
前端MVC 豆瓣说
Ting Lv
UIWebView Tips
UIWebView Tips
Katsumi Kishikawa
Swift Tableview iOS App Development
Swift Tableview iOS App Development
Ketan Raval
Apple Templates Considered Harmful
Apple Templates Considered Harmful
Brian Gesiak
Xamarin: Introduction to iOS 8
Xamarin: Introduction to iOS 8
Xamarin
iOS
iOS
Scott Leberknight
UI testing in Xcode 7
UI testing in Xcode 7
Dominique Stranz
Your Second iPhone App - Code Listings
Your Second iPhone App - Code Listings
Vu Tran Lam
AngularJS.part1
AngularJS.part1
Andrey Kolodnitsky
Practical Model View Programming (Roadshow Version)
Practical Model View Programming (Roadshow Version)
Marius Bugge Monsen
For mobile 5/13'
For mobile 5/13'
Jakub Hladík
Similar a iOS for ERREST - alternative version
(20)
201104 iphone navigation-based apps
201104 iphone navigation-based apps
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
I os 11
I os 11
I os 04
I os 04
Understanding backbonejs
Understanding backbonejs
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
iOS Testing
iOS Testing
iOS Beginners Lesson 4
iOS Beginners Lesson 4
Backbone js
Backbone js
前端MVC 豆瓣说
前端MVC 豆瓣说
UIWebView Tips
UIWebView Tips
Swift Tableview iOS App Development
Swift Tableview iOS App Development
Apple Templates Considered Harmful
Apple Templates Considered Harmful
Xamarin: Introduction to iOS 8
Xamarin: Introduction to iOS 8
iOS
iOS
UI testing in Xcode 7
UI testing in Xcode 7
Your Second iPhone App - Code Listings
Your Second iPhone App - Code Listings
AngularJS.part1
AngularJS.part1
Practical Model View Programming (Roadshow Version)
Practical Model View Programming (Roadshow Version)
For mobile 5/13'
For mobile 5/13'
Más de WO Community
Localizing your apps for multibyte languages
Localizing your apps for multibyte languages
WO Community
WOdka
WOdka
WO Community
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
WO Community
CMS / BLOG and SnoWOman
CMS / BLOG and SnoWOman
WO Community
Using GIT
Using GIT
WO Community
Persistent Session Storage
Persistent Session Storage
WO Community
Back2 future
Back2 future
WO Community
WebObjects Optimization
WebObjects Optimization
WO Community
Dynamic Elements
Dynamic Elements
WO Community
Practical ERSync
Practical ERSync
WO Community
ERRest: the Basics
ERRest: the Basics
WO Community
Más de WO Community
(11)
Localizing your apps for multibyte languages
Localizing your apps for multibyte languages
WOdka
WOdka
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
CMS / BLOG and SnoWOman
CMS / BLOG and SnoWOman
Using GIT
Using GIT
Persistent Session Storage
Persistent Session Storage
Back2 future
Back2 future
WebObjects Optimization
WebObjects Optimization
Dynamic Elements
Dynamic Elements
Practical ERSync
Practical ERSync
ERRest: the Basics
ERRest: the Basics
Último
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
The Digital Insurer
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
jfdjdjcjdnsjd
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
SynarionITSolutions
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Khem
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DianaGray10
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
The Digital Insurer
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
lior mazor
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Último
(20)
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
iOS for ERREST - alternative version
1.
iOS REST Client Paul
Lynch @pauldlynch, paul@plsys.co.uk
2.
• Architecture of
iOS apps • Comet Architecture • Model Implementation • Controller Implementation • Other iOS Concepts iOS REST Client
3.
Architecture of iOS
apps • MVC - Model/View/Controller • Objective C • Foundation • UIKit - UIApplication, UIViewController, UIView, UIControl
4.
Foundation • NSArray, NSDictionary,
NSSet • NSValue • NSPredicate
5.
UIKit - UIApplication •
UIApplication • status bar • window • orientation • AppDelegate applicationDidFinishLaunchingWithOptions: notifications - UIApplicationWillEnterForegroundNotification, UIApplicationDidEnterBackgroundNotification
6.
UIView • animations • gestures
7.
View Controllers • -
(id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle • navigationController, tabBarController • rotation, transitions • subclasses - e.g. UITableViewController
8.
TableViews • UITableViewController • UITableView •
data source • delegate • UITableViewCell
9.
Table view data
source @protocol UITableViewDataSource<NSObject> - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section; ... @end @interface NSIndexPath (UITableView) + (NSIndexPath *)indexPathForRow:(NSInteger)row inSection:(NSInteger)section; @property(nonatomic,readonly) NSInteger section; @property(nonatomic,readonly) NSInteger row; @end
10.
Table view delegate @protocol
UITableViewDelegate<NSObject, UIScrollViewDelegate> ... - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath; ... - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; ... @end
11.
Comet Architecture
12.
Comet Architecture Marketing db Reviews WO db XML Linux,
mySQL Change Report Mobile clients
13.
Comet Database Features: skunum,
runId; xml/json held as strings Category SKU Review WC7SKU Client
14.
REST API • category
- parent, children • sku • skudetail - contains full review and XML text • brand - attribute of sku
15.
ERREST Routes
routeRequestHandler.addRoute(new ERXRoute(Sku.ENTITY_NAME, "/sku", ERXRoute.Method.Options, SkuController.class, "options")); routeRequestHandler.addRoute(new ERXRoute(Sku.ENTITY_NAME, "/sku", ERXRoute.Method.Head, SkuController.class, "head")); routeRequestHandler.addRoute(new ERXRoute(Sku.ENTITY_NAME, "/sku", ERXRoute.Method.All, SkuController.class, "index")); // MS: this only works with numeric ids routeRequestHandler.addRoute(new ERXRoute(Sku.ENTITY_NAME, "/sku/{action:identifier}", ERXRoute.Method.Get, SkuController.class)); routeRequestHandler.addRoute(new ERXRoute(Sku.ENTITY_NAME, "/sku/{sku:Sku}", ERXRoute.Method.Get, SkuController.class, "show")); routeRequestHandler.addRoute(new ERXRoute(Sku.ENTITY_NAME, "/sku/{sku:Sku}/{action:identifier}", ERXRoute.Method.All, SkuController.class)); plus Category, Brand, Skudetail
16.
Model Implementation • PLRestful •
CometAPI • Sku (etc)
17.
PLRestful typedef void (^PLRestfulAPICompletionBlock)(PLRestful
*api, id object, NSInteger status, NSError *error); @interface PLRestful : NSObject @property (nonatomic, copy) NSString *endpoint; @property (nonatomic, copy) PLRestfulAPICompletionBlock completionBlock; @property (nonatomic, copy) NSString *username; @property (nonatomic, copy) NSString *password; @property (nonatomic, assign) BOOL useBasicAuthentication; + (NSString *)messageForStatus:(NSInteger)status; + (BOOL)checkReachability:(NSURL *)url; + (void)get:(NSString *)requestPath parameters:(NSDictionary *)parameters completionBlock:(PLRestfulAPICompletionBlock)completion; + (void)post:(NSString *)requestPath content:(NSDictionary *)content completionBlock:(PLRestfulAPICompletionBlock)completion; - (void)get:(NSString *)requestPath parameters:(NSDictionary *)parameters completionBlock:(PLRestfulAPICompletionBlock)completion; - (void)post:(NSString *)requestPath content:(NSDictionary *)content completionBlock:(PLRestfulAPICompletionBlock)completion; @end
18.
PLRestful - get -
(void)get:(NSString *)requestString parameters:(NSDictionary *)parameters completionBlock: (PLRestfulAPICompletionBlock)completion { NSURL *requestURL = [[NSURL URLWithString:endpoint] urlByAddingPath:requestString parameters:parameters]; NSLog(@"get: '%@'", [requestURL absoluteString]); NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL]; [request setHTTPMethod:@"GET"]; [self handleRequest:request completion:(PLRestfulAPICompletionBlock)completion]; }
19.
PLRestful - post -
(void)post:(NSString *)requestString content:(NSDictionary *)content completionBlock:(PLRestfulAPICompletionBlock)completion { NSURL *requestURL = [[NSURL URLWithString:endpoint] urlByAddingPath:requestString parameters:nil]; NSLog(@"post: '%@'", [requestURL absoluteString]); NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL]; [request setHTTPMethod:@"POST"]; NSError *error = nil; request.HTTPBody = [NSJSONSerialization dataWithJSONObject:content options:0 error:&error]; if (error) { NSLog(@"json generation failed: %@", error); [self callCompletionBlockWithObject:nil status:0 error:[NSError errorWithDomain:@"com.plsys.semaphore.CometAPI" code:1003 userInfo:nil]]; return; } [self handleRequest:request completion:completion]; }
20.
Controller Implementation • SkuController •
subclass of UITableViewController
21.
SkuController - data
source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [skus count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSDictionary *sku = [skus objectAtIndex:indexPath.row]; static NSString *CellIdentifier = @"SkuCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; } // Configure the cell... cell.textLabel.text = [[sku valueForKey:@"productName"] pl_stringByStrippingHTML]; cell.detailTextLabel.text = [sku valueForKey:@"skuNum"]; id image = [images objectAtIndex:indexPath.row]; if ([image isKindOfClass:[UIImage class]]) { cell.imageView.image = image; } return cell; }
22.
SkuController - tv
delegate - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { NSDictionary *sku = [skus objectAtIndex:indexPath.row]; NSString *skuNum = [[sku valueForKey:@"skuNum"] copy]; NSLog(@"tapped: %@", skuNum); SkuDetail *view = [[SkuDetail alloc] initWithStyle:UITableViewStylePlain]; view.sku = sku; view.image = [images objectAtIndex:indexPath.row]; [self.navigationController pushViewController:view animated:YES]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self tableView:tableView accessoryButtonTappedForRowWithIndexPath:indexPath]; } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == ((batch + 1)*25)-1) { // time to fetch more self.batch = ++batch; NSMutableDictionary *batchParameters = [parameters mutableCopy]; if (!batchParameters) batchParameters = [NSMutableDictionary dictionary]; [batchParameters setObject:[NSNumber numberWithInt:batch] forKey:@"batch"]; NSLog(@"batchParameters %@", batchParameters); [CometAPI get:query parameters:batchParameters completionBlock:^(PLRestful *api, id object, NSInteger status, NSError *error) { if (error) [self handleError:error]; else { [self didAddSkus:object]; } }]; } }
23.
Other iOS Topics •
Human Interface Guidelines • Buttons - 44x44 • Gestures • Controllers - mail, movie, picker • Other UIControls - switch, slider, page control • iOS 7
24.
Code Example • SOE
Status • http://github.com/pauldlynch/SOEStatus • older version, will update soon
25.
Q&A Paul Lynch paul@plsys.co.uk @pauldlynch
Descargar ahora