Developing iPhone Applications in

secrettownpanamanianMobile - Wireless

Dec 10, 2013 (3 years and 6 months ago)

85 views

Paul  Rayner
AGILITY.  CRAFT.  ARCHITECTURE.
Developing iPhone
Applications in
Tuesday, March 16, 2010
Why the
iPhone?
Tuesday, March 16, 2010
Why the
iPhone?
Tuesday, March 16, 2010
Tools
Tuesday, March 16, 2010
Distributing Apps
Tuesday, March 16, 2010
Tuesday, March 16, 2010
MonoTouch Tools
Tuesday, March 16, 2010
MonoTouch Tools
Tuesday, March 16, 2010
MonoTouch Tools
Tuesday, March 16, 2010
Demo :: Getting Started
Tuesday, March 16, 2010
Demo :: Getting Started
Tuesday, March 16, 2010
iPhone Constraints
Tuesday, March 16, 2010
iPhone Constraints

iPhone  apps  are  
not
 small  desktop  apps
Tuesday, March 16, 2010
iPhone Constraints

iPhone  apps  are  
not
 small  desktop  apps

Limited  resources
Tuesday, March 16, 2010
iPhone Constraints

iPhone  apps  are  
not
 small  desktop  apps

Limited  resources

Different  usage  pa8erns
Tuesday, March 16, 2010
iPhone Constraints

iPhone  apps  are  
not
 small  desktop  apps

Limited  resources

Different  usage  pa8erns

Only  one  applica;on  can  run  at  a  ;me
Tuesday, March 16, 2010
iPhone Constraints

iPhone  apps  are  
not
 small  desktop  apps

Limited  resources

Different  usage  pa8erns

Only  one  applica;on  can  run  at  a  ;me

Handle  device  differences  gracefully
Tuesday, March 16, 2010
iPhone Constraints

iPhone  apps  are  
not
 small  desktop  apps

Limited  resources

Different  usage  pa8erns

Only  one  applica;on  can  run  at  a  ;me

Handle  device  differences  gracefully

Devs:  No  JIT  compila;on,  no  scrip;ng
Tuesday, March 16, 2010
Cocoa & Objective-C
Text
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Tuesday, March 16, 2010
Text
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Cocoa & Objective-C
Tuesday, March 16, 2010
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Cocoa & Objective-C
Tuesday, March 16, 2010
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Cocoa & Objective-C

When  there  is  no  more  memory,  there  is  
no  more  memory
Tuesday, March 16, 2010
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Cocoa & Objective-C

When  there  is  no  more  memory,  there  is  
no  more  memory

No  automa3c  objects  on  the  stack.
Tuesday, March 16, 2010
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Cocoa & Objective-C

When  there  is  no  more  memory,  there  is  
no  more  memory

No  automa3c  objects  on  the  stack.

No  garbage  collector  (manual  memory  
management)
Tuesday, March 16, 2010
!
NSMutableURLRequest
*theRequest = [
NSMutableURLRequest

requestWithURL
:[
NSURL

URLWithString
:
@"
http://
virtualgenius:dummypassword@twitter.com/statuses/update.xml
"
]
!!!!!!!!!!!!!!!!!!!!

cachePolicy
:
NSURLRequestUseProtocolCachePolicy
!!!!!!!!!!!!!!!!!!!!

timeoutInterval
:
60.0
];
![theRequest
setHTTPMethod
:
@"POST"
];
![theRequest
setHTTPBody
:[[
NSString

stringWithFormat
:
@"status=%@"
,
themessage]
dataUsingEncoding
:
NSASCIIStringEncoding
]];
!
NSURLResponse
* response;
!
NSError
* error;
!
NSData
* result = [
NSURLConnection

sendSynchronousRequest
:theRequest
returningResponse
:&response
error
:&error];
!
NSLog
(
@"%@"
, [[[
NSString

alloc
]
initWithData
:result
encoding
:
NSASCIIStringEncoding
]
autorelease
]);
Cocoa & Objective-C

When  there  is  no  more  memory,  there  is  
no  more  memory

No  automa3c  objects  on  the  stack.

No  garbage  collector  (manual  memory  
management)
Tuesday, March 16, 2010
MonoTouch Limitations
Tuesday, March 16, 2010
MonoTouch Limitations

No  JIT  or  scrip3ng
Tuesday, March 16, 2010
MonoTouch Limitations

No  JIT  or  scrip3ng

No  code  gen  at  run3me
Tuesday, March 16, 2010
MonoTouch Limitations

No  JIT  or  scrip3ng

No  code  gen  at  run3me
System.Reflec3on.Emit  not  available
Tuesday, March 16, 2010
MonoTouch Limitations

No  JIT  or  scrip3ng

No  code  gen  at  run3me
System.Reflec3on.Emit  not  available
No  support  for  System.Run3me.Remo3ng
Tuesday, March 16, 2010
MonoTouch Limitations

No  JIT  or  scrip3ng

No  code  gen  at  run3me
System.Reflec3on.Emit  not  available
No  support  for  System.Run3me.Remo3ng
No  support  for  DLR  languages  (eg.  IronRuby,  
IronPython)
Tuesday, March 16, 2010
MonoTouch Limitations

No  JIT  or  scrip3ng

No  code  gen  at  run3me
System.Reflec3on.Emit  not  available
No  support  for  System.Run3me.Remo3ng
No  support  for  DLR  languages  (eg.  IronRuby,  
IronPython)
See  
hJp://monotouch.net/Documenta3on/
Limita3ons
Tuesday, March 16, 2010
Sample App
Walkthrough
Tuesday, March 16, 2010
What’s Next?
15
Tuesday, March 16, 2010
What’s Next?
15
Tuesday, March 16, 2010
What’s Next?
15
Tuesday, March 16, 2010
What’s Next?
15
Tuesday, March 16, 2010
iPhone  development  is  
challenging
Tuesday, March 16, 2010
iPhone  development  is  
challenging
MonoTouch  ==    Goodness
Tuesday, March 16, 2010
Questions
Tuesday, March 16, 2010
Resources
Tuesday, March 16, 2010
Resources
Tuesday, March 16, 2010
Resources
Tuesday, March 16, 2010
Resources
http://delicious.com/virtualgenius/monotouch
Tuesday, March 16, 2010
Paul  Rayner
Thank You…
paul@virtual-genius.com
www.virtual-genius.com
http://twitter.com/virtualgenius
AGILITY.  CRAFT.  ARCHITECTURE.
Tuesday, March 16, 2010
References

http://www.amazon.com/Building-iPhone-Applications-Developer-
MonoTouch/dp/B003A6RCF2

iPhone image:
http://ke2yk.wordpress.com/2009/03/22/first-it-was-cw-
now-its-the-question-pool/

iPhone sales chart:
http://en.wikipedia.org/wiki/IPhone


Monotouch home page:
http://monotouch.net
/

MacBook Pro:
http://www.apple.com/macbookpro/

iPhone Dev Center Logo:
http://developer.apple.com/iphone/index.action


Mono logo:
www.mono-project.net

Objective C memory management:
http://cocoadevcentral.com/d/
learn_objectivec/


Microphone: http://www.faqs.org/photo-dict/phrase/377/microphone.html

App store logo: http://www.apple.com/iphone/apps-for-iphone/

Android developer logo:
http://developer.android.com/index.html

Head First iPhone Development: http://oreilly.com/catalog/9780596803551
Tuesday, March 16, 2010