SlideShare uma empresa Scribd logo
1 de 16
+




    Software Development Community
    Mobile Device Programming Subgroup
    Hello World Series – Part I - IOS

               Paul Hancock - 29 April 2012
+
    Agenda

       What do you need to get started?

       Objective C explained in 30 seconds

       Target Considerations: iPad vs. iPhone vs. Universal

       Hello World! … take I
           Adding graphical elements to the main window programmatically


       Hello World! … take II
           Building graphical elements to the main window using WYSIWYG “Interface Builder”


       Hello World! … take III
           Adding graphical elements onto subviews


       Not covered in this presentation:
           Design patterns and concepts required to create non-trivial applications (Delegation, Notifications, Core
            Data, Storyboards, etc.)
           Getting your app on the AppStore and becoming rich
+
    What you’ll need to get started

             Intel-based Mac running OSX

             Development Environment

             Basic knowledge of object oriented programming
              concepts

             Familiarity with event-driven programming models

             Can spell MVC (Model-View-Controller)

             15 minutes of spare time
+
    Development Environment
       IOS SDK / Xcode running on Mac OSX
           Available from the AppStore for Free
           Everything you need, including iPhone/iPad simulators

       Optional:
           IOS Devices
           Developer’s License ($99/year)
               Developer certificate allows signing applications
               Allows developer to download/test/debug apps on actual IOS
                devices
               Provides access to developer resources (help, etc.)
               Allows developer to put app on appstore and get rich
+
    Model-View-Controller

       Every IOS application object should be one of these


           Model Object
             Contains data without any knowledge of the application logic or GUI


           View Object
             Interfaces to the user (buttons, scroll bars, etc.) without any knowledge of how
              the data is organized

           Controller Object
             Manages the application logic. Has knowledge of the Model objects and the
              View objects. Acts as the glue to keeps Model objects and View objects in
              sync.
             Least reusable classes
+
    MVC Design Pattern


                         Sends Message                        Update Data




            View                          Controller                               Model




                        Update the View                Fetch Data needed by View




     Controllers don’t tell Views what to display. Views ask Controllers for what they need
+
    Objective C in 30 seconds
       A very simple language, like C

       Superset of C
           Entry point is main();
           originally implemented as C preprocessor (as was C++)
           Objective C keywords begin with “@”, for example @synthesize

       Adds object-oriented paradigms
           Classes / Objects / Encapsulation / Inheritance / Polymorphism / etc.
           Allows only single inheritance (subclasses have exactly one superclass)
             All objects ultimately derived from NSObject (“NS” stands for Next Step)


       Cocoa Touch Framework (not part of Objective C)
           Rich set of frameworks/libraries to enable rapid and consistent development of IOS applications

       Further Reading:
           Programming in Objective-C (4th Edition) - Stephen G. Kochan
           Objective-C Programming: The Big Nerd Ranch Guide – Aaron Hillegass
+
    Objective C - Object/Method Notation
    Object Method Definition within a Class Implementation

    -(float)calculateAreaOfRectangleWithWidth:(float)x
                                    andHeight:(float)y
    {
        return x*y;
    }


    Method Invocation by an object

               …you might be expecting something like….
     float area;
     area = myObject->calculateAreaOfRectangle(23.7,12.0);
+
    Objective C - Object/Method Notation
    Object Method Definition within a Class Implementation

    -(float)calculateAreaOfRectangleWithWidth:(float)x
                                    andHeight:(float)y
    {
        return x*y;
    }



But no, you do it by sending a message to the object …I mean the receiver….

    float area;
    area = [myObject calculateAreaOfRectangleWithWidth:23.7
                                             andHeight:12.0];

                                                                      Arguments
    Receiver             Selector “calculateAreaOfRectangleWithWidth:andHeight:”
+
    Application Target Considerations
    iPhone? iPhone Retna? iPad? The New iPad?

    Device                           Screen                Graphics
                                     Resolution            Resolution
    iPhone 3Gs and earlier           320x480 pixels
                                                           320 x 480 points
    iPhone 4 and 4s (Retna)          640x960 pixels
    iPad and iPad 2                  768x1024 pixels
                                                           768 x 1024 points
    The New iPad (Retna)             1536x2048 pixels

       iPhone applications will run unmodified on iPads, but potentially with
        degraded (pixelated) appearance (not recommended)
       CoreGraphics based on points, not pixels – vector graphics not impacted
       Xcode allows multiple images to be bundled as resources so that they appear
        sharp on all displays
+
    Real Estate Considerations
   iPhone vs iPad
       Vastly different screen real estate calls for different approach
       iPhones use UINavigationController as the primary drill-down mechanism
       iPads can leverage greater real estate and use UISplitViewController




                                       vs.




    UINavigationController

                                                       UISplitViewController
+
    Additional Resources

       iOS Programming: The Big Nerd Ranch Guide (3rd Edition)
           Aaron Hillegass & Joe Conway
           Very structured and well written explanation of Cocoa architecture and
            approach

       iPad iOS 5 Development Essentials or iPhone iOS 5 Development
        Essentials
           Neil Smyth
           Best how-to guides from soup to nuts for getting an application onto the
            AppStore

       iOS 5 Programming Pushing the Limits: Developing Extraordinary
        Mobile Apps for Apple iPhone, iPad, and iPod Touch
           Rob Napier
           Not a beginner book
And Now….

Let’s fire up Xcode and write some apps!
+
    Hello World 1
    Implementation Summary
       Programmatic approach (no WYSIWYG)

       Created “Empty” project
           AppDelegate Class
           Instantiates the window

       Added Application icons

       Modified AppDelegate to
           Change window background color
           Created a UIButton (declared in .h and initialized in .m)
           Set the size and position of the button
           Set the title to “Press Me”
           Set the action for pressing the button to call sayHello:
+
    Hello World 2
    Implementation Summary
       Implement the main window graphically with Interface Builder

       Created “Empty” project
           AppDelegate Class
           Instantiates the window


       Added application icons

       Modified AppDelegate to
           Comment out the programmatic instantiation of the window
           Declare helloButton (using keyword IBOutlet), declare/implement sayHello action (using keyword IBAction)


       Created a new project file (IOS Interface->Window)
           Created MainWindow.xib
               Added object (cube icon), set class to HelloWorld2AppDelegate (acts as a placeholder until runtime)
               Changed background color, added button, set the title to “Press Me” with 46pt font
           Graphically make connections
               Set File’s Owner Class to UIApplication, set File’s Owner Delegate to HelloWorld2AppDelegate
               Connect helloButton (in AppDelegate) to graphical button object, connect touch up inside action to sayHello (in AppDelegate)


       Set Application Main Interface to MainWindow
+
    Hello World 3
    Implementation Summary
       Implement graphical objects in a view, with a dedicated ViewController rather than
        directly on window

       Created “Single View Application” project
           AppDelegate Class
           ViewController Class
           XIB
           Basic connections made for you

       Added application icons

       Modified ViewController to
           Declare helloButton (using keyword IBOutlet), declare/implement sayHello action (using
            keyword IBAction)

       Edit xib
           Set background color, added button, set the title to “Press Me” with 46pt font
           Connect helloButton (in File’s Owner) to graphical button object, connect touch up inside
            action to sayHello (in File’s Owner)

Mais conteúdo relacionado

Mais procurados

Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
Android deep dive
Android deep diveAndroid deep dive
Android deep diveAnuSahniNCI
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorialkatayoon_bz
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorialEd Zel
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from ScratchTaufan Erfiyanto
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdkAlessio Ricco
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumAxway Appcelerator
 
Best react native animation libraries & ui component of 2022
Best react native animation libraries & ui component of 2022Best react native animation libraries & ui component of 2022
Best react native animation libraries & ui component of 2022Katy Slemon
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAJeff Haynie
 

Mais procurados (14)

Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Swift
SwiftSwift
Swift
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Android deep dive
Android deep diveAndroid deep dive
Android deep dive
 
Android
AndroidAndroid
Android
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdk
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
 
Best react native animation libraries & ui component of 2022
Best react native animation libraries & ui component of 2022Best react native animation libraries & ui component of 2022
Best react native animation libraries & ui component of 2022
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
 

Destaque

Welcome to Rails Girls Buenos Aires
Welcome to Rails Girls Buenos AiresWelcome to Rails Girls Buenos Aires
Welcome to Rails Girls Buenos AiresAnni Rautio
 
Informe empleados
Informe empleadosInforme empleados
Informe empleadoskode99
 
2013 04 15 hogans assessment results luca cococcia VALUES
2013 04 15 hogans assessment results luca cococcia VALUES2013 04 15 hogans assessment results luca cococcia VALUES
2013 04 15 hogans assessment results luca cococcia VALUESlucacococcia
 
Дастер
ДастерДастер
ДастерAl Maks
 
New Models of Content Creation and Scholarship at the Intersection of Library...
New Models of Content Creation and Scholarship at the Intersection of Library...New Models of Content Creation and Scholarship at the Intersection of Library...
New Models of Content Creation and Scholarship at the Intersection of Library...Mike Nutt
 
Iab social media_infographic
Iab social media_infographicIab social media_infographic
Iab social media_infographicNadya Rosalia
 
The srimad bhagavad sacredness of cow
The srimad bhagavad   sacredness of cowThe srimad bhagavad   sacredness of cow
The srimad bhagavad sacredness of cowBASKARAN P
 
Russian and Ukrainian banks activities in social media analytic review
Russian and Ukrainian banks activities in social media analytic reviewRussian and Ukrainian banks activities in social media analytic review
Russian and Ukrainian banks activities in social media analytic reviewSPN Communications Ukraine
 
Untrash summit presentation 1
Untrash summit presentation 1Untrash summit presentation 1
Untrash summit presentation 1scswa
 
Sandy. unsung heroes of hurricane. lyceum 3
Sandy. unsung heroes of hurricane. lyceum 3Sandy. unsung heroes of hurricane. lyceum 3
Sandy. unsung heroes of hurricane. lyceum 3Irina Saranceva
 
miss the forest: bringing together multiple taxonomies
miss the forest: bringing together multiple taxonomiesmiss the forest: bringing together multiple taxonomies
miss the forest: bringing together multiple taxonomiesHeimo Rainer
 
Final presentation
Final presentationFinal presentation
Final presentationAna Arballo
 
Confidentiality training
Confidentiality trainingConfidentiality training
Confidentiality trainingbaileesna
 
Creating executable JAR from Eclipse IDE
Creating executable JAR from Eclipse IDECreating executable JAR from Eclipse IDE
Creating executable JAR from Eclipse IDENag Arvind Gudiseva
 
Question 4- Cryotherapy
Question 4- CryotherapyQuestion 4- Cryotherapy
Question 4- CryotherapyKelly Tay
 
Tceq 2011
Tceq 2011Tceq 2011
Tceq 2011scswa
 

Destaque (20)

8 uji normalitas data
8 uji normalitas data8 uji normalitas data
8 uji normalitas data
 
Welcome to Rails Girls Buenos Aires
Welcome to Rails Girls Buenos AiresWelcome to Rails Girls Buenos Aires
Welcome to Rails Girls Buenos Aires
 
Ref IT
Ref ITRef IT
Ref IT
 
Informe empleados
Informe empleadosInforme empleados
Informe empleados
 
2013 04 15 hogans assessment results luca cococcia VALUES
2013 04 15 hogans assessment results luca cococcia VALUES2013 04 15 hogans assessment results luca cococcia VALUES
2013 04 15 hogans assessment results luca cococcia VALUES
 
Дастер
ДастерДастер
Дастер
 
New Models of Content Creation and Scholarship at the Intersection of Library...
New Models of Content Creation and Scholarship at the Intersection of Library...New Models of Content Creation and Scholarship at the Intersection of Library...
New Models of Content Creation and Scholarship at the Intersection of Library...
 
Business Writing Instant Quiz
Business Writing Instant QuizBusiness Writing Instant Quiz
Business Writing Instant Quiz
 
Iab social media_infographic
Iab social media_infographicIab social media_infographic
Iab social media_infographic
 
The srimad bhagavad sacredness of cow
The srimad bhagavad   sacredness of cowThe srimad bhagavad   sacredness of cow
The srimad bhagavad sacredness of cow
 
Russian and Ukrainian banks activities in social media analytic review
Russian and Ukrainian banks activities in social media analytic reviewRussian and Ukrainian banks activities in social media analytic review
Russian and Ukrainian banks activities in social media analytic review
 
Untrash summit presentation 1
Untrash summit presentation 1Untrash summit presentation 1
Untrash summit presentation 1
 
Sandy. unsung heroes of hurricane. lyceum 3
Sandy. unsung heroes of hurricane. lyceum 3Sandy. unsung heroes of hurricane. lyceum 3
Sandy. unsung heroes of hurricane. lyceum 3
 
miss the forest: bringing together multiple taxonomies
miss the forest: bringing together multiple taxonomiesmiss the forest: bringing together multiple taxonomies
miss the forest: bringing together multiple taxonomies
 
Final presentation
Final presentationFinal presentation
Final presentation
 
Confidentiality training
Confidentiality trainingConfidentiality training
Confidentiality training
 
Creating executable JAR from Eclipse IDE
Creating executable JAR from Eclipse IDECreating executable JAR from Eclipse IDE
Creating executable JAR from Eclipse IDE
 
PPT BS
PPT BS PPT BS
PPT BS
 
Question 4- Cryotherapy
Question 4- CryotherapyQuestion 4- Cryotherapy
Question 4- Cryotherapy
 
Tceq 2011
Tceq 2011Tceq 2011
Tceq 2011
 

Semelhante a Hello world ios v1

Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyUna Daly
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyNick Landry
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicskenshin03
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1Shyamala Prayaga
 
New to native? Getting Started With iOS Development
New to native?   Getting Started With iOS DevelopmentNew to native?   Getting Started With iOS Development
New to native? Getting Started With iOS DevelopmentGeoffrey Goetz
 
ID-ObjectiveConference 2012 - Introduction to iOS Development
ID-ObjectiveConference 2012 - Introduction to iOS DevelopmentID-ObjectiveConference 2012 - Introduction to iOS Development
ID-ObjectiveConference 2012 - Introduction to iOS DevelopmentAndri Yadi
 
iOS App Development with Storyboard
iOS App Development with StoryboardiOS App Development with Storyboard
iOS App Development with StoryboardBabul Mirdha
 
iOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomeriOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomerAndri Yadi
 
iPhone Developer_ankush
iPhone Developer_ankushiPhone Developer_ankush
iPhone Developer_ankushankush Ankush
 
Mobile App Institute
Mobile App InstituteMobile App Institute
Mobile App InstituteBill Bellows
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentRyan Stewart
 
Introduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile DevicesIntroduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile DevicesRyan Stewart
 

Semelhante a Hello world ios v1 (20)

Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una Daly
 
Training in iOS Development
Training in iOS DevelopmentTraining in iOS Development
Training in iOS Development
 
iOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET GuyiOS Development Survival Guide for the .NET Guy
iOS Development Survival Guide for the .NET Guy
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basics
 
201010 SPLASH Tutorial
201010 SPLASH Tutorial201010 SPLASH Tutorial
201010 SPLASH Tutorial
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
New to native? Getting Started With iOS Development
New to native?   Getting Started With iOS DevelopmentNew to native?   Getting Started With iOS Development
New to native? Getting Started With iOS Development
 
ID-ObjectiveConference 2012 - Introduction to iOS Development
ID-ObjectiveConference 2012 - Introduction to iOS DevelopmentID-ObjectiveConference 2012 - Introduction to iOS Development
ID-ObjectiveConference 2012 - Introduction to iOS Development
 
iOS App Development with Storyboard
iOS App Development with StoryboardiOS App Development with Storyboard
iOS App Development with Storyboard
 
iOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for JasakomeriOS Development - Offline Class for Jasakomer
iOS Development - Offline Class for Jasakomer
 
Vb lecture
Vb lectureVb lecture
Vb lecture
 
iPhone Developer_ankush
iPhone Developer_ankushiPhone Developer_ankush
iPhone Developer_ankush
 
Mobile App Institute
Mobile App InstituteMobile App Institute
Mobile App Institute
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen Development
 
Lecture1
Lecture1Lecture1
Lecture1
 
Introduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile DevicesIntroduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile Devices
 
Shankar
ShankarShankar
Shankar
 
200910 - iPhone at OOPSLA
200910 - iPhone at OOPSLA200910 - iPhone at OOPSLA
200910 - iPhone at OOPSLA
 
ios basics
ios basicsios basics
ios basics
 

Último

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Hello world ios v1

  • 1. + Software Development Community Mobile Device Programming Subgroup Hello World Series – Part I - IOS Paul Hancock - 29 April 2012
  • 2. + Agenda  What do you need to get started?  Objective C explained in 30 seconds  Target Considerations: iPad vs. iPhone vs. Universal  Hello World! … take I  Adding graphical elements to the main window programmatically  Hello World! … take II  Building graphical elements to the main window using WYSIWYG “Interface Builder”  Hello World! … take III  Adding graphical elements onto subviews  Not covered in this presentation:  Design patterns and concepts required to create non-trivial applications (Delegation, Notifications, Core Data, Storyboards, etc.)  Getting your app on the AppStore and becoming rich
  • 3. + What you’ll need to get started  Intel-based Mac running OSX  Development Environment  Basic knowledge of object oriented programming concepts  Familiarity with event-driven programming models  Can spell MVC (Model-View-Controller)  15 minutes of spare time
  • 4. + Development Environment  IOS SDK / Xcode running on Mac OSX  Available from the AppStore for Free  Everything you need, including iPhone/iPad simulators  Optional:  IOS Devices  Developer’s License ($99/year)  Developer certificate allows signing applications  Allows developer to download/test/debug apps on actual IOS devices  Provides access to developer resources (help, etc.)  Allows developer to put app on appstore and get rich
  • 5. + Model-View-Controller  Every IOS application object should be one of these  Model Object  Contains data without any knowledge of the application logic or GUI  View Object  Interfaces to the user (buttons, scroll bars, etc.) without any knowledge of how the data is organized  Controller Object  Manages the application logic. Has knowledge of the Model objects and the View objects. Acts as the glue to keeps Model objects and View objects in sync.  Least reusable classes
  • 6. + MVC Design Pattern Sends Message Update Data View Controller Model Update the View Fetch Data needed by View Controllers don’t tell Views what to display. Views ask Controllers for what they need
  • 7. + Objective C in 30 seconds  A very simple language, like C  Superset of C  Entry point is main();  originally implemented as C preprocessor (as was C++)  Objective C keywords begin with “@”, for example @synthesize  Adds object-oriented paradigms  Classes / Objects / Encapsulation / Inheritance / Polymorphism / etc.  Allows only single inheritance (subclasses have exactly one superclass)  All objects ultimately derived from NSObject (“NS” stands for Next Step)  Cocoa Touch Framework (not part of Objective C)  Rich set of frameworks/libraries to enable rapid and consistent development of IOS applications  Further Reading:  Programming in Objective-C (4th Edition) - Stephen G. Kochan  Objective-C Programming: The Big Nerd Ranch Guide – Aaron Hillegass
  • 8. + Objective C - Object/Method Notation Object Method Definition within a Class Implementation -(float)calculateAreaOfRectangleWithWidth:(float)x andHeight:(float)y { return x*y; } Method Invocation by an object …you might be expecting something like…. float area; area = myObject->calculateAreaOfRectangle(23.7,12.0);
  • 9. + Objective C - Object/Method Notation Object Method Definition within a Class Implementation -(float)calculateAreaOfRectangleWithWidth:(float)x andHeight:(float)y { return x*y; } But no, you do it by sending a message to the object …I mean the receiver…. float area; area = [myObject calculateAreaOfRectangleWithWidth:23.7 andHeight:12.0]; Arguments Receiver Selector “calculateAreaOfRectangleWithWidth:andHeight:”
  • 10. + Application Target Considerations iPhone? iPhone Retna? iPad? The New iPad? Device Screen Graphics Resolution Resolution iPhone 3Gs and earlier 320x480 pixels 320 x 480 points iPhone 4 and 4s (Retna) 640x960 pixels iPad and iPad 2 768x1024 pixels 768 x 1024 points The New iPad (Retna) 1536x2048 pixels  iPhone applications will run unmodified on iPads, but potentially with degraded (pixelated) appearance (not recommended)  CoreGraphics based on points, not pixels – vector graphics not impacted  Xcode allows multiple images to be bundled as resources so that they appear sharp on all displays
  • 11. + Real Estate Considerations  iPhone vs iPad  Vastly different screen real estate calls for different approach  iPhones use UINavigationController as the primary drill-down mechanism  iPads can leverage greater real estate and use UISplitViewController vs. UINavigationController UISplitViewController
  • 12. + Additional Resources  iOS Programming: The Big Nerd Ranch Guide (3rd Edition)  Aaron Hillegass & Joe Conway  Very structured and well written explanation of Cocoa architecture and approach  iPad iOS 5 Development Essentials or iPhone iOS 5 Development Essentials  Neil Smyth  Best how-to guides from soup to nuts for getting an application onto the AppStore  iOS 5 Programming Pushing the Limits: Developing Extraordinary Mobile Apps for Apple iPhone, iPad, and iPod Touch  Rob Napier  Not a beginner book
  • 13. And Now…. Let’s fire up Xcode and write some apps!
  • 14. + Hello World 1 Implementation Summary  Programmatic approach (no WYSIWYG)  Created “Empty” project  AppDelegate Class  Instantiates the window  Added Application icons  Modified AppDelegate to  Change window background color  Created a UIButton (declared in .h and initialized in .m)  Set the size and position of the button  Set the title to “Press Me”  Set the action for pressing the button to call sayHello:
  • 15. + Hello World 2 Implementation Summary  Implement the main window graphically with Interface Builder  Created “Empty” project  AppDelegate Class  Instantiates the window  Added application icons  Modified AppDelegate to  Comment out the programmatic instantiation of the window  Declare helloButton (using keyword IBOutlet), declare/implement sayHello action (using keyword IBAction)  Created a new project file (IOS Interface->Window)  Created MainWindow.xib  Added object (cube icon), set class to HelloWorld2AppDelegate (acts as a placeholder until runtime)  Changed background color, added button, set the title to “Press Me” with 46pt font  Graphically make connections  Set File’s Owner Class to UIApplication, set File’s Owner Delegate to HelloWorld2AppDelegate  Connect helloButton (in AppDelegate) to graphical button object, connect touch up inside action to sayHello (in AppDelegate)  Set Application Main Interface to MainWindow
  • 16. + Hello World 3 Implementation Summary  Implement graphical objects in a view, with a dedicated ViewController rather than directly on window  Created “Single View Application” project  AppDelegate Class  ViewController Class  XIB  Basic connections made for you  Added application icons  Modified ViewController to  Declare helloButton (using keyword IBOutlet), declare/implement sayHello action (using keyword IBAction)  Edit xib  Set background color, added button, set the title to “Press Me” with 46pt font  Connect helloButton (in File’s Owner) to graphical button object, connect touch up inside action to sayHello (in File’s Owner)