• This repository has been archived on 05/Oct/2018
  • Stars
    star
    297
  • Rank 140,075 (Top 3 %)
  • Language
    Objective-C
  • License
    BSD 4-Clause "Ori...
  • Created almost 15 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This project showcases different transport formats and libraries to consume web services from an iOS application.

iPhone Web Services Consumption Comparison

Introduction

This project showcases different transport formats and libraries to consume web services from an iPhone application. It features a server application, a command-line script that saves the output of the server application in different formats, and an iPhone client application (compatible with iPhone OS 3.0 and higher).

The server application (written in PHP) reads a MySQL database (Server/data/schema.sql) and outputs data in the following formats:

  • HTML
  • JSON
  • YAML
  • XML (arbitrary format)
  • SOAP
  • Property list
    • Binary property list
    • XML property list
  • CSV
  • Protocol Buffer (Google)

For each output format, there is a single β€œFormatter” subclass in the Server/formatters folder. A static method in the FormatterFactory class returns the formatter that corresponds to the requested output format.

Future Extensions

In future versions of this project, the following formats and libraries could be integrated:

Libraries Used

The project uses several different libraries:

For the server:

  • cfpropertylist – A PHP Implementation Of Apple’s plist (PropertyList).
  • NuSOAP – SOAP Toolkit for PHP.
  • spyc – A simple YAML loader/dumper class for PHP.
  • pb4php – Protocol Buffer for PHP

For the iPhone client:

  • AFNetworking – a very fast, NSOperation-based networking library
  • NextiveJSON – a very fast JSON parsing library
  • ASIHTTPRequest – wrapper around the CFNetwork API, no longer maintained
  • json-framework – A strict JSON parser/generator for Objective-C.
  • JSONKit – A Very High Performance Objective-C JSON Library.
  • YAJL-objc – Objective-C bindings for the YAJL parser.
  • BSJSON – A simple JSON parser in Objective-C.
  • touchcode – Repository of iPhone and iPod Touch source code.
  • cCSVParse – A CSV parsing library in Objective-C.
  • TBXML V1.3 – XML Parser by Tom Bradley.
  • KissXML – KissXML is a replacement for Cocoa’s NSXML cluster of classes. It is based on libxml.
  • TinyXML – TinyXML is a simple, small, C++ XML parser that can be easily integrating into other programs.
  • gdata-objectivec-client – XML support classes included in the Google Data APIs Objective-C Client Library.
  • APXML – NSXMLDocument ’substitute’ for iPhone/iPod Touch.
  • ProtocolBuffers – Objective-C Protocol Buffers for OSX and the iPhone.
  • AQXMLParser – Another parser for XML in Objective-C.
  • InAppSettingsKit – Library allowing to access the current setting bundle from the application.

YAML in Cocoa

For parsing YAML in Cocoa, the code in this page was adapted, removing dependencies on the Cocoa AppKit framework (not available on the iPhone).

If you want to compile the YAML::Syck library with Fink, follow these steps:

  1. Install Fink on Mac OS X 10.6 from source following these instructions (there is no binary installer available for Snow Leopard at the time of this writing).
  2. Type β€œ/sw/bin/fink install syck” to install syck.
  3. The Xcode project should now compile without problems.

To avoid these steps above, this project includes a version of libsyck.a already compiled as a β€œfat binary” format for both ARM (iPhone OS) and Intel (Simulator) processors.

SOAP in Cocoa

The wsdl2objc tool was used to generate Objective-C (Cocoa) code from the server’s WSDL. This code was later adapted to parse the array returned by the server.

Installation

  1. Set up the server:
    1. Upload the β€œServer” folder contents via FTP or other means.
    2. Create a MySQL database.
    3. Import the β€œServer/data/schema.sql” file into the database. This will create a β€œdata” table in the database.
    4. Change the settings in the β€œServer/data/database.php” file to access the database (server, username, password).
  2. Set up the client:
    1. Open the β€œClient/Client.xcodeproj” project in Xcode.
    2. Compile the project.
    3. Execute the client, which will connect to your server and retrieve data.
    4. If required, change the URL of the remote data tapping the β€œSettings” button in the interface.

Other Links

The application icon and splash screen have been adapted from this picture.

License

This project is released with a liberal BSD license. See the LICENSE file for details.

More Repositories

1

SwiftMoment

A time and calendar manipulation library for iOS 9+, macOS 10.11+, tvOS 9+, watchOS 2+ written in Swift 4.
Swift
1,612
star
2

nib2objc

Set of tools and utilities (command line, GUI, Mac Service) to transform NIB files for the iPhone into Objective-C code files
Objective-C
1,131
star
3

CoreTextWrapper

An Objective-C wrapper around Core Text for creating multi-column text and loading custom fonts
Objective-C
539
star
4

eBook-Template

Template to create PDF, ePub and Kindle books with Asciidoctor
CSS
179
star
5

Senbei

An iPhone client for Fat Free CRM
Objective-C
155
star
6

iphonerestwrapper

This is an Xcode project (for iPhone), showing an Objective-C class (called Wrapper) which can be used to interact with remote REST web services.
Objective-C
152
star
7

async-uitableview

Sample project using the ASIHTTPRequest to load the public Flickr RSS feed, and then load the images in a UITableView in asynchronous fashion
Objective-C
134
star
8

PracticalCommonLisp_ePub

"Practical Common Lisp" by Peter Seibel in ePub format
HTML
118
star
9

bluewoki

A simple Bluetooth-based walkie-talkie for iOS using GameKit
Objective-C
99
star
10

iphone-keypad

A highly sloppy copy of Apple's own iPhone keypad
Objective-C
48
star
11

editorrific

This project features a simple editor similar to the one used in the Twitterriffic iPhone application.
Objective-C
46
star
12

cortito

Cortito - URL Shortener written in PHP
PHP
43
star
13

imagecachetest

This iPhone application is inspired on Alex Curylo’s article about the problems of UIImage’s imageNamed: method.
Objective-C
40
star
14

Sencha-Touch-2-Up-And-Running

Code of the book "Sencha Touch 2: Up and Running" published by O'Reilly
JavaScript
39
star
15

PlaygroundBookGenerator

Ruby scripts that can generate a whole Swift Playgrounds for iPad book from a Markdown file
Ruby
36
star
16

fontbrowser

iPhone Font Browser - This iPhone application is based on code from the Under the Bridge blog and allows users and developers to browse and play with the fonts available in the iPhone OS.
Objective-C
36
star
17

cocoarestwrapper

This is an Xcode project (for Mac OS X), showing an Objective-C class (called Wrapper) which can be used to interact with remote REST web services.
Objective-C
36
star
18

AKCascadingStyle

This project provides a simple framework to centralize style information (fonts, colors, etc) in iPhone and Mac applications.
Objective-C
29
star
19

EasyTableView

A set of UITableViewController and UINavigationController subclasses for quickly prototyping iPhone applications.
Objective-C
28
star
20

Mobile-JavaScript-Application-Development

Code of the book "Mobile JavaScript Application Development" published by O'Reilly
JavaScript
24
star
21

opengles2-xcode-book

This project contains sample code taken from the "OpenGL ES 2.0 Programming Guide" book, by Aaftab Munshi, Dan Ginsburg and Dave Shreiner, adapted for Xcode and the iPhone OS 3.0
Objective-C
21
star
22

iphonestripview

Sample project using a UIKit-based strip component, like those featured in the LinkedIn and Facebook applications.
20
star
23

CodeaCalc

A very simple calculator made with Codea on the iPad
Lua
19
star
24

TwitThis

Sample project showing a helper class which wraps the complexity of having to deal with many different Twitter clients from the same iPhone application
Objective-C
13
star
25

Lorenz

iPhone OS + Mac OS X (app + screen saver) implementation in OpenGL ES 1.1 of the Lorenz Attractor
Objective-C
10
star
26

django-blog-engine

A minimalistic blog application, done as a learning exercise of both Python and the Django Framework.
Python
7
star
27

Backlog

The demo application I showed at the iPhone Dev Day 2009
Objective-C
6
star
28

AKOLibrary

iOS Framework used in projects by akosma software
Objective-C
5
star
29

remproject

The project aims to the creation of an UML tool suitable both for academia and the industry, including Ivar Jacobson's proposed extensions for Aspect-Oriented Software Development (AOSD).
C++
5
star
30

CodeaSort

Implementation of sorting algorithms in Lua, for Codea
Lua
5
star
31

DelegateOrder

Project showing how to determine delegate object method call in Objective-C with NSProxy
Objective-C
5
star
32

GoogleReaderShared

A simple command-line utility for reading and parsing "shared" items in Google Reader
Ruby
4
star
33

Sencha-Touch-2-Minimal-MVC

Minimal Sencha Touch 2 MVC application, as created live during SwissJeese 2012
JavaScript
4
star
34

Swift-Presentation

Cocoa framework used to present Swift
Swift
4
star
35

swift-linux-docker

The Dockerfile and other stuff required to build a complete Swift on Linux Docker image
Shell
3
star
36

SwiftTribool

3-state boolean library for Swift, inspired in Boost.Tribool
Swift
3
star
37

CortitoService

A Mac OS X Service for shortening URLs with cortito
Objective-C
3
star
38

akosma.github.com

My personal Github page
3
star
39

omxplayerphp

Driving omxplayer through PHP on a Raspberry Pi
PHP
3
star
40

FakePhoneGap

Simple implementation of PhoneGap for teaching purposes
Objective-C
3
star
41

RooiFonts

Simple font manager for iOS
Objective-C
3
star
42

SwissAlert

An iPhone application to have the most important Swiss emergency phones at hand
JavaScript
2
star
43

TeachingEditor

JavaScript-based web editor that can be shared with students learning about mobile web apps
JavaScript
2
star
44

omxplayernode

Node.js + Express + socket.io interface for omxplayer on a Raspberry Pi.
JavaScript
2
star
45

akosma

My GitHub profile
2
star
46

iBeacon-Presentation

This presentation is about iBeacon - a new technology based on Bluetooth - for both iOS and Android smartphones and tablets.
Objective-C
2
star
47

Notitas

Simple post-it application for iOS
Objective-C
2
star
48

Markdown-Presentation-Template

Template for creating presentations using Markdown
JavaScript
1
star
49

dvdrental

A fictional movie rental system written in C++, built as an assignment during my master's degree.
C++
1
star
50

Accessible

A demo app covering some iOS 10 Accessibility features, shown in the Mobile Developers Summit Bangalore 2016
Swift
1
star
51

digital2.0

Objective-C
1
star
52

DeviceDNA

Application used to send UDID via e-mail
Objective-C
1
star
53

MinimalisticSwiftBrowser

Minimalistic Browser application for OS X built with Swift. Built on the shoulder of giants.
Swift
1
star
54

actsasmanifesto

Ruby on Rails plugin to change the world
Ruby
1
star
55

delicious_wp

A Ruby script that creates a WordPress entry with last week's posts on del.icio.us
Ruby
1
star
56

Slim-Framework-Dash-Docset

Dash Docset for the Slim Framework Documentation
Shell
1
star
57

iOS7-Presentation

A short summary of new APIs and features available for app developers in iOS 7. Shown in the GOTO Nights in Eindhoven and Amsterdam (November 20th and 21st 2013) and Zurich (December 18th 2013)
Objective-C
1
star
58

SmartPointerTest

A "smart pointer" implementation in Objective-C++
C
1
star
59

nodetutorial

Code written while reading the nodebeginner.org tutorial
JavaScript
1
star