Upload
chalermchon-sommana
View
763
Download
0
Embed Size (px)
DESCRIPTION
iphone nsurlconnection webservice with case study XPLog's web service see more android/iOS application Development : http://adayd3sign.wordpress.com/ join me : http://www.brightest-idea.com
Citation preview
iPhone Application Development Course
NSURLConnection(Case study)
Mr.Chalermchon SommanaBrightest IDEADate: 9 May 2011
Outline
●Connect URL●Receive Data from URL change to XML Parser●Read XML Parser●Create Class for XML●Present XML Data
Overview
MySQL
PHP
iPhone
Connect URL
XML
Query database
Connect URL
●Case Study web service URL● http://203.185.96.228/sarakham2011/xplog/showFollowLike.php● http://203.185.96.228/sarakham2011/xplog/checkLogin.php
●Create NSURL with string●URLRequest●Connection and set delegate
NSURLConnection delegate
●Start connectiondidReceiveResponse
●Receive data from URLdidReceiveData
●End connectionconnectionDidFinishLoading
●Error reportdidFailWithError
XMLParser delegate
●Start DocumentparserDidStartDocument
●Start ElementdidStartElement
●CharacterfoundCharacters
●End ElementdidEndElement
●End DocumentparserDidEndDocument
XML Structure
http://203.185.96.228/sarakham2011/xplog/showFollowLike.php
<ShowTopi cFol l owLi ke> <t opi c>
<t _i d>14238</ t _i d> <t _t i t l e>ตรอกบ้านจีน</ t _t i t l e> <s t ar >45</ s t ar > <s our ce>0111110952426710112. j pg</ s our ce> <des c>กดดูรายละเอียด</ des c>
</ t opi c> …
</ ShowTopi cFol l owLi ke>
Custom Class: Topic
Topic Class:{NSInteger tid,star;NSString *tTitle,*tSource,*tDesc;
}
Workshop
iPhone Application Development Course
NSURLConnectionContact usBrightest IDEA: http://www.brightest-idea.com
Mr.Chalermchon SommanaBlog: http://adayd3sign.wordpress.comThank you.
Connection Source code
Connection Source code (2)
XMLParser Source code
XMLParser Source code (2)
XMLParser Source code (3)
Topic Class Source code