Dashcode_UserGuide.pdf

(2590 KB) Pobierz
Dashcode User Guide
Dashcode User Guide
Tools&Languages:IDEs
2009-07-24
695673701.002.png
Apple Inc.
© 2009 Apple Inc.
All rights reserved.
ASSUMINGTHEENTIRERISKASTOITSQUALITY
ANDACCURACY.
INNOEVENTWILLAPPLEBELIABLEFORDIRECT,
INDIRECT,SPECIAL,INCIDENTAL,OR
CONSEQUENTIALDAMAGESRESULTINGFROMANY
DEFECTORINACCURACYINTHISDOCUMENT,even
ifadvisedofthepossibilityofsuchdamages.
THEWARRANTYANDREMEDIESSETFORTHABOVE
AREEXCLUSIVEANDINLIEUOFALLOTHERS,ORAL
ORWRITTEN,EXPRESSORIMPLIED.NoApple
dealer,agent,oremployeeisauthorizedtomake
anymodification,extension,oradditiontothis
warranty.
Somestatesdonotallowtheexclusionorlimitation
ofimpliedwarrantiesorliabilityforincidentalor
consequentialdamages,sotheabovelimitationor
exclusionmaynotapplytoyou.Thiswarrantygives
youspecificlegalrights,andyoumayalsohave
otherrightswhichvaryfromstatetostate.
Nopartofthispublicationmaybereproduced,
stored in a retrieval system, or transmitted, in
any form or by any means, mechanical,
electronic, photocopying, recording, or
otherwise, without prior written permission of
Apple Inc., with the following exceptions: Any
person is hereby authorized to store
documentation on a single computer for
personal use only and to print copies of
documentation for personal use provided that
thedocumentationcontainsApple’scopyright
notice.
The Apple logo is a trademark of Apple Inc.
No licenses, express or implied, are granted
withrespecttoanyofthetechnologydescribed
in this document. Apple retains all intellectual
propertyrightsassociatedwiththetechnology
described in this document. This document is
intended to assist application developers to
develop applications only for Apple-labeled
computers.
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
408-996-1010
MobileMe is a service mark of Apple Inc.
Apple, the Apple logo, Dashcode, Finder, iCal,
iPhone, iPhoto, iPod, iPod touch, Mac, Mac OS,
Monaco,Objective-C,Quartz,QuickTime,Safari,
and Xcode are trademarks of Apple Inc.,
registered in the United States and other
countries.
Adobe,Acrobat,andPostScriptaretrademarks
or registered trademarks of Adobe Systems
IncorporatedintheU.S.and/orothercountries.
Helvetica and Times are registered trademarks
ofHeidelbergerDruckmaschinenAG,available
from Linotype Library GmbH.
IOS is a trademark or registered trademark of
CiscointheU.S.andothercountriesandisused
under license.
JavaisaregisteredtrademarkofOracleand/or
its affiliates.
EventhoughApplehasreviewedthisdocument,
APPLEMAKESNOWARRANTYORREPRESENTATION,
EITHEREXPRESSORIMPLIED,WITHRESPECTTO
THISDOCUMENT,ITSQUALITY,ACCURACY,
MERCHANTABILITY,ORFITNESSFORAPARTICULAR
PURPOSE.ASARESULT,THISDOCUMENTIS
PROVIDED“ASIS,”ANDYOU,THEREADER,ARE
695673701.003.png
Contents
Introduction IntroductiontoDashcodeUserGuide 9
Who Should Read This Document? 9
Organization of This Document 9
Getting and Running Dashcode 10
Reporting Bugs 10
See Also 11
Chapter1 DashboardWidgetTutorial 13
Before You Begin 13
Choose a Template 13
Set the Target Date 15
Test the Countdown 15
Customize the Widget’s Appearance 16
Add Functionality Using Parts 17
Write Code to Show the Apple Store 17
Deploy Your Widget 18
Chapter2 MobileSafariWebApplicationTutorial 19
Before You Begin 19
Choose a Template 19
Learn About the Template 21
Test the Default Product 21
Explore the Views in the Stack Layout 22
Add Functionality Using Parts 23
Write Code to Perform a Search 24
Deploy Your Mobile Safari Web Application 25
Chapter3 Dual-ProductWebApplicationTutorial 27
Before You Begin 27
Choose a Template 29
Save and Test the Default Web Applications 31
Customize the User Interface of the Safari Web Application 33
Specify a Data Source and Examine the Data Model 35
Create Bindings for the Safari Web Application 37
Create the First Binding 37
Create the Remaining Bindings 39
Test the Safari Web Application 40
Customize the User Interface of the Mobile Safari Web Application 40
2009-07-24 | © 2009 Apple Inc. All Rights Reserved.
3
695673701.004.png
CONTENTS
Create Bindings for the Mobile Safari Web Application 41
Create a Binding to an Element on the Master List Page 42
Create Four Bindings to Elements on the Detail Page 42
Test the Mobile Safari Web Application 43
Next Steps 43
Chapter4 StartingaProject 45
Creating a Project from a Template 45
Creating a Project from an Existing Dashboard Widget 45
Providing Attributes for a Dashboard Widget 46
Providing Attributes for a Web Application 46
Application Attributes for Safari Web Applications 47
Application Attributes for Mobile Safari Web Applications 47
Opening an Existing Dashboard Widget 49
Chapter5 DesigningtheUserInterfaceofaWidgetorWebApplication 51
Laying Out the Interface 51
Showing a Widget’s Sides 51
Adding Parts to an Interface 51
Using Photos from iPhoto 52
Changing an Element’s Properties 52
Arranging and Locking Elements 53
Absolute versus Document-Flow Positioning 54
Searching for Elements 54
Rulers and Guides 55
Placing a Widget’s Close Box 55
Disabling the Canvas 55
Previewing a Widget’s Default Image 55
Designing a Widget Icon 56
Designing a Web Clip Icon 56
Designing a Favicon 57
Chapter6 AddingSourceCodeandCreatingBindings 59
Viewing a Project’s Source Code 59
Viewing a Project’s Data Sources and Bindings 60
Using HTML, CSS, and JavaScript Programming Interfaces 61
Adding a Data Source 62
Creating Bindings 63
Adding a Value Transformer 64
Adding a Handler for an Event 65
Supporting Offline Usage of a Web Application 65
Adding or Removing a Web Application Product 66
Adding Code for Custom Controllers 67
4
2009-07-24 | © 2009 Apple Inc. All Rights Reserved.
695673701.005.png
CONTENTS
Code Completion Using Code Sense 67
Code Snippets 67
Adding and Moving Files and Folders 67
Resource Access for Widgets 68
Code Editing Preferences 69
Chapter7 TestingandSharing 71
Testing a Widget or a Web Application 71
The Run Log and Tracing Execution 73
Pausing and Step-by-Step Execution 73
Checking Values in Memory 74
Breakpoints 74
The Code Evaluator 74
Sharing a Widget 75
Deploying a Web Application 75
Chapter8 AdvancedTopicsforWidgets 77
Localization 77
Widget Plug-ins 77
AppendixA DashcodeTemplates 79
Widget Templates 79
The Custom Widget Template 79
The Countdown Template 79
The Maps Template 80
The RSS Widget Template 80
The Podcast Widget Template 80
The Photocast Template 81
The Quartz Composer Template 81
The Video Podcast Template 81
The Gauge Template 82
The Daily Feed Template 82
Web Application Templates 82
The Custom Web Application Template 83
The Browser Template 83
The Podcast Web Application Template 83
The RSS Web Application Template 83
The Utility Template 84
AppendixB DashcodeParts 85
Activity Indicator 85
Back Button 85
2009-07-24 | © 2009 Apple Inc. All Rights Reserved.
5
695673701.001.png
Zgłoś jeśli naruszono regulamin