Download Complete Professional iPhone Programming with MonoTouch and NET C 1st Edition Wallace B. Mcclure PDF for All Chapters
Download Complete Professional iPhone Programming with MonoTouch and NET C 1st Edition Wallace B. Mcclure PDF for All Chapters
https://ebookgate.com
https://ebookgate.com/product/professional-iphone-
programming-with-monotouch-and-net-c-1st-edition-
wallace-b-mcclure/
https://ebookgate.com/product/professional-android-programming-with-
mono-for-android-and-net-c-1st-edition-wallace-b-mcclure/
ebookgate.com
https://ebookgate.com/product/professional-parallel-programming-with-
c-master-parallel-extensions-with-net-4-1st-edition-gaston-hillar/
ebookgate.com
https://ebookgate.com/product/net-programming-with-visual-c-tutorial-
reference-and-immediate-solutions-1st-edition-max-fomitchev-author/
ebookgate.com
Head First C 2E A Learner s Guide to Real World
Programming with Visual C and NET Second Edition Andrew
Stellman
https://ebookgate.com/product/head-first-c-2e-a-learner-s-guide-to-
real-world-programming-with-visual-c-and-net-second-edition-andrew-
stellman/
ebookgate.com
https://ebookgate.com/product/professional-c-7-and-net-core-2-0-7th-
edition-christian-nagel/
ebookgate.com
https://ebookgate.com/product/cryengine-game-programming-with-c-c-and-
lua-1st-edition-lundgren/
ebookgate.com
https://ebookgate.com/product/professional-c-4-and-net-4-wrox-
programmer-to-programmer-1st-edition-christian-nagel/
ebookgate.com
https://ebookgate.com/product/professional-asp-net-3-5-sp1-edition-in-
c-and-vb-bill-evjen/
ebookgate.com
Professional
iPhone Programming with
monotouch and .net/c#
foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
indeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Professional
Wallace B. McClure
Martin Bowling
Craig Dunn
Chris Hardy
Rory Blyth
Professional iPhone® Programming with MonoTouch and .neT/C#
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2010 by Wallace B. McClure, Martin Bowling, Craig Dunn, Chris Hardy, and Rory Blyth
ISBN: 978-0-470-63782-1
ISBN: 978-0-470-90808-2 (ebk)
ISBN: 978-0-470-90859-4 (ebk)
ISBN: 978-0-470-90860-0 (ebk)
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108
of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the
Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-
6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or pro-
motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold
with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services.
If professional assistance is required, the services of a competent professional person should be sought. Neither the pub-
lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to
in this work as a citation and/or a potential source of further information does not mean that the author or the publisher
endorses the information the organization or Web site may provide or recommendations it may make. Further, readers
should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was
written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available
in electronic books.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other coun-
tries, and may not be used without written permission. iPhone is a registered trademark of Apple, Inc. All other trade-
marks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor
mentioned in this book.
about the authors
craig dunn has been developing with the .NET Framework since 2001 in both
Australia and Canada, on projects ranging from Internet banking to warehouse automa-
tion systems (and including a stint building multilingual web sites). He has been involved
with MonoTouch since the early betas in August 2009, blogging tutorials at http://
conceptdev.blogspot.com and producing the MIX10 iPhone conference schedule
application (in conjunction with Chris Hardy) for Microsoft’s 2010 MIX conference in Las Vegas.
Craig was also 15th in line for an iPad.
chris hardy, a Microsoft ASPInsider, works for a digital agency called Great
Fridays in Manchester, United Kingdom, developing ASP.NET solutions for clients
such as Peter Gabriel and Emma Watson. Ever since MonoTouch was in beta, Chris
has been developing and evangelizing MonoTouch and was one of the first users to get
a MonoTouch application on to the App Store. Speaking at conferences around the
world on the subject, Chris has been a key part of the community and is extending this by contrib-
uting to the MonoTouch book.
rory blyth has worked in the software development industry for nearly a decade.
He began as an independent contractor, then went on to co-host the popular .Net
Rocks podcast, work as a public speaker for Microsoft, join Microsoft’s Channel9,
and deliver many talks for other companies/conferences on diverse subjects includ-
ing iPhone development using both Objective-C and MonoTouch. He learned iPhone
development during a year working at Spotlight Mobile — a development firm where popular
iPhone apps such as Style.com and the Barnes and Noble Bookstore were produced.
John mandia grew up in London and has been developing since 1999 when he switched from
working in marketing to development. During that time he’s worked for a value-added reseller
(VAR), a .com company, a portal, a design agency, a consultancy and he is currently working for
a leading global investment bank. He’s been working with .NET since it was in beta, and for a
number of years he was a major contributor to an open source project known as Rainbow Portal
(2002–2005) which has had over 130,000 downloads. One of his current interests is mobile devel-
opment, and he’s been following MonoTouch since it was in beta when he set up the MonoTouch
community site http://monotouch.info and twitter account @monotouchinfo to help others who
have decided to take their .NET skills and apply it to iPhone/iPad development.
Jim Zimmerman is an ASP.NET MVP and CTO of Thuzi and TeamZoneSports in Tampa, Florida.
He decided to learn Objective-C last year in order to learn how to create iPhone apps for his four
kids and for his companies. He has since been convinced that MonoTouch is the way to go allow-
ing him to bring his C# skills with him, giving him a much more rapid development experience. He
looks forward to the day when he can have at least 90 percent of the same code running on all rel-
evant mobile devices.
credits
i’ve always been interested in mobile development. It wasn’t until the summer of 2009 that
Wrox and I were able to agree on creating a mobile development/iPhone project. That project, part
of the Wrox Blox series, was the first version of this book; it published in November 2009. Two
weeks after the release of that project, Associate Publisher Jim Minatel was happy with the sales
of the ebook and was wondering about a bigger print book on MonoTouch. Due to my schedule,
I needed to get several other authors. I initially thought of Craig Dunn, Chris Hardy, and Martin
Bowling. I had spoken with each during the writing of my first book, so it made sense to talk with
them about co-authoring the print book. I spoke with Joseph Hill at Novell one afternoon, and he
suggested them as well. With some level setting in my initial choices, I talked with each one and they
all accepted. I was ecstatic. Rory Blyth joined us a short way into our book. Thanks to Jim Minatel
for allowing me to start writing on MonoTouch. Thanks to Bob Elliott for keeping us on target, and
a big thanks to Kevin Kent for doing the dirty work of keeping us on task.
Given that my co-authors were on separate continents and hemispheres, I want to thank them for
their great work. Craig and Chris did a great job, were very attentive to detail, and were always on
top of what was going on.
I want to thank my family. They did a great job allowing me to work on the book and to work for
customers as well. I owe them a huge “Thank You.”
Finally, I want to thank you for purchasing this book. We hope you enjoy this book as much as we
have enjoyed writing it.
—Wallace B. Mcclure
sPecial thanks to my wonderful wife Mandi Rae. Without her I don’t know where I would be.
Thanks to my mom, CK, Sarah, and all those who have supported me over the years. And thanks to
Brewski Firkin for keeping me company while I code.
—M artin BoWling
thanks to Karl, Mike, and Chris for inspiration, and to Mum for everything. To Jack, Lilliana,
Will, Sam, and Marcus — always do your best.
—craig Dunn
thanks to my wife, Cara, for putting up with the long nights and to my parents, Hazel and Bob.
—chris h arDy
contents
FOREWORD xxi
IntRODuctIOn xxiii
Product Comparison 2
.NET Framework 2
Mono 2
MonoTouch 3
MonoDevelop 5
iPhone 5
Mobile Development 7
apple iPhone sDK Tools 8
Tools 8
Licensing 9
summary 9
xiv
ConTenTs
xv
ConTenTs
xvi
ConTenTs
images 203
Displaying Images 203
Picking an Image 206
Handling a Picked Image 208
Creating an Image from the Camera 209
Editing an Image 210
Customizing the Camera 211
Saving an Image to the Photo Album 212
Video 213
Playing a Video 213
Customizing the Video Player 215
Picking a Video 218
Recording Video 219
Editing a Video 221
Saving a Video to the Saved Photo Album 222
audio 223
Playing Audio 223
Recording Audio 225
animation 227
Creating Basic Animation 227
Using UIView Animations 229
summary 231
xvii
ConTenTs
xviii
Another random document with
no related content on Scribd:
limonaadia. Kauppaneuvos alkoi hyvin vilkkaasti puhua
sanomalehdestä ja selitti hyvin laveasti kansan opetuksen
järjestämistä, mutta maisteri, vaikka olikin häntä hyvin tarkasti
kuuntelevinaan, ei tietänyt asiasta mitään, hänen ajatuksensa
liikkuivat aivan toisaalla. Hän heräsi unelmistaan vasta sitte kun
kauppaneuvos puristi hänen kättänsä ja kysyi:
Maisteri hymyili, sillä hän arvasi että siinä nyt oli se kirjoitus, jonka
hän tanssiaisissa oli luvannut lehteensä ottaa. Hän avasi kirjoituksen
ja alkoi lukea sillä aikaa kuin ylioppilas katseli pöydällä olevaa
raittiuskirjoitusta. Hetken luettuansa maisteri nousi ylös ja huusi,
tukkaansa tarttuen:
— Herrajesta, mitä hullutusta tämä on? Eihän tässä ole päätä eikä
perää!
— Paperikoriin!
— Etkö sinä tiedä, ettei mikään ole niin hauskaa kuin puhua
asioista, joita ei ymmärrä? Jos minä, näet sä, ymmärrän jonkun
asian perin pohjin, niin on se minusta niin selvää ettei siitä kannata
puhua; mutta annas kun otan asian, jota en ymmärrä, niin voin
puhua siitä mitä hyvänsä, aivan niinkuin se, joka on tuntemattomissa
maissa matkustanut, voi sieltä kertoa mitä tahtoo. Jos sitte tulee joku
toinen ja sanoo: "sinä valehtelet, asia onkin niin tai näin", voi hän
huoleti vastata: sinä valehtelet itse! Ja se, joka tahtoo uskoa
molempia, tekee viisaimmin, jos uskoo että molemmat valehtelevat.
— Ole vaiti!
— Kas niin, saanko sanoa että sinäkin olet luvannut pitää
esitelmän ompeluseurassa?
Vähän aikaa sen jälkeen kuin Juslenius oli lähtenyt pois, toi posti
useita kirjeitä "Kaupin" toimitukselle. Ne olivat kirjeitä tuntemattomilta
tuttavilta lähiseuduilla. Yhdessä niistä oli runomittainen tervehdys
uudelle sanomalehdelle. Se alkoi näin:
— He, tuoss'on!
Neiti Torn kertoi että hänellä jo kauan oli ollut pieni novelli
valmiina, mutta hän ei uskaltanut tarjota sitä julaistavaksi. Nyt oli hän
sitä kantanut lakkarissaan monta päivää toivossa tavata maisteria ja
pyysi saada nyt antaa sen, kun vaan se voisi tapahtua niin ettei
kukaan huomaisi. Myöskin pyysi neiti Torn ettei hänen nimeänsä
millään ehdolla kenellekään ilmaistaisi.
Kun kadulla kulki alituisesti ihmisiä, ehdoitteli neiti Torn että hän
pudottaa myttynsä huomaamatta kadulle, josta maisteri sen sitten
ottaa.
— Tämähän on oivallista!
"Arvoisa neiti!
Kun neiti Torn sai tämän kirjeen oli hänen luonansa pari pientä
tyttöä yksityistä opetusta saamassa. Luettuansa kirjeen punastui hän
niin ankarasti että tytötkin sen huomasivat. Hän meni silloin toiseen
huoneesen, veti siellä piirongista laatikon auki ja otti joukon
kellastuneita papereita esille. Ne olivat vanhoja rakkauden kirjeitä.
Kun kahvi oli tuotu sisään tuli huoneesen myöskin Julia äitinsä
kanssa. Silloin jätettiin keskustelu kansan opetuksesta, mutta
kauppaneuvos löi maisteria polveen ja sanoi:
— Niin, niin, veliseni, pidä sinä vaan kiinni siitä talosta, siellä se
asuu kultalintu!
Sitte kuiskasi hän maisterin korvaan ikäänkuin suurena
salaisuutena:
— Älä nai köyhää! Jollet rikasta saa, niin ole ilman; yksi suu syö
vähemmän kuin yhdeksän. Muista minua!
— Ilahduttaako se teitä?
Julia kuunteli häntä vaieten ja ilta oli siksi pimeä, ett'ei maisteri
voinut kumppalinsa kasvoista nähdä minkä vaikutuksen hänen
sanansa tekivät. Kun maisteri oli lopettanut ja ja henkeänsä
pidättäen odotti vastausta, lausui Julia:
— Julia! kuiskasi hän sitte, mutta portti oli jo kiinni ja hän kuuli
Julian nopein askelin poistuvan.