Programming iOS 4 Fundamentals of iPhone iPad and
iPod Touch Development 1st Edition Matt Neuburg -
Downloadable PDF 2025
https://ebookfinal.com/download/programming-ios-4-fundamentals-of-
iphone-ipad-and-ipod-touch-development-1st-edition-matt-neuburg/
Visit ebookfinal.com today to download the complete set of
ebooks or textbooks
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
iOS 5 Programming Cookbook Solutions Examples for iPhone
iPad and iPod touch Apps 1st Edition Vandad Nahavandipoor
https://ebookfinal.com/download/ios-5-programming-cookbook-solutions-
examples-for-iphone-ipad-and-ipod-touch-apps-1st-edition-vandad-
nahavandipoor/
Programming iOS 5 2nd Edition Matt Neuburg
https://ebookfinal.com/download/programming-ios-5-2nd-edition-matt-
neuburg/
Beginning iOS Apps with Facebook and Twitter APIs for
iPhone iPad and iPod touch 1st Edition Chris Dannen
https://ebookfinal.com/download/beginning-ios-apps-with-facebook-and-
twitter-apis-for-iphone-ipad-and-ipod-touch-1st-edition-chris-dannen/
iOS 4 in Action Examples and Solutions for iPhone iPad
Jocelyn Harrington
https://ebookfinal.com/download/ios-4-in-action-examples-and-
solutions-for-iphone-ipad-jocelyn-harrington/
Programming iOS 8 Dive Deep into Views View Controllers
and Frameworks 5th Edition Matt Neuburg
https://ebookfinal.com/download/programming-ios-8-dive-deep-into-
views-view-controllers-and-frameworks-5th-edition-matt-neuburg/
Programming iOS 9 Dive Deep into Views View Controllers
and Frameworks 6th Edition Matt Neuburg
https://ebookfinal.com/download/programming-ios-9-dive-deep-into-
views-view-controllers-and-frameworks-6th-edition-matt-neuburg/
iOS Wow Factor UX Design Techniques for iPhone and iPad
1st Edition Tim Wood
https://ebookfinal.com/download/ios-wow-factor-ux-design-techniques-
for-iphone-and-ipad-1st-edition-tim-wood/
Beginning iPad Development for iPhone Developers Mastering
the iPad SDK 1st Edition Jack Nutting
https://ebookfinal.com/download/beginning-ipad-development-for-iphone-
developers-mastering-the-ipad-sdk-1st-edition-jack-nutting/
iPad and iPhone Kung Fu Tips Tricks Hints and Hacks for
iOS 7 1st Edition Keir Thomas
https://ebookfinal.com/download/ipad-and-iphone-kung-fu-tips-tricks-
hints-and-hacks-for-ios-7-1st-edition-keir-thomas/
Programming iOS 4 Fundamentals of iPhone iPad and
iPod Touch Development 1st Edition Matt Neuburg
Digital Instant Download
Author(s): Matt Neuburg
ISBN(s): 9781449388430, 1449388434
Edition: 1
File Details: PDF, 6.26 MB
Year: 2011
Language: english
Programming iOS 4
by Matt Neuburg
Copyright Š 2011 Matt Neuburg. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.
Editor: Brian Jepson
Production Editor: Teresa Elsey
Proofreader: Nancy Kotary
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrator: Robert Romano
Printing History:
May 2011: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. Programming iOS 4, the image of a kingbird, and related trade dress are trademarks
of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.
ISBN: 978-1-449-38843-0
[LSI]
1305160942
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Part I. Language
1. Just Enough C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Compilation, Statements, and Comments 4
Variable Declaration, Initialization, and Data Types 6
Structs 8
Pointers 10
Arrays 11
Operators 13
Flow Control and Conditions 15
Functions 19
Pointer Parameters and the Address Operator 22
Files 24
The Standard Library 27
More Preprocessor Directives 27
Data Type Qualifiers 28
2. Object-Based Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Objects 31
Messages and Methods 32
Classes and Instances 33
Class Methods 36
Instance Variables 37
The Object-Based Philosophy 39
3. Objective-C Objects and Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
An Instance Reference Is a Pointer 43
Instance References, Initialization, and nil 44
v
Instance References and Assignment 47
Instance References and Memory Management 48
Messages and Methods 49
Sending a Message 50
Declaring a Method 51
Nesting Method Calls 52
No Overloading 52
Parameter Lists 53
Unrecognized Selectors 53
Typecasting and the id Type 55
Messages as Data Type 58
C Functions and Struct Pointers 59
Blocks 61
4. Objective-C Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Class and Superclass 65
Interface and Implementation 66
Header File and Implementation File 68
Class Methods 71
The Secret Life of Classes 71
5. Objective-C Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
How Instances Are Created 73
Ready-Made Instances 73
Instantiation from Scratch 74
Nib-Based Instantiation 77
Polymorphism 78
The Keyword self 79
The Keyword super 82
Instance Variables and Accessors 84
Key–Value Coding 86
Properties 87
How to Write an Initializer 89
Part II. IDE
6. Anatomy of an Xcode Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
New Project 96
The Project Window 97
The Navigator Pane 99
The Utilities Pane 103
The Editor 104
vi | Table of Contents
The Project File and Its Dependents 106
The Target 109
Build Phases 109
Build Settings 110
Configurations 111
Schemes and Destinations 112
From Project to App 115
Build Settings 117
Property List Settings 117
Nib Files 118
Other Resources 118
Code 120
Frameworks and SDKs 121
7. Nib Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
A Tour of the Nib-Editing Interface 125
The Dock 127
Canvas 128
Inspectors and Libraries 130
Nib Loading and File’s Owner 132
Default Instances in the Main Nib File 133
Making and Loading a Nib 134
Outlet Connections 135
More Ways to Create Outlets 139
More About Outlets 141
Action Connections 142
Additional Initialization of Nib-Based Instances 146
8. Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
The Documentation Window 150
Class Documentation Pages 152
Sample Code 155
Other Resources 156
Quick Help 156
Symbols 157
Header Files 157
Internet Resources 158
9. Life Cycle of a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Choosing a Device Architecture 159
Localization 162
Editing Your Code 163
Autocompletion 164
Table of Contents | vii
Snippets 165
Live Syntax Checking 166
Navigating Your Code 166
Debugging 169
Caveman Debugging 169
The Xcode Debugger 171
Static Analyzer 176
Clean 177
Running in the Simulator 177
Running on a Device 178
Device Management 181
Version Control 181
Instruments 184
Distribution 184
Ad Hoc Distribution 186
Final App Preparations 187
Icons in the App 188
Other Icons 189
Launch Images 189
Screenshots 190
Property List Settings 191
Submission to the App Store 192
Part III. Cocoa
10. Cocoa Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Subclassing 197
Categories 200
Splitting a Class 201
Private Method Declarations 201
Protocols 202
Optional Methods 206
Some Foundation Classes 208
Useful Structs and Constants 208
NSString and Friends 208
NSDate and Friends 210
NSNumber 211
NSValue 211
NSData 212
Equality and Comparison 212
NSIndexSet 213
NSArray and NSMutableArray 213
viii | Table of Contents
NSSet and Friends 215
NSDictionary and NSMutableDictionary 215
NSNull 217
Immutable and Mutable 217
Property Lists 218
The Secret Life of NSObject 218
11. Cocoa Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Reasons for Events 224
Subclassing 224
Notifications 226
Receiving a Built-In Notification 226
Unregistering 228
NSTimer 228
Delegation 229
Data Sources 232
Actions 233
The Responder Chain 237
Deferring Responsibility 238
Nil-Targeted Actions 238
Application Lifetime Events 239
Swamped by Events 243
12. Accessors and Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Accessors 249
Key–Value Coding 251
Memory Management 254
The Golden Rules of Memory Management 255
How Cocoa Objects Manage Memory 257
Memory Management of Instance Variables 260
Instance Variable Memory Management Policies 263
Autorelease 264
Nib Loading and Memory Management 266
Memory Management Comments on Earlier Examples 267
Memory Management of Pointer-to-Void Context Info 269
Memory Management of C Struct Pointers 270
Properties 271
13. Data Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Model–View–Controller 277
Instance Visibility 279
Visibility by Instantiation 280
Visibility by Relationship 281
Table of Contents | ix
Global Visibility 281
Notifications 282
Key–Value Observing 284
Part IV. Views
14. Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
The Window 293
Subview and Superview 295
Frame 298
Bounds and Center 299
Layout 302
Transform 305
Visibility and Opacity 308
15. Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
UIImage and UIImageView 311
UIImage and Graphics Contexts 313
CGImage 315
Drawing a UIView 318
Graphics Context State 320
Paths 321
Clipping 325
Gradients 326
Colors and Patterns 328
Graphics Context Transforms 330
Shadows 332
Points and Pixels 332
Content Mode 333
16. Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
View and Layer 336
Layers and Sublayers 337
Manipulating the Layer Hierarchy 339
Positioning a Sublayer 339
CAScrollLayer 340
Layout of Sublayers 341
Drawing in a Layer 341
Contents Image 341
Contents on Demand 342
Contents Resizing and Positioning 343
Layers that Draw Themselves 345
x | Table of Contents
Transforms 346
Depth 350
Transforms and Key–Value Coding 352
Shadows, Borders, and More 353
Layers and Key–Value Coding 354
17. Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Drawing, Animation, and Threading 358
UIImageView Animation 361
View Animation 362
Animation Blocks 362
Modifying an Animation Block 363
Transition Animations 366
Block-Based View Animation 368
Implicit Layer Animation 371
Animation Transactions 372
Media Timing Functions 373
Core Animation 374
CABasicAnimation and Its Inheritance 375
Using a CABasicAnimation 376
Keyframe Animation 379
Making a Property Animatable 380
Grouped Animations 381
Transitions 385
The Animations List 386
Actions 389
What an Action Is 389
The Action Search 390
Hooking Into the Action Search 391
Nonproperty Actions 394
18. Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Touch Events and Views 398
Receiving Touches 400
Restricting Touches 401
Interpreting Touches 402
Gesture Recognizers 408
Distinguishing Gestures Manually 408
Gesture Recognizer Classes 412
Multiple Gesture Recognizers 416
Subclassing Gesture Recognizers 418
Gesture Recognizer Delegate 419
Touch Delivery 422
Table of Contents | xi
Hit-Testing 423
Initial Touch Event Delivery 427
Gesture Recognizer and View 427
Touch Exclusion Logic 429
Recognition 430
Touches and the Responder Chain 431
Part V. Interface
19. View Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Creating a View Controller 437
Manual View Controller, Manual View 438
Manual View Controller, Nib View 441
Nib-Instantiated View Controller 443
No View 445
Up-Shifted Root View 446
Rotation 447
Initial Orientation 448
Rotation Events 452
Modal Views 453
Modal View Configuration 454
Modal View Presentation 456
Modal View Dismissal 457
Modal Views and Rotation 459
Tab Bar Controllers 461
Tab Bar Item Images 462
Configuring a Tab Bar Controller 463
Navigation Controllers 464
Bar Button Items 466
Configuring a Navigation Interface 468
Navigation Interface Rotation 474
View Controller Lifetime Events 476
View Controller Memory Management 477
20. Scroll Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Creating a Scroll View 482
Scrolling 484
Paging 487
Tiling 488
Zooming 491
Zooming Programmatically 493
Zooming with Detail 493
xii | Table of Contents
Scroll View Delegate 499
Scroll View Touches 500
Scroll View Performance 503
21. Table Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Table View Cells 507
Built-In Cell Styles 508
Custom Cells 512
Table View Data 517
The Three Big Questions 518
Table View Sections 521
Refreshing Table View Data 524
Variable Row Heights 526
Table View Selection 528
Table View Scrolling and Layout 533
Table View Searching 533
Table View Editing 539
Deleting Table Items 541
Editable Content in Table Items 543
Inserting Table Items 544
Rearranging Table Items 546
22. Popovers and Split Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Presenting a Popover 550
Managing a Popover 553
Dismissing a Popover 554
Automatic Popovers 557
Split Views 558
23. Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
UILabel 564
UITextField 565
Editing and the Keyboard 568
Configuring the Keyboard 572
Text Field Delegate and Control Event Messages 572
The Text Field Menu 574
UITextView 576
Core Text 579
24. Web Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Loading Content 588
Communicating with a Web View 593
Table of Contents | xiii
25. Controls and Other Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
UIActivityIndicatorView 597
UIProgressView 598
UIPickerView 600
UISearchBar 602
UIControl 604
UISwitch 605
UIPageControl 605
UIDatePicker 606
UISlider 609
UISegmentedControl 612
UIButton 614
Custom Controls 617
Bars 620
UINavigationBar 621
UIToolbar 623
UITabBar 623
26. Modal Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Alert View 630
Action Sheet 631
Dialog Alternatives 635
Local Notifications 636
Part VI. Some Frameworks
27. Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
System Sounds 643
Audio Session 644
Audio Player 648
Remote Control of Your Sound 650
Playing Sound in the Background 651
Further Topics in Sound 653
28. Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
MPMoviePlayerController 656
MPMoviePlayerViewController 660
UIVideoEditorController 661
Further Topics in Video 662
29. Music Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Exploring the Music Library 667
xiv | Table of Contents
The Music Player 671
The Music Picker 675
30. Photo Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
UIImagePickerController 679
Choosing from the Photo Library 680
Using the Camera 681
The Assets Library Framework 684
31. Address Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
Address Book Database 687
Address Book Interface 690
ABPeoplePickerNavigationController 690
ABPersonViewController 692
ABNewPersonViewController 692
ABUnknownPersonViewController 693
32. Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Calendar Database 695
Calendar Interface 700
33. Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Mail Message 703
SMS Message 704
34. Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Presenting a Map 705
Annotations 706
Overlays 712
35. Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
Location 717
Heading and Course 719
Acceleration 720
Shake Events 721
UIAccelerometer 722
Core Motion 725
Table of Contents | xv
Part VII. Final Topics
36. Persistent Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
The Sandbox 729
Basic File Operations 730
Saving and Reading Files 731
User Defaults 733
File Sharing 735
Document Types 735
Handing Off a Document 737
XML 740
SQLite 746
Image File Formats 747
37. Basic Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
HTTP Requests 751
Bonjour 757
Push Notifications 759
Beyond Basic Networking 760
38. Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
The Main Thread 761
Why Threading Is Hard 764
Three Ways of Threading 765
Manual Threads 766
NSOperation 768
Grand Central Dispatch 772
Threads and App Backgrounding 775
39. Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
The Undo Manager 779
The Undo Interface 782
The Undo Architecture 785
40. Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
xvi | Table of Contents
Preface
Aut lego vel scribo; doceo scrutorve sophian.
—Sedulius Scottus
With the advent of version 2 of the iPhone system, Apple proved they could do a re-
markable thing — adapt their existing Cocoa computer application programming
framework to make applications for a touch-based device with limited memory and
speed and a dauntingly tiny display. The resulting Cocoa Touch framework, in fact,
turned out to be in many ways better than the original Cocoa.
A programming framework has a kind of personality, an overall flavor that provides an
insight into the goals and mindset of those who created it. When I first encountered
Cocoa Touch, my assessment of its personality was: “Wow, the people who wrote this
are really clever!” On the one hand, the number of built-in interface widgets was se-
verely and deliberately limited; on the other hand, the power and flexibility of some of
those widgets, especially such things as UITableView, was greatly enhanced over their
Mac OS X counterparts. Even more important, Apple created a particularly brilliant
way (UIViewController) to help the programmer make entire blocks of interface come
and go and supplant one another in a controlled, hierarchical manner, thus allowing
that tiny iPhone display to unfold virtually into multiple interface worlds within a single
app without the user becoming lost or confused.
Even more impressive, Apple took the opportunity to recreate and rationalize Cocoa
from the ground up as Cocoa Touch. Cocoa itself is very old, having begun life as
NeXTStep before Mac OS X even existed. It has grown by accretion and with a certain
conservatism in order to maintain something like backward compatibility. With Cocoa
Touch, on the other hand, Apple had the opportunity to throw out the baby with the
bath water, and they seized this opportunity with both hands.
So, although Cocoa Touch is conceptually based on Mac OS X Cocoa, it is very clearly
not Mac OS X Cocoa, nor is it limited or defined by Mac OS X Cocoa. It’s an inde-
pendent creature, a leaner, meaner, smarter Cocoa. I could praise Cocoa Touch’s de-
liberate use of systematization (and its healthy respect for Occam’s Razor) through
numerous examples. Where Mac OS X’s animation layers are glommed onto views as
a kind of afterthought, a Cocoa Touch view always has an animation layer counterpart.
xvii
Memory management policies, such as how top-level objects are managed when a nib
loads, are simplified and clarified. And so on.
At the same time, Cocoa Touch is still a form of Cocoa. It still requires a knowledge of
Objective-C. It is not a scripting language; it is certainly not aimed at nonprogrammers,
like HyperCard’s HyperTalk or Apple’s AppleScript. It is still huge and complicated.
In fact, it’s rather difficult.
Meanwhile, Cocoa Touch itself evolves and changes. The iPhone System 2 matured
into the iPhone System 3. Then there was a sudden sally in a new direction when the
iPad introduced a larger screen and iPhone System 3.2. The iPhone 4 and its double-
resolution Retina display also ran on a major system increment, now dubbed iOS 4.
Every one of these changes has brought new complexities for the programmer to deal
with. To give just one simple example, users rightly complained that switching between
apps on the iPhone meant quitting one app and launching another. So Apple gave the
iPhone 4 the power of multitasking; the user can switch away from an app and then
return to it later to find it still running and in the state it was left previously. All well
and good, but now programmers must scurry to make their apps compatible with mul-
titasking, which is not at all trivial.
The popularity of the iPhone, with its largely free or very inexpensive apps, and the
subsequent popularity of the iPad, have brought and will continue to bring into the
fold many new programmers who see programming for these devices as worthwhile
and doable, even though they may not have felt the same way about Mac OS X. Apple’s
own annual WWDC developer conventions have reflected this trend, with their em-
phasis shifted from Mac OS X to iOS instruction.
The widespread eagerness to program iOS, however, though delightful on the one
hand, has also fostered a certain tendency to try to run without first learning to walk.
iOS gives the programmer mighty powers that can seem as limitless as imagination
itself, but it also has fundamentals. I often see questions online from programmers who
are evidently deep into the creation of some interesting app, but who are stymied in a
way that reveals quite clearly that they are unfamiliar with the basics of the very world
in which they are so happily cavorting.
It is this state of affairs that has motivated me to write this book, which is intended to
ground the reader in the fundamentals of iOS. I love Cocoa and have long wished to
write about it, but it is iOS and its popularity that has given me a proximate excuse to
do so. Indeed, my working title was “Fundamentals of Cocoa Touch Programming.”
HereIhaveattemptedtomarshalandexpound,inwhatIhopeisapedagogicallyhelpful
and instructive yet ruthlessly Euclidean and logical order, the principles on which
sound iOS programming rests, including a good basic knowledge of Objective-C (start-
ing with C itself) and the nature of object-oriented programming, advice on the use of
the tools, the full story on how Cocoa objects are instantiated, referred to, put in com-
munication with one another, and managed over their lifetimes, and a survey of the
primary interface widgets and other common tasks. My hope, as with my previous
xviii | Preface
books, is that you will both read this book cover to cover (learning something new often
enough to keep you turning the pages) and keep it by you as a handy reference.
This book is not intended to disparage Apple’s own documentation and example
projects. They are wonderful resources and have become more wonderful as time goes
on. I have depended heavily on them in the preparation of this book. But I also find
that they don’t fulfill the same function as a reasoned, ordered presentation of the facts.
The online documentation must make assumptions as to how much you already know;
it can’t guarantee that you’ll approach it in a given order. And online documentation
is more suitable to reference than to instruction. A fully written example, no matter
how well commented, is difficult to follow; it demonstrates, but it does not teach.
A book, on the other hand, has numbered chapters and sequential pages; I can assume
you know C before you know Objective-C for the simple reason that Chapter 1 precedes
Chapter 2. And along with facts, I also bring to the table a degree of experience, which
I try to communicate to you. Throughout this book you’ll see me referring to “common
beginner mistakes”; in most cases, these are mistakes that I have made myself, in ad-
dition to seeing others make them. I try to tell you what the pitfalls are because I assume
that, in the course of things, you will otherwise fall into them just as naturally as I did
as I was learning. You’ll also see me construct many examples piece by piece or extract
and explain just one tiny portion of a larger app. It is not a massive finished program
that teaches programming, but an exposition of the thought process that developed
that program. It is this thought process, more than anything else, that I hope you will
gain from reading this book.
iOS is huge, massive, immense. It’s far too big to be encompassed in a book even of
this size. And in any case, that would be inappropriate and unnecessary. There are
entire areas of Cocoa Touch that I have ruthlessly avoided discussing. Some of them
would require an entire book of their own. Others you can pick up well enough, when
the time comes, from the documentation. This book is only a beginning — the funda-
mentals. But I hope that it will be the firm foundation that will make it easier for you
to tackle whatever lies beyond, in your own fun and rewarding iOS programming fu-
ture.
In closing, some version numbers, so that you know what assumptions I am making.
At the time I started writing this book, system versions 3.1.3 (on the iPhone) and 3.2
(on the iPad) were most recent. As I was working on the book, iOS 4 and the iPhone 4
came into being, but it didn’t yet run on the iPad. Subsequently iOS 4.2 emerged: the
first system able to run on both the iPhone and the iPad. At the same time, Xcode was
improved up to 3.2.5.
Then, just in time for my final revisions, Xcode 3.2.6 and iOS 4.3 were released, along
withthefirstpublicversionofthelong-awaitedXcode4.Xcode4isathoroughoverhaul
of the IDE: menus, windows, and preferences are quite different from Xcode 3.2.x. At
the same time, both Xcode 4 and Xcode 3.2.x can coexist on the same machine and
can be used to work on the same project; moreover, Xcode 3.2.x has some specialized
Preface | xix
capabilities that Xcode 4 lacks, so some long-standing developers may well continue
to use it. This situation presents a dilemma for an author describing the development
process. However, for iOS programming, I recommend adoption of Xcode 4, and this
book assumes that you have adopted it.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements
such as variable or function names, databases, data types, environment variables,
statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values deter-
mined by context.
This icon signifies a tip, suggestion, or general note.
This icon indicates a warning or caution.
Using Code Examples
This book is here to help you get your job done. In general, you may use the code in
this book in your programs and documentation. You do not need to contact us for
permission unless you’re reproducing a significant portion of the code. For example,
writing a program that uses several chunks of code from this book does not require
permission. Selling or distributing a CD-ROM of examples from O’Reilly books does
require permission. Answering a question by citing this book and quoting example
code does not require permission. Incorporating a significant amount of example code
from this book into your product’s documentation does require permission.
xx | Preface
We appreciate, but do not require, attribution. An attribution usually includes the title,
author, publisher, and ISBN. For example: “Programming iOS 4 by Matt Neuburg
(O’Reilly). Copyright 2011 Matt Neuburg, 978-1-449-38843-0.”
If you feel your use of code examples falls outside fair use or the permission given above,
feel free to contact us at permissions@oreilly.com.
SafariÂŽ Books Online
Safari Books Online is an on-demand digital library that lets you easily
search over 7,500 technology and creative reference books and videos to
find the answers you need quickly.
Withasubscription,youcanreadanypageandwatchanyvideofromourlibraryonline.
Read books on your cell phone and mobile devices. Access new titles before they are
available for print, and get exclusive access to manuscripts in development and post
feedback for the authors. Copy and paste code samples, organize your favorites, down-
load chapters, bookmark key sections, create notes, print out pages, and benefit from
tons of other time-saving features.
O’Reilly Media has uploaded this book to the Safari Books Online service. To have full
digital access to this book and others on similar topics from O’Reilly and other pub-
lishers, sign up for free at http://my.safaribooksonline.com.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
We have a web page for this book, where we list errata, examples, and any additional
information. You can access this page at:
http://oreilly.com/catalog/0636920010258/
To comment or ask technical questions about this book, send email to:
bookquestions@oreilly.com
For more information about our books, courses, conferences, and news, see our website
at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Preface | xxi
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Acknowledgments
It’s a poor craftsman who blames his tools. No blame attaches to the really great tools
by which I have been assisted in the writing of this book. I am particularly grateful to
the Unicomp Model M keyboard (http://pckeyboard.com), without which I could not
have produced so large a book so painlessly. I was also aided by wonderful software,
including TextMate (http://macromates.com) and AsciiDoc (http://www.methods.co.nz/
asciidoc). BBEdit (http://www.barebones.com) helped with its diff display. Screenshots
were created with Snapz Pro X (http://www.ambrosiasw.com) and GraphicConverter
(http://www.lemkesoft.com); diagrams were drawn with OmniGraffle (http://www.om
nigroup.com).
The splendid O’Reilly production process converted my AsciiDoc text files into PDF
while I worked, allowing me to proofread in simulated book format. Were it not for
this, and the Early Release program that permitted me to provide my readers with
periodic updates of the book as it grew, I would never have agreed to undertake this
project in the first place. I would like particularly to thank Tools maven Abby Fox for
her constant assistance.
I have taken advice from two tech reviewers, Dave Smith and David Rowland, and have
been assisted materially and spiritually by many readers who submitted errata and
encouragement. I was particularly fortunate in having Brian Jepson as editor; he pro-
vided enthusiasm for the O’Reilly tools and the electronic book formats, a watchful
eye, and a trusting attitude; he also endured the role of communications pipeline when
I needed to prod various parts of the O’Reilly machine. I have never written an O’Reilly
book without the help of Nancy Kotary, and I didn’t intend to start now; her sharp eye
has smoothed the bristles of my punctuation-laden style. For errors that remain, I take
responsibility, of course.
xxii | Preface
Another Random Scribd Document
with Unrelated Content
The text on this page is estimated to be only 27.32%
accurate
DIRECT ELECTRIC CURRENTS. 1409 ohm = 0.239" gramme
of water raised 1° C. H = PRt X 0.239 gramme calories = I*Rt X
0.0009478 British thermal units. In electric lighting the energy of the
current is converted into heat in the lamps. The resistance of the
lamp is made great so that the required quantity of heat may be
developed, wnile in the wire leading to and from the lamp the
resistance is made as small as is commercially practicable, so that as
little energy as possible may be wasted in heating the wire. Heating
of Conductors. (From Kapp's Electrical Transmission of Energy.) — It
becomes a matter of great importance to determine beforehand
what rise in temperature' is to be expected in each given case, and if
that rise should be found o be greater than appears safe, provision
must be made to increase the rate at which heat is carried off. This
can generally be done by increasing the superficial area of the
conductor. Say we have one circular conductor of 1 square inch area,
and find that with 1000 amperes flowing it would become too hot.
Now by splitting up this conductor into 10 separate wires each one-
tenth of a square inch crosssectional area, we have not altered the
total amount of energy transformed into heat, but we have
increased the surface exposed to the cooling action of the
surrounding air in the ratio of 1 : v^lO, and therefore the ten thin
wires can dissipate more than three times the heat, as compared
with the single thick wire. Prof. Forbes states that an insulated wire
carries a greater current without overheating than a bare wire if the
diameter be not too great, Assuming the diameter of the cable to be
twice the diam. of the conductor, a greater current can be carried in
insulated wires than in bare wires up to 1.9 inch diam. of conductor.
If diam. of cable = 4 times diam. of conductor, this is the case up to
1.1 inch diam. of conductor. Heating of Bare Wires. — The following
formulae are given by Keimelly: 72 . 7 72 x 90,000 + t; d=44.8 ' J.
•"• -7j /S J7Ufuuw T «,, u. — l-*.o ^ ~ . ' T = temperature of the
wire and t that of the air, in Fahrenheit degrees; 7 - current in
amperes, d = diameter of the wire in mils. If we take T - t = 90° F.,
^/90 = 4.48, then d •= 10 $1* and 7 = V^3 .4. 1000. This latter
formula gives for the carrying capacity in amperes of bare wires
almost exactly the figures given for weather-proof wires in the Fire
Underwriters' table, except in the case of Nos. 18 and 16, B. & S.
gauge, for which the formula gives 8 and 11 amperes, respectively,
instead of 5 and 8 amperes, given in the table. Heating of Coils. —
The rise of temperature in magnet coils due to the passage of
current through the wire is approximately proportional to the watts
lost in the coil per unit of effective radiating surface, thus: . PR . PR
toe— or «-•££• t being the temperature rise in degrees Fahr.; St the
effective radiating surface; and k a coefficient which varies widely,
according to condition. In electromagnet coils of small size and
power, k may be as large as 0.015. Ordinarily it ranges from 0.012
down to 0.005; a fair average is 0.007. The more exposed the coil is
to air circulation, the larger is the value of k the larger the
proportion of iron to copper, by weight, in the core and winding, the
thinner the winding with relation to its dimension parallel with the
magnet core, and the larger the "space factor" of the winding, the
larger will be the value of k.- The space factor is the ratio of the
actual C9pper cross-section of the whole coil to the gross cross-
section of copper, insulation, and interstices. Fusion of Wires. — W.
H. Preece gives a formula for the current required to fuse wires of
different metals, viz., I = ad*h in which d is the diameter in inches
and a a coefficient whose value for different metals is as follows:
Copper, 10,244; aluminum, 7585; platinum, 5172; German silver,
5230; platinoid, 4750; iron, 3148; tin, 1462; lead, 1379; alloy of 2
lead and 1 tin, 1318.
The text on this page is estimated to be only 26.60%
accurate
1410 ELECTRICAL ENGINEERING. Allowable Carrying
Capacity of Copper Wires. (For inside wiring, National Board of Fire
Underwriters' Rules.) B.&S. Gauge. Circular Mils. Amperes. Circular
Mils. Amperes. Rubber Covered. Other Insulation. Rubber Covered.
Other Insulation. 18 1,624 3 5 200,000 200 300 16 2,583 6 8
300,000 270 400 14 4,107 12 16 400,000 330 500 12 6,530 17 23
500,000 390 590 10 10,380 24 32 600,000 450 680 8 16,510 33 46
700,000 500 760 6 26,250 46 65 800,000 550 840 5 33,100 54 77
900,000 600 920 4 41,740 65 92 ,000,000 650 ,000 3 52,630 76 110
,100,000 690 ,080 2 66,370 90 131 ,200,000 730 ,150 83,690 107
156 ,300,000 770 ,220 0 105,500 127 185 ,400,000 810 ,290 00
133,100 150 220 ,600,000 890 ,430 000 167,800 177 262 ,800,000
970 ,550 0000 211,600 210 312 2,000,000 1,050 ,670 Wires smaller
than No. 14 B. & S. gauge must not be used except in fixtures and
pendant cords. The lower limit is specified for rubber-covered wires
to prevent deterioration of the insulation by the heat of the wires.
For insulated aluminum wire the safe-carrying capacity is 84 per cent
of that of copper wire with the same insulation. See pamphlets
published by the National Board of Fire Underwriters, New York, for
complete specifications and rules for wiring. Underwriters' Insulation.
— The thickness of insulation required by the rules of the National
Board of Fire Underwriters varies with the size of the wire, the
character of the insulatipn, and the voltage. The thickness of
insulation on rubber-covered wires carrying voltages up to 600 varies
from 1/32 inch for a No. 18 B. & S. gauge wire to 1/8 inch for a wire
of 1.000,000 circular mils. Weather-proof insulation is required to be
slightly thicker. For voltages of over 600 the insulation varies from
i/ie inch for No. 14 B. & S. gage to 9/64 inch for 1,000,000 C. JM.
and over. ELECTRIC TRANSMISSION, DIRECT CURRENTS. Cross-
section of Wire Required fof a Given Current. — Let R = resistance
of a given line of copper wire, in ohms; r = " "1 mil-foot of copper; L
= length of wire, in feet; e = drop in voltage between the two ends;
I = current, in amperes; A = sectional area of wire, in circular mils;
then I = — ; R = y ; R = r ^; whence A = r-^. The value of r for
soft copper wire at 68° F. is 10.371 international ohms. For ordinary
drawn copper wire the value of 10.8 is commonly taken,
corresponding to a conductivity of 97.2 per cent. For a circuit, going
and return, the total length is 2 L, and the formula becomes A =
21.67L H- e, L here being the distance from the point of supply to
the point of deh'very. If E is the voltage at the generator and a the
per cent of drop in the line, then e = Ea -r- 100, and A = 2160 IL -
=- aE. jp 21 An P7" If P = the power in watts, = El, then I = •=?,
and A = =^ — . Cj CLEj* If Pj. = the power in kilowatts, A =
2,160,000 P^L + aE2. If Lm = the distance in miles and A^, the
area in circular inches, then
The text on this page is estimated to be only 27.17%
accurate
ELECTRIC TRANSMISSION, DIRECT CURRENT. 1411 Ac =
6405 PkLm + aE2. If As = area in square inches, As = 5030 PkLm H-
aE2. When the area in circular mils has been determined by either of
these formulae reference should be made to the table of Allowable
Capacity of Wires, to see if the calculated size is sufficient to avoid
overheating. For all interior wiring the rules of the National Board of
Fire Underwriters should be followed. Weight o'f Copper for a Given
Power. — Taking the weight of a mil-foot of copper at 0.000003027
lb., the weight of copper in a circuit of length 2 Land cross-section A,
in circ. mils, is 0.000006054 LA Ibs., = W. Substituting for A its value
2 160 PL •*• aE2 we have W = 0.0 130766 PL2 ' -*• aE2; P in watts,
L in ft. W = 13.0766 PkL2 -*• aE2; P& in kilowatts, L in ft. W =
364,556,000 PkL2m + aE2; Pk in kilowatts, Lm in miles. The weight
of copper required varies directly as the power transmitted ;
inversely as the percentage of drop or loss; directly as the square of
the distance; and inversely as the square of the voltage. From the
last formula the following table has been calculated: WEIGHT OF
COPPER WIRE TO CARRY 1000 KILOWATTS WITH 10% Loss.
Distance in Miles. 1 5 10 20 50 100 Volts. Weight in Lbs. 500 1,000
2,000 5,000 10,000 20,000 40,000 60.000 145,822 36,456 9,114
1,458 365 91 3,645,560 911,390 227,848 36,456 9,114 2,278 570
3,645,560 911,390 145,822 36,456 9,114 2.278 1,013 3,645,560
593,290 145,822 36,456 9,114 4,051 3,645,560 911,390 227,848 *
56,962 25,316 3,645.560 911,390 227,848 101,266 In calculating
the distance, an addition of about 5 per cent should be made for sag
of the wires. Short-circuiting. — From the law I = E/R it is seen that
with any pressure E, the current I will become very great if R is
made very small. In short-circuiting the resistance becomes small
and the current therefore great. Hence the dangers of short-
circuiting a current. ECONOMY OF ELECTRIC TRANSMISSION. The
loss of power in a transmission line is ordinarily given in per cent of
the total power consumed in the conductors at maximum load.
Whatever the line pressure may be, the size of the conductors varies
inversely with the percentage of loss. Consequently the maximum
line loss which can be allowed is dependent on the most economical
size of the line conductors. In 1881 Lord Kelvin gave out a statement
in regard to the most economical size of conductors. This statement,
which is known as "Kelvin's law," was as follows: "The most
economical area of conductor will be that for which the annual
interest on the capital outlay equals the annual cost of energy
wasted." According to this rule, the cheaper the cost of power, the
less should be the capital outlay for the conductors, thus allowing a
smaller size to be used. George Forbes states that the most
economical section of the conductor is independent of the voltage
and the distance, and is proportional to the current. It is generally
assumed that the cost of the pole line and the insulators is constant
and not affected by the variation in the size of the line conductors. If
A = interest cost per year of conductors erected, in dollars, B =
value of the line loss per year, in dollars; then for the most
economical cross-section of the conductors A =J3.
The text on this page is estimated to be only 26.67%
accurate
1412 ELECTRICAL ENGINEERING. If K = Cost per kilowatt-
year of lost power, in dollars, KI = Cost per pound of wires erected,
in dollars, L = Length of line in 1000 ft., ÂŁ>a s= Cross-section of
conductor in circular mils, I = Line current in amperes, p = per cent
interest, then A = ^ X KI x 0.003 XLXD*. L B = K X Iz X 10.5 X j=c2
^ x KI x 0.003 XLXD* = KXI*X lo.s'x ^, Z>2 = 592 I D* is the cross-
section, in circular mils, that will give the most economical line loss.
In the following, the above equation is worked out for three different
rates of interest: For 4%, Z>2 = 296 I |— ; For 5%, DZ = 265 I l
— ; II KI i KI ' For 6%, D* = 242 I l— » KI In determining the value
of I, care must be taken that the annual mean value of the current is
used. The value of K must also be the one for which the power,
representing the line loss, can be produced, and not that for which it
can be sold. Wire Tables. — The tables on the following page show
the relation between load, distance, and "drop" or loss by voltage in
a two- wire direct-current circuit of any standard size of wire. The
tables are based on the formula (21.6 IL) -7- A - Drop in volts. I =
current in amperes, L = distance in feet from point of supply to point
of delivery, A = sectional area of wire in circular mils. The factors I
and L are combined in the table, in the compound factor "ampere
feet." EXAMPLES IN THE USE OF THE WIRE TABLES. — 1. Required
the maximum load in amperes at 220 volts that can be carried 95
feet by No. 6 wire without exceeding 11/2% drop. Find No. 6 in the
220-volt column of Table I; opposite this in the 1V2% column is the
number 4005, which is the ampere-feet. Dividing this by the
required distance (95 feet) gives the load, 42.15 amperes. Example
2. A 500- volt line is to carry 100 amperes 600 feet with a drop not
exceeding 5 % ; what size of wire will be required? The ampere-feet
will be 100 X 600 = 60,000. Referring to the 5% column of Table II,
the nearest number of ampere-feet is 60,750, which is opposite No.
3 wire in the 500- volt column. These tables also show the
percentage of the power delivered to a line that is lost in non-
inductive alternating-current circuits. Such circuits are obtained
when the load consists of incandescent lamps and the circuit wires
lie only an inch or two apart, as in conduit wiring. Efficiency of
Electric Systems. — The efficiency of a system is the ratio of the
power delivered by the electric motors at the distant end of the line
to the power delivered to the dynamo-electric machines at the other
end. The efficiency of a generator or motor varies with its load and
with the size of the machine, ranging about as follows: Average Full-
load Efficiency of Generators: K.W 25 50 100 200 500 1000 2000
3000 Eff. % 88 90 91 92 93 94 94.5 95 Average Full-load Efficiency
of Motors: H.P 1 2 5 10 25 50 100 200 500 Eff. % .... 80 82 85 87
88 90 * 91 92 93 The efficiency of both generators and motors
decreases, at first very
The text on this page is estimated to be only 27.48%
accurate
ELECTRIC TRANSMISSION, DIRECT CURRENT. 1413 WIRE
TABLE — RELATION BETWEEN LOAD, DISTANCE, Loss, AND SIZE
OF CONDUCTOR. NOTE. — The numbers in the body of the tables
are Ampere-Feet, i.e., Amperes X Distance (length of one wire). See
examples below. Table I. — 110-volt and 220-volt Two-wire Circuits.
Wire Sizes; B. & S. Gauge. Line Loss in Percentage of the Rated
Voltage; and Power Loss in Percentage of the Delivered Power. 110V.
220V. 1 •H/2 2 3 4 5 6 8 10 0000 000 0000 000 00 0 1 21,550
17,080 13,550 10,750 8,520 32,325 25,620 20,325 16,125 12,780
43,100 34,160 27,100 21,500 17,040 64,650 51,240 40,650 32,250
25,560 86,200 68,320 54,200 43,000 34,080 107,750 85,400 67,750
53,750 42,600 129,300 102,480 81,300 64,500 51,120 172,400
136,640 108,400 86,000 68,160 215,500 170,800 135,500 107,500
85,200 00 0 1 2 3 2 3 4 6 6,750 5,360 4,250 3,370 2,670 10,140
8,040 6,375 5,055 4,005 13,520 10,720 8,500 6,740 5,340 20,280
16,080 12,750 10,110 8,010 27,040 21,4^0 17,000 13,480 10,680
33,800 26,800 21,250 16,850 13,350 40,560 32,160 25,500 20,220
16,020 54,080 42,880 34,000 26,960 21,360 67,600 53,600 42,500
33,700 26,700 4 6 7 8 7 8 9 10 11 2,120 1,680 1,330 1,055 838
3,180 2,520 1,995 1,582 1,257 4,240 3,360 2,660 2,110 1,675 6,360
5,040 3,990 3,165 2,514 8,480 6,720 5,320 4,220 3,350 10,600
8,400 6,650 5,275 4,190 12,720 10,800 7,980 6,330 5,028 16,960
13,440 10,640 8,440 6,700 21,200 16,800 13,300 10,550 8,380 9 10
11 12 14 12 13 14 665 527 418 332 209 997 790 627 498 313 1,330
1,054 836 665 418 1,995 1,580 1,254 997 627 2,660 2,108 1,672
1,330 836 3,320 2,635 2,090 1,660 1.045 3,990 3,160 2,508 1,995
1,354 5,320 4,215 3,344 2,660 1,672 . 6.650 5J270 4,180 3,325
2,090 Table II. — 500, 1000, and 2000 Volt Circuits. Wire Sizes; B. &
S. Gauge. Line Loss in Percentage of the Rated Voltage ; and Power
Loss in Percentage of the Delivered Power. 500V. 1000V. 2000V. 1
H/2 2 2V2 3 4 5 0000 000 00 0 1 2 3 4 5 6 7 8 9 10 n 12 14 0000
000 00 0 1 2 3 4 6 7 8 9 10 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10 11
12 13 14 97,960 77,690 61,620 48,880 38,750 30,760 24,370 19,320
15,320 12,150 9,640 7,640 6,060 4,805 3,810 3,020 2,395 1,900
1,510 950 146,940 116,535 92,430 73,320 58,125 46,140 36,555
28,980 22,980 18,225 14,460 11,460 9,090 7,207 5,715 4,530 3,592
2,850 2,265 1,425 195,920 155,380 123,240 97,760 77,500 61,520
48,740 38,640 30,640 24,300 19,280 15,280 12,120 9,610 7,620
6,040 4,790 3,800 3,020 1,900 244,900 194,225 154,050 122,200
96,875 76,900 60,925 48,300 38,300 30,375 24,100 19,100 15,150
12,010 9,525 7,550 5,985 4,750 3,775 2.375 293,880 233,970
184,860 146,640 116,250 92,280 73,110 57,960 45,960 36,450
28,920 22,920 18,180 14,415 11,430 9,060 7,185 5,700 4,530 2,850
391,840 310,760 246,480 195,420 155,000 123,040 97,480 77,280
61,280 48,300 38,560 30,560 24,240 19,220 15,220 12,080 9,580
7,600 6,040 3,800 489,800 388,450 308,100 244,400 193,750
153,800 121,850 96,600 76,600 60,750 48,200 38,200 30,300
24,025 19,050 15,100 11,975 9,500 7,550 4,750
The text on this page is estimated to be only 27.92%
accurate
1414 ELECTRICAL ENGINEERING. slowly and then more
rapidly, as the load decreases. Each machine has its "characteristic"
curve of efficiency, showing the ratio of output to input at different
loads. Roughly the decrease in efficiency for directcurrent machines
at half-load varies from 3% to 10% for the smallest sizes. The loss in
transmission, due to fall in electrical pressure or "dop" in the line, is
governed by the size of the wires, the other conditions remaining the
same. For a long-distance transmission plant this will vary from 5 %
upwards. With generator efficiency and motor efficiency each 90%,
and transmission loss 5 %, the combined efficiency is 0.90 X 0.90 X
0.95 = 76.95 %. Resistances of Pure Aluminum Wire.* Conductivity
62 in the Matthiesen Standard Scale. Pure aluminum weighs 167.111
pounds per cubic foot. II OM gog
The text on this page is estimated to be only 27.00%
accurate
ELECTRIC RAILWAYS. 1415 INTERURBAN SERVICE. Max.
Miles I >etween Stops. Speed. 1/1 3/4 1 1.5 2 3 4 5 10 30. 14 0 15
5 16 7 18 5 19.7 21 0 22 0 22 5 23 9 40. . 15.4 18.1 20.0 22.7 24.5
26.7 28.0 28.9 30 8 50 16 2 19 5 21 9 25 6 27 9 31 0 32 9 34 2 37 2
60 17.0 20.8 23.6 27.9 30.9 34.8 37.5 39.3 43.6 The figures in the
above tables include stops of 5 seconds each for the city service and
of 15 seconds for the interurban service, besides a 15 % margin for
line drop and traffic delays. The ratio of acceleration is approximately
1.5 miles per hour per second for the city service and 1.2 miles per
hour per second for the interurban service, the braking being 1.5
miles per hour per second and the coasting approximately 10% of
the running time exclusive of stop. Train Resistance. (General
Electric Co.) — The horse-power output at the rim of the wheels is
equal to, H P = T XF.X Feet T X F X V 33,000 X Minutes 375 When
reduced to Kilowatts, _ TXFX V X 746 _ 2 X TXFX V — 375 X 1000
The kilowatt input to train is equal to, 1000 appro*. T , 2XTXFXV
KW. = — : 1000 X Eff. Where T = Total weight of train in tons. F =
Train resistance, including that due to grades and curves, in Ibs. per
ton. V = Speed in miles per hour. Eff = Efficiency of motors at speed
V. The train resistance may be found from the following formula:
Where F = Train resistance in Ibs., per ton. T = Total weight of train
in tons. V = Speed in miles per hour. A = End cross-section in sq. ft.
N = Number of cars in train. — — is limited to a value of 3.5. VT
Tractive Resistance of a 28-ton Electric Car (Harold H. Dunn, Bull.
74, Univ'y of 111. Expt. Station, April, 1914). — Mean of all tests:
Miles per hr. .5 10 15 -20 25 30 35 40 45 Lb. per ton.. 5.25 6.80
8.62 10.75 13.03 15.75 18.75 22.13 26.12 Two formulae have been
derived from the results: R = 4 + 0.222 S + 0.00582 S*. R = 4 +
0.222 3 + 0.00181 ~ S2. A = cross-sectional area of the car in sq.
ft. W = weight of the car in tons. The formulae should not be used
beyond the limit of 45 miles per hour. Rates of Acceleration. —
Electric Locomotive Passenger Service, 0.3 to 0.6 mile per hour per
second. Electric Motor Cars, Interurban Service, 0.8 to 1.3 miles per
hour per second. Electric Motor Cars, City Service, 1.5 miles per hour
per second. Electric Motor Cars, Rapid Transit Service, 1.5 to 2.0
miles per hour per second. Highest Practical Bate, 2.0 to 2,5 miles
per Jiour per second,
The text on this page is estimated to be only 26.57%
accurate
1416 ELECTRICAL ENGINEERING. Safe Maximum Speed on
Curves. — Radius of Curve, Ft. 10,000 5000 2000 1000 500 200 100
50 Speed, miles per hr., 100 75 50 35 25 15 10 6 The above values
apply only when full elevation is given the outer rail. For city service
such elevation is not possible and the maximum speed will,
therefore, be less under such cpnditions. The same restriction
applies with steel wheel flanges of 3/4 inch or less. Coefficient of
Adhesion. — The following are the average values of the coefficient
of adhesion between wheels and rails, based on a uniform torque:
Clean, dry rail, 30%. Wet rail, 18%; Rail covered with sleet, 15? Rail
covered with dry snow, 10 £, „ , Electrical Resistance of Steel Bails.
— The resistance of steel rails varies considerably, due to the
difference in chemical composition. Ordinary traction rails have a
specific resistance averaging 12 times that of copper, while for
contact rails (third rails) the average is only 8 times. The values
given in the following table are in ohms at 75° F. and with no joints.
with sand, 22%. with sand, 20%. o', with sand, 15%. Weight of
Rails, Lbs. per Yard. Actual Area, Sq. In. Actual Area in Circular Mils.
Resistance per Mile, 8 to 1 Ratio. Resistance per Mile, 1 2 to 1 Ratio.
40. 3 92 4 918300 0 09 1 1 8 0 13395 45.. 4 42 5,627 700 0 07915
0 1 1 905 50... 4.90 6,238,800 0 07135 0 10710 60. 5 88 7 486 600
0 05955 0 08920 70... 6 86 8,734400 0 05105 0 07660 75.. 7.35
9,230,900 0 04780 0 07185 80. 7 84 9 982 1 00 0 04465 0 06695
90. . 8 82 1 1 ,229,900 0 03975 0 05955 100 9.80 12,477,700
0.03750 0.05365 Resistance of Rail Bonds. — The resistance of
bonded rails will vary, depending on the amount of contact made by
the splice bars and rail ends, but in selecting bonds this element of
the return circuit should be disregarded, as it is quite unreliable and
frequently negligible. Size of Conductor. Diameter of Terminal, in
Inches. Resistance per In. of Conductor. 75° Fahr. Carrying Capacity,
Amp. 0. . , 1/2 00000829 210 00.. . 5/8 00000657 265 000. . 3/4
00000521 335 0000. . 7/8 000004 1 4 425 250,000 C. M . . 7/8
00000350 500 300,000 C. M. . 00000275 600 350,000 C. M. . .
00000250 700 400,000 C. M. . . 00000219 800 450,000 C. M. .
00000196 900 500,000 C. M .00000175 1000 Electric Locomotives.
— In selecting an electric locomotive the principal points to be
determined are the weight of the locomotive, the type and capacity
of the equipment, and the mechanical features. The weight upon the
drivers must be enough to pull the heaviest trains under the most
adverse conditions. Therefore the weight of the heaviest train, the
maximum grade and curvature must be ascertained. It must be
known whether the locomotive is expected to start the train under
these conditions, or whether it will start upon the level and only
meet maximum grade conditions when running. In order to
determine the motor equipment all the data of the service conditions
are required, such as the speed required under various conditions of
load and grade. The maximum free-running speed will be
approximately 50 to 75 per cent greater than the rated full load
speed. Mechanical limitations must also be considered, such as track
clearajices, limiting weight on drivers, type of couplings, etc,
The text on this page is estimated to be only 9.68%
accurate
RAILWAYS. 1417 -JgJSNO^jI * is is "8 I ! ,ÂŁ4 I I w H 5 I I 9
£ ON 5 ''ON ON CO • • -ON«N -S • r>.rxo -NOflO -I •ONONON -
ONGO -O ^ 3 N ee ON • • • ' -ON < ON ON ON ON ON ON ON ON
ON -NO -iA — t^rJ-O ^f> .mt>. -m o • "«f— -mo — r^hN -mt^»
H^ O^ pfM^-iAr^ '•«—••• ..O« '^*»— -lAO WN •5 I I i S li i i o r is
ers ers sfor smi rm rs.. ir fic|«2gj J*|| f-rt™wrrtHQ}W'3 P£!Illl!
8|8«81 * s-Bsigt?ii iiififii UawwwfeStS •- l od ON o — is aS4
AaSb^rt^ a o; o> rt G, . 4. s^s-g^&s o 2nd 2nd C-J 
The text on this page is estimated to be only 12.83%
accurate
1418 ELECTRICAL ENGINEERING. •g Aij >' § rt 5**e3 f . T
fe'S £ "§.2 £ *3 jj 5 § "8 « 'I'd J'g s 1 IS IS 3 li 1 • 'd ||| i §1 TJ B § §
oj'd So HI I'd -d-d 1 o So -d ^^ 1 8 bo l-d 1 3 o EH "^ *".S T^^T!
7i ^-i S b< _g | ^ ÂŁ o ,2:5 g c ÂŁ c g 1 OOEH ooo oooo H '$ 1 I U H
|l 1 1 1 M 888 888 8888 0 8 0 0 0 0 l~ 0 c q^ cq^ § J SH^ QOOO T
s" tf tc ? 3 s *. w . NO.™ ^ ^ 00 w ^ l^«*l «NvO r^(N ON 0 -§ § .
.0 ^££ ^^^i 5 i/S f {Q ?53i — 88 O» — T NO — > '3 b >> b rt'rt c«
'> -u S • 5 CJ c3 ^'S .1 S IS T ga 0 £ BQ i 1 1 1 "3 3 «d ^^ w rt 13
CJ P3 fi r-'EH H H 0 0 H O H 0 O 0 '•£> • d ^a £ | !l «... o o:3 w1^1
cj • 03 "^ Jm w V* oT o j- ^ £ 8 V Y ^^ r^J ^ ^^i ^ V ^ > V c§ >
Y 0 OT 32j . * ^0 >^ S*J[ ^^ ^ ^o ^> ^ > -%& > 43^ 02 Jl | |
i§§& f| || | 1=1 | | j.8 3,— 8 •<3!} NO NO OQ — CO ^ NO CO NO
^•d J NO ^ — r * |j ie of Road and Section Electrified. altimore &
Ohio, Baltimore, Md. •• Baltimore Tunnels ew York Central R.R., New
York to Harmon 1 ew York, New Haven & Hartford j R.R., New York
to New Haven ! rand Trunk Ry. Co., St. Clair Tunnel Co., Pt. Huron,
Mich., St. Clair Tunnel reat Northern R.R., Cascade Tunnel,
Washington .ichigan Central R.R., Detroit River Tunnel, Detroit, Mich.
Dston & Maine R.R., North Adams, Mass., Hoosac Tunnel snn. Tunnel
& Terminal R.R. — Pennsylvania R.R. into New York City utte,
Anaconda & Pacific R.R., j Butte to Anaconda, Montana orf oik &
Western R.R., Bluefield to Elkhorn, W. Va. anadian Northern,
Montreal, Can. Continuous Rating," which means Pounds Tractive
Effort," in which 1 i m 2; Z O O 2 W DH PP z 0 : 5 ^3 * * ÂŤi NC 30 0
-' * •»—
The text on this page is estimated to be only 27.81%
accurate
ELECTRIC WELDING. 1419 Relative Efficiencies of Electric
Railway Distributing Systems.— The table on p. 1417 shows the
approximate all-day combined efficiencies from prime mover to train
wheels for various methods of trunk line electrifications. The trains
are supposed to be handled by electric locomotives, and in each
instance a considerable length of line is contemplated, making it
necessary to have a 100,000-volt high-tension primary distribution or
a multiplicity of power sources. Space will not permit a complete
treatment 9f the subject of Electric Railways in this work. For further
information consult: "American Handbook for Electrical Engineers";
Standard Handbook for Electrical Engineers"; "Foster's Electrical
Engineer's Pocket Book"; Burch, "Electric Traction for Railway
Trains"; Harding, "Electric Railway Engineering." ELECTRIC
WELDING. Electric welding is divided into two general classes, arc
heating and resistance heating. Arc Welding. — In this process the
heat of the arc is utilized to bring the metals to be welded to the
melting temperature, when thejoint is filled with molten metal,
usually introduced in the form of a rod. This system is usually
operated by direct current, and as the positive side of a direct
current arc generates heat at a rate approximately three times that
of the negative side, the positive side is used for performing the
welding operation. Two kinds of arcs may be used for this class of
welding, the carbon arc and the metallic arc. The former requires an
e. m. f. varying from 50 to 100 volts and the value of the current is
varied over a range of 100 to 750 amperes, 300 being the average.
The metallic arc, however, requires an e. m. f. of only from 15 to 30
volts, the length of the arc being very short as compared with the
carbon arc. The arc should be as stable as possible, and the current
should, therefore, be of a constant value. The regulation may be
accomplished by inserting resistance in series in the circuit, but this
system is naturally very wasteful and greater economy may be
obtained by providing motor-generator sets, with the generator of
the variable voltage The following costs, Table I (from Electrical
World) were compiled from the records of an electric railway repair
shop: TABLE I. Data on Electric Welding Repairs in Railway Shops.
Time in Minutes. Kw. Average Costs. Gear-case lugs .... 10 6 $0.07
Armature shaft (broken) 2-in 60 20-30 0.80 Dowel-pin holes .' 5-12
4-8 0.07 Broken motor cases 150-200 75-90 4.98 Broken lugs on a
compressor cover, doors and grease-cup hinges . . .... 2-5 1-3 0.03
Broken truck frames 30-60 20-35 0.63 Worn bolt holes in motors and
trucks ..... Enlarged and elongated holes in brake levers Armature
shafts, 2-in., worn in journals . . . Armature shafts worn in keyways .
... 5-10 2-4 120-180 10-15 3-5 1 V2-3 60-90 7-12 0.05 0.03 3.75
0.10 Armature shaft, worn thread 20-30 10-15 0.24 Air-brake
armature shafts (broken) . . 20-30 10-20 0.27 Leaking axle boxes 5-
15 3-7 0.08 Resistance Welding. — Resistance welding is done by
the heat developed by a large amperage carrying through the joining
metals by means of a low voltage. Single-phase alternating current
is generally used for the operation, which may be broadly divided
into two classes — butt-welding and spot-welding. The former
covers all work on which the ends or the sides of the material are
welded together, while spotwelding is used for joining metal sheets
together at any point by a spot the size of a rivet, without punching
holes or using rivets. For resistance welding a very low voltage is
used, varying from 2 to 8 volts, the line voltage being stepped down
by special transformers.
The text on this page is estimated to be only 27.55%
accurate
1420 ELECTRICAL ENGINEERING. The current
consumption, in amperes, varies with the work and the time taken to
make the weld. The following tables (from Iron Trade Review) give
the cost of resistance welding. Table II gives the results obtained by
buttwelding round stock ranging from 1/4 to 1 inch diameter, in the
shortest and longest time possible. The difference in current
consumption is very great and in most cases the shorter time in
seconds was the most economical of the two, although neither is the
most economical rate at which the material can be welded. TABLE II.
— Shortest and Longest Butt-welding Periods. Size, In. Time,
Seconds. Current Amperes. Volts per Square Inch. Size, In. Time,
Seconds. Current Amperes. Volts per Square Inch. 1/4 i 3/8 $ 9/16
9/16 2.7 5 4 5.27 4 15.8 3.6 21.5 1960 1645 4330 2190 6600 1800
8400 3400 39.5 35.5 45.5 19.7 36.6 13 8 12.25 5/8 V8 3/4 3/4 V8
1V8 1 3.5 10.85 4 22.2 17 33 114 9400 5510 10000 9400 11900
10550 7740 4450 33.7 18.85 16.26 19.7 27.7 19.6 10.35 16.1 Table
III contains the results of tests made to determine the cost of power
for making electric butt welds on material ranging from 1/4 to 2
inches in diameter. TABLE HI.— Cost of Power. Area, Sq. In. Kw.
Welding Time, Seconds. Cost per 1000 Welds* Area, Sq. In. Kw.
Welding Time, Seconds. Cost per 1000 Welds* 0.05 0.11 0.20 0.31
0.44 0.60 h 10 12 15 5 6 10 12 15 20 $0.07 0.13 0.22 0.33 0.50
0.83 0.79 0.99 1.23 1.77 2.41 3.14 18 20 26 40 45 56 30 30 40 60
70 80 $1.50 1.66 , 2.89 6.67 8.75 ' 12.44 Table IV gives the time,
power and! cost per 100 spot-welds, with current at 1/4 cent per
Kw.-hr., for welding Nos. 10 to 28 gage sheets. TABLE IV.— Cost of
Welding. Gage. Kw. Time in Seconds. Cost per 1000 Welds, Cents.*
Gage. Kw. Time in Seconds. Cost per 1000 Welds, Cents. 10 12 14
16 18 18 16 14 12 10 1.5 tlo 0.9 0.8 3.5 2.75 2.5 2.25 20 22 24 26
28 9 8 6 5 0.7 0.6 0.5 0.4 0.3 1.75 1.5 1.25 * Current at 1 cent per
Kw.-hr. ELECTRIC HEATERS. Wherever a comparatively small amount
of heat is desired to be automatically and uniformly maintained, and
started or stopped on the instant without waste, there is the
province of the electric heater. The elementary form of heater is
some form of resistance, such as coils of thin wire introduced into an
electric circuit and surrounded with a substance which will permit
the conduction and radiafion of heat, and at the same time serve to
electrically insulate the resistance. This resistance should be
proportional to the electro-motive force of the current used and to
the equation of Joule's law: H = imt X 0.24,
The text on this page is estimated to be only 27.86%
accurate
ELECTRIC HEATING. 1421 where I is the current in
amperes! R, the resistance in ohms; t, the time in seconds; and H,
the heat in gram-centigrade units. Since the resistance of metals
increases as their temperature increases, a thin wire heated by
current passing through it will resist more, and grow hotter and
hotter until its rate of loss of heat by conduction and radiation equals
the rate at which heat is supplied by the current. In a short wire,
before heat enough can be dispelled for commercial purposes, fusion
will begin ; and in electric heaters it is necessary to use either long
lengths of thin wire, or carbon, which alone of all conductors resists
fusion. In the majority of heaters, coils of thin wire are used,
separately embedded in some substance of poor electrical but good
thermal conductivity. Relative Efficiency of Electric and of Steam
Heating. — Suppose that by the use of good coal, careful firing,
well-designed boilers and triple-expansion engines we are able in
daily practice to generate 1 H.P. at the fly-wheel with an expenditure
of 2 1/2 Ib. of coal per hour. We have then to convert this energy
into electricity, transmit it by wire to the heater, and convert it into
heat by passing it through a resistance-coil. We may set the
combined efficiency of the dynamo and line circuit at 85.%, and will
suppose that all the electricity is converted into heat in the
resistance-coils of the radiator. Then 1 brake H.P. at the engine
=0.85 electrical H.P. at the resistance coil = 1,683,000 ft.-lb. energy
per hour = 2180 heat-units. But since it required 2 1/2 Ibs. of coal
to develop 1 brake H.P., it follows that the heat given out at the
radiator per pound of coal burned in the boiler furnace will be 2180-
^21/2 = 872 H.U. An ordinary steam-heating system utilizes 9652
H.U. per Ib. of coal for heating; hence the efficiency of the electric
system is to the efficiency of the steam-heating system as 872 is to
9652, or about 1 to 11. (Eng'g News, Aug. 9, '90; Mar. 30, '92; May
15, '93.) Heat Required to Warm and Ventilate a Room. — The heat
required to raise the temperature of a given space or room to a
certain value depends upon the ventilation, the character of the
walls, the dimensions, proportions of the room, etc. One watt-hour
of electrical energy will raise the temperature of one cubic foot of air
(measured at 70°) 191° F., or 1 watt will raise the temperature of a
cubic foot of air at the rate of 0.0531° F. per second, or
approximately 3.2° per minute. In addition to raising the
temperature of the air to the desired value, the loss of heat through
conduction and ventilation must be supplied. (See Heating and
Ventilation.) EXAMPLE. Assume a room of a capacity of 3000 cu. ft.,
in which the air is changed every 20 minutes, the temperature to be
maintained 30° above the outside air. 3000 -T- 20 = 150 cu. ft. per
minute. (150 X 30) -s- 3.2 = 1406 watts necessary to supply the
ventilation loss. To begin with, to raise the air in the room 30° will
require (3000 X 30) -T- 191 =471 watt-hours and therefore the total
energy used during the first hour will be 1406 + 471 = 1877 watt-
hours or 1.88 Kw.-hours. Domestic Heating. — Electric heating is
extensively used for household cooking apparatus. The time taken to
heat water in any quantity to any definite temperature not exceeding
boiling point can be determined by the formula: V (T* - Ti) 1831 PX
Eff. Where t = time in minutes, V = number of pints, T = initial
temperature, °F., Tz = final temperature, °F., P = energy
consumption in watts, Eff. = Efficiency of cooking utensil, per cent.
EXAMPLE. To heat 1 pint of water 100° F. with a 220- watt heater
with 50% efficiency, time = (1 X 100 X 1831) -~ (220 X 50) = 16.6
min. The following table (compiled by the National Electric Light
Association) gives the watts consumed and cost of operation of
different domestic heating devices, the cost of current being at the
rate of 5 cents per Kw.-hr.
The text on this page is estimated to be only 28.10%
accurate
1422 ELECTRICAL ENGINEERING. Cost of Operation of
Domestic Heating Appliances. Apparatus. Watts. Cents per hr.
Broilers, 3 heat* 300 to 1200 1.5 to 6 Chafing dishes, 3 heat 200 to
500 1 to 2.5 Coffee percolators for 6-in. stove 100 to 440 0.5 to 2.2
Curling-iron heaters 60 0.3 Double boilers for 6-in., 3-heat stove 100
to 440 0.5 to 2.2 Flatiron (domestic size) , 3 Ib 275 1 Flatiron
(domestic size), 4 Ib 350 1.4 Flatiron (domestic size) , 5 Ib 400 2
Flatiron (domestic size), 6 Ib 475 2.4 Flatiron (domestic size), 7.5 Ib
540 2.7 Flatiron (domestic size), 9 Ib 610 3.05 Frying kettles, 8 in.
diameter 825 4.125 Griddle-cake cookers, 9 in. by 12 in., 3-heat 330
to 880 1.7 to 4.4 Griddle-cake cookers, 12 in. by 18 in., 3-heat 500
to 1500 2.5 to 7.5 Ornamental stoves 250 to 500 1.25 to 2.5 Ovens
1200 to 1500 6 to 7.5 Plate warmers 300 J .5 Radiators . 700 to
6000 3.5 to 30 Ranges: 3-heat, 4 to 6 people 1000 to 4515 5 to 22
Ranges: 3-heat, 6 to 12 people 1100 to 5250 5.5 to 26 Ranges: 3-
heat, 12 to 20 people 2000 to 7200 10 to 36 Toasters, 9 in. by 12
in., 3-heat 330 to 880 1.6 to 4.4 Urns, 1-gal., 3-heat 110 to 440 0.5
to 2.2 Urns, 2-gal., 3-heat 220 to 660 1.1 to 3.3 Experience has
shown that 300 watt-hours per meal per person is a liberal
allowance for electric cooking; or in a family of five, four kilowatt
hours per day is an average. ELECTBIC FURNACES. In the
combustion furnace, no matter what form of fuel is used, the
temperature cannot exceed 2000° C. (3632° F.), and for higher
temperatures the electric furnace must be used. The intensity of the
heat in this type of furnace depends .on the amount of current that
passes, and as most substances are conductors when hot, the
degree of intensity possible is theoretically unlimited. In practice,
however, the conducting substance begins to fuse when heated to
its melting point, and one is then confronted with the physical
difficulty of keeping the conducting medium in place, or, if this be
accomplished, the conducting medium ultimately vaporizes,, the
gaseous materials escape, and heat is thus carried away from the
furnace as rapidly as it is supplied. The temperature of the electric
arc, which is somewhere between 3600° and 4000° C. (6512° -
7232° F.), is perhaps the highest temperature attainable at present.
Electric furnaces may be divided in two broad classes, arc furnaces
and resistance furnaces. In the former the heat is generated by
passing an electric current through the space between the ends of
two electrodes, forming the so-called arc. In the resistance furnace
the heat is generated in the interior of a body due to its electrical
resistance. There are three typical forms of arc furnaces, their
common feature being that most and sometimes all of the heat is
transmitted to the material by radiation, which extends in all
directions. In all the furnaces the arc must be started by a quick
movement of the electrodes and afterwards these must be
continuously fed together as they are consumed. The chief
characteristics of the three main types of arc furnaces are: 1. The
direct-heating type, in which two or more electrodes are used and
the heating is accomplished by conduction and radiation. The
current passes from one electrode down through the slag, across
through the bath and up through the slag to the other electrode.
The - Heroult furnace belongs to this type. The Girod furnace is also
T>f the direct-heating type, the current arcing from the electrodes,
which are connected to one side of the circuit. to a fixed electrode in
the bottom. * The apparatus can be set at three different heats or
temperatures,
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookfinal.com

Programming iOS 4 Fundamentals of iPhone iPad and iPod Touch Development 1st Edition Matt Neuburg

  • 1.
    Programming iOS 4Fundamentals of iPhone iPad and iPod Touch Development 1st Edition Matt Neuburg - Downloadable PDF 2025 https://ebookfinal.com/download/programming-ios-4-fundamentals-of- iphone-ipad-and-ipod-touch-development-1st-edition-matt-neuburg/ Visit ebookfinal.com today to download the complete set of ebooks or textbooks
  • 2.
    Here are somerecommended products that we believe you will be interested in. You can click the link to download. iOS 5 Programming Cookbook Solutions Examples for iPhone iPad and iPod touch Apps 1st Edition Vandad Nahavandipoor https://ebookfinal.com/download/ios-5-programming-cookbook-solutions- examples-for-iphone-ipad-and-ipod-touch-apps-1st-edition-vandad- nahavandipoor/ Programming iOS 5 2nd Edition Matt Neuburg https://ebookfinal.com/download/programming-ios-5-2nd-edition-matt- neuburg/ Beginning iOS Apps with Facebook and Twitter APIs for iPhone iPad and iPod touch 1st Edition Chris Dannen https://ebookfinal.com/download/beginning-ios-apps-with-facebook-and- twitter-apis-for-iphone-ipad-and-ipod-touch-1st-edition-chris-dannen/ iOS 4 in Action Examples and Solutions for iPhone iPad Jocelyn Harrington https://ebookfinal.com/download/ios-4-in-action-examples-and- solutions-for-iphone-ipad-jocelyn-harrington/
  • 3.
    Programming iOS 8Dive Deep into Views View Controllers and Frameworks 5th Edition Matt Neuburg https://ebookfinal.com/download/programming-ios-8-dive-deep-into- views-view-controllers-and-frameworks-5th-edition-matt-neuburg/ Programming iOS 9 Dive Deep into Views View Controllers and Frameworks 6th Edition Matt Neuburg https://ebookfinal.com/download/programming-ios-9-dive-deep-into- views-view-controllers-and-frameworks-6th-edition-matt-neuburg/ iOS Wow Factor UX Design Techniques for iPhone and iPad 1st Edition Tim Wood https://ebookfinal.com/download/ios-wow-factor-ux-design-techniques- for-iphone-and-ipad-1st-edition-tim-wood/ Beginning iPad Development for iPhone Developers Mastering the iPad SDK 1st Edition Jack Nutting https://ebookfinal.com/download/beginning-ipad-development-for-iphone- developers-mastering-the-ipad-sdk-1st-edition-jack-nutting/ iPad and iPhone Kung Fu Tips Tricks Hints and Hacks for iOS 7 1st Edition Keir Thomas https://ebookfinal.com/download/ipad-and-iphone-kung-fu-tips-tricks- hints-and-hacks-for-ios-7-1st-edition-keir-thomas/
  • 5.
    Programming iOS 4Fundamentals of iPhone iPad and iPod Touch Development 1st Edition Matt Neuburg Digital Instant Download Author(s): Matt Neuburg ISBN(s): 9781449388430, 1449388434 Edition: 1 File Details: PDF, 6.26 MB Year: 2011 Language: english
  • 7.
    Programming iOS 4 byMatt Neuburg Copyright © 2011 Matt Neuburg. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com. Editor: Brian Jepson Production Editor: Teresa Elsey Proofreader: Nancy Kotary Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano Printing History: May 2011: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Programming iOS 4, the image of a kingbird, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-38843-0 [LSI] 1305160942
  • 8.
    Table of Contents Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Part I. Language 1. Just Enough C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Compilation, Statements, and Comments 4 Variable Declaration, Initialization, and Data Types 6 Structs 8 Pointers 10 Arrays 11 Operators 13 Flow Control and Conditions 15 Functions 19 Pointer Parameters and the Address Operator 22 Files 24 The Standard Library 27 More Preprocessor Directives 27 Data Type Qualifiers 28 2. Object-Based Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Objects 31 Messages and Methods 32 Classes and Instances 33 Class Methods 36 Instance Variables 37 The Object-Based Philosophy 39 3. Objective-C Objects and Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 An Instance Reference Is a Pointer 43 Instance References, Initialization, and nil 44 v
  • 9.
    Instance References andAssignment 47 Instance References and Memory Management 48 Messages and Methods 49 Sending a Message 50 Declaring a Method 51 Nesting Method Calls 52 No Overloading 52 Parameter Lists 53 Unrecognized Selectors 53 Typecasting and the id Type 55 Messages as Data Type 58 C Functions and Struct Pointers 59 Blocks 61 4. Objective-C Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Class and Superclass 65 Interface and Implementation 66 Header File and Implementation File 68 Class Methods 71 The Secret Life of Classes 71 5. Objective-C Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 How Instances Are Created 73 Ready-Made Instances 73 Instantiation from Scratch 74 Nib-Based Instantiation 77 Polymorphism 78 The Keyword self 79 The Keyword super 82 Instance Variables and Accessors 84 Key–Value Coding 86 Properties 87 How to Write an Initializer 89 Part II. IDE 6. Anatomy of an Xcode Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 New Project 96 The Project Window 97 The Navigator Pane 99 The Utilities Pane 103 The Editor 104 vi | Table of Contents
  • 10.
    The Project Fileand Its Dependents 106 The Target 109 Build Phases 109 Build Settings 110 Configurations 111 Schemes and Destinations 112 From Project to App 115 Build Settings 117 Property List Settings 117 Nib Files 118 Other Resources 118 Code 120 Frameworks and SDKs 121 7. Nib Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 A Tour of the Nib-Editing Interface 125 The Dock 127 Canvas 128 Inspectors and Libraries 130 Nib Loading and File’s Owner 132 Default Instances in the Main Nib File 133 Making and Loading a Nib 134 Outlet Connections 135 More Ways to Create Outlets 139 More About Outlets 141 Action Connections 142 Additional Initialization of Nib-Based Instances 146 8. Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 The Documentation Window 150 Class Documentation Pages 152 Sample Code 155 Other Resources 156 Quick Help 156 Symbols 157 Header Files 157 Internet Resources 158 9. Life Cycle of a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Choosing a Device Architecture 159 Localization 162 Editing Your Code 163 Autocompletion 164 Table of Contents | vii
  • 11.
    Snippets 165 Live SyntaxChecking 166 Navigating Your Code 166 Debugging 169 Caveman Debugging 169 The Xcode Debugger 171 Static Analyzer 176 Clean 177 Running in the Simulator 177 Running on a Device 178 Device Management 181 Version Control 181 Instruments 184 Distribution 184 Ad Hoc Distribution 186 Final App Preparations 187 Icons in the App 188 Other Icons 189 Launch Images 189 Screenshots 190 Property List Settings 191 Submission to the App Store 192 Part III. Cocoa 10. Cocoa Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Subclassing 197 Categories 200 Splitting a Class 201 Private Method Declarations 201 Protocols 202 Optional Methods 206 Some Foundation Classes 208 Useful Structs and Constants 208 NSString and Friends 208 NSDate and Friends 210 NSNumber 211 NSValue 211 NSData 212 Equality and Comparison 212 NSIndexSet 213 NSArray and NSMutableArray 213 viii | Table of Contents
  • 12.
    NSSet and Friends215 NSDictionary and NSMutableDictionary 215 NSNull 217 Immutable and Mutable 217 Property Lists 218 The Secret Life of NSObject 218 11. Cocoa Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Reasons for Events 224 Subclassing 224 Notifications 226 Receiving a Built-In Notification 226 Unregistering 228 NSTimer 228 Delegation 229 Data Sources 232 Actions 233 The Responder Chain 237 Deferring Responsibility 238 Nil-Targeted Actions 238 Application Lifetime Events 239 Swamped by Events 243 12. Accessors and Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Accessors 249 Key–Value Coding 251 Memory Management 254 The Golden Rules of Memory Management 255 How Cocoa Objects Manage Memory 257 Memory Management of Instance Variables 260 Instance Variable Memory Management Policies 263 Autorelease 264 Nib Loading and Memory Management 266 Memory Management Comments on Earlier Examples 267 Memory Management of Pointer-to-Void Context Info 269 Memory Management of C Struct Pointers 270 Properties 271 13. Data Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Model–View–Controller 277 Instance Visibility 279 Visibility by Instantiation 280 Visibility by Relationship 281 Table of Contents | ix
  • 13.
    Global Visibility 281 Notifications282 Key–Value Observing 284 Part IV. Views 14. Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 The Window 293 Subview and Superview 295 Frame 298 Bounds and Center 299 Layout 302 Transform 305 Visibility and Opacity 308 15. Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 UIImage and UIImageView 311 UIImage and Graphics Contexts 313 CGImage 315 Drawing a UIView 318 Graphics Context State 320 Paths 321 Clipping 325 Gradients 326 Colors and Patterns 328 Graphics Context Transforms 330 Shadows 332 Points and Pixels 332 Content Mode 333 16. Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 View and Layer 336 Layers and Sublayers 337 Manipulating the Layer Hierarchy 339 Positioning a Sublayer 339 CAScrollLayer 340 Layout of Sublayers 341 Drawing in a Layer 341 Contents Image 341 Contents on Demand 342 Contents Resizing and Positioning 343 Layers that Draw Themselves 345 x | Table of Contents
  • 14.
    Transforms 346 Depth 350 Transformsand Key–Value Coding 352 Shadows, Borders, and More 353 Layers and Key–Value Coding 354 17. Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 Drawing, Animation, and Threading 358 UIImageView Animation 361 View Animation 362 Animation Blocks 362 Modifying an Animation Block 363 Transition Animations 366 Block-Based View Animation 368 Implicit Layer Animation 371 Animation Transactions 372 Media Timing Functions 373 Core Animation 374 CABasicAnimation and Its Inheritance 375 Using a CABasicAnimation 376 Keyframe Animation 379 Making a Property Animatable 380 Grouped Animations 381 Transitions 385 The Animations List 386 Actions 389 What an Action Is 389 The Action Search 390 Hooking Into the Action Search 391 Nonproperty Actions 394 18. Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 Touch Events and Views 398 Receiving Touches 400 Restricting Touches 401 Interpreting Touches 402 Gesture Recognizers 408 Distinguishing Gestures Manually 408 Gesture Recognizer Classes 412 Multiple Gesture Recognizers 416 Subclassing Gesture Recognizers 418 Gesture Recognizer Delegate 419 Touch Delivery 422 Table of Contents | xi
  • 15.
    Hit-Testing 423 Initial TouchEvent Delivery 427 Gesture Recognizer and View 427 Touch Exclusion Logic 429 Recognition 430 Touches and the Responder Chain 431 Part V. Interface 19. View Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 Creating a View Controller 437 Manual View Controller, Manual View 438 Manual View Controller, Nib View 441 Nib-Instantiated View Controller 443 No View 445 Up-Shifted Root View 446 Rotation 447 Initial Orientation 448 Rotation Events 452 Modal Views 453 Modal View Configuration 454 Modal View Presentation 456 Modal View Dismissal 457 Modal Views and Rotation 459 Tab Bar Controllers 461 Tab Bar Item Images 462 Configuring a Tab Bar Controller 463 Navigation Controllers 464 Bar Button Items 466 Configuring a Navigation Interface 468 Navigation Interface Rotation 474 View Controller Lifetime Events 476 View Controller Memory Management 477 20. Scroll Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 Creating a Scroll View 482 Scrolling 484 Paging 487 Tiling 488 Zooming 491 Zooming Programmatically 493 Zooming with Detail 493 xii | Table of Contents
  • 16.
    Scroll View Delegate499 Scroll View Touches 500 Scroll View Performance 503 21. Table Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 Table View Cells 507 Built-In Cell Styles 508 Custom Cells 512 Table View Data 517 The Three Big Questions 518 Table View Sections 521 Refreshing Table View Data 524 Variable Row Heights 526 Table View Selection 528 Table View Scrolling and Layout 533 Table View Searching 533 Table View Editing 539 Deleting Table Items 541 Editable Content in Table Items 543 Inserting Table Items 544 Rearranging Table Items 546 22. Popovers and Split Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 Presenting a Popover 550 Managing a Popover 553 Dismissing a Popover 554 Automatic Popovers 557 Split Views 558 23. Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563 UILabel 564 UITextField 565 Editing and the Keyboard 568 Configuring the Keyboard 572 Text Field Delegate and Control Event Messages 572 The Text Field Menu 574 UITextView 576 Core Text 579 24. Web Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 Loading Content 588 Communicating with a Web View 593 Table of Contents | xiii
  • 17.
    25. Controls andOther Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 UIActivityIndicatorView 597 UIProgressView 598 UIPickerView 600 UISearchBar 602 UIControl 604 UISwitch 605 UIPageControl 605 UIDatePicker 606 UISlider 609 UISegmentedControl 612 UIButton 614 Custom Controls 617 Bars 620 UINavigationBar 621 UIToolbar 623 UITabBar 623 26. Modal Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 Alert View 630 Action Sheet 631 Dialog Alternatives 635 Local Notifications 636 Part VI. Some Frameworks 27. Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643 System Sounds 643 Audio Session 644 Audio Player 648 Remote Control of Your Sound 650 Playing Sound in the Background 651 Further Topics in Sound 653 28. Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655 MPMoviePlayerController 656 MPMoviePlayerViewController 660 UIVideoEditorController 661 Further Topics in Video 662 29. Music Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667 Exploring the Music Library 667 xiv | Table of Contents
  • 18.
    The Music Player671 The Music Picker 675 30. Photo Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679 UIImagePickerController 679 Choosing from the Photo Library 680 Using the Camera 681 The Assets Library Framework 684 31. Address Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687 Address Book Database 687 Address Book Interface 690 ABPeoplePickerNavigationController 690 ABPersonViewController 692 ABNewPersonViewController 692 ABUnknownPersonViewController 693 32. Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695 Calendar Database 695 Calendar Interface 700 33. Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 Mail Message 703 SMS Message 704 34. Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 Presenting a Map 705 Annotations 706 Overlays 712 35. Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 Location 717 Heading and Course 719 Acceleration 720 Shake Events 721 UIAccelerometer 722 Core Motion 725 Table of Contents | xv
  • 19.
    Part VII. FinalTopics 36. Persistent Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729 The Sandbox 729 Basic File Operations 730 Saving and Reading Files 731 User Defaults 733 File Sharing 735 Document Types 735 Handing Off a Document 737 XML 740 SQLite 746 Image File Formats 747 37. Basic Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751 HTTP Requests 751 Bonjour 757 Push Notifications 759 Beyond Basic Networking 760 38. Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 The Main Thread 761 Why Threading Is Hard 764 Three Ways of Threading 765 Manual Threads 766 NSOperation 768 Grand Central Dispatch 772 Threads and App Backgrounding 775 39. Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 The Undo Manager 779 The Undo Interface 782 The Undo Architecture 785 40. Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 xvi | Table of Contents
  • 20.
    Preface Aut lego velscribo; doceo scrutorve sophian. —Sedulius Scottus With the advent of version 2 of the iPhone system, Apple proved they could do a re- markable thing — adapt their existing Cocoa computer application programming framework to make applications for a touch-based device with limited memory and speed and a dauntingly tiny display. The resulting Cocoa Touch framework, in fact, turned out to be in many ways better than the original Cocoa. A programming framework has a kind of personality, an overall flavor that provides an insight into the goals and mindset of those who created it. When I first encountered Cocoa Touch, my assessment of its personality was: “Wow, the people who wrote this are really clever!” On the one hand, the number of built-in interface widgets was se- verely and deliberately limited; on the other hand, the power and flexibility of some of those widgets, especially such things as UITableView, was greatly enhanced over their Mac OS X counterparts. Even more important, Apple created a particularly brilliant way (UIViewController) to help the programmer make entire blocks of interface come and go and supplant one another in a controlled, hierarchical manner, thus allowing that tiny iPhone display to unfold virtually into multiple interface worlds within a single app without the user becoming lost or confused. Even more impressive, Apple took the opportunity to recreate and rationalize Cocoa from the ground up as Cocoa Touch. Cocoa itself is very old, having begun life as NeXTStep before Mac OS X even existed. It has grown by accretion and with a certain conservatism in order to maintain something like backward compatibility. With Cocoa Touch, on the other hand, Apple had the opportunity to throw out the baby with the bath water, and they seized this opportunity with both hands. So, although Cocoa Touch is conceptually based on Mac OS X Cocoa, it is very clearly not Mac OS X Cocoa, nor is it limited or defined by Mac OS X Cocoa. It’s an inde- pendent creature, a leaner, meaner, smarter Cocoa. I could praise Cocoa Touch’s de- liberate use of systematization (and its healthy respect for Occam’s Razor) through numerous examples. Where Mac OS X’s animation layers are glommed onto views as a kind of afterthought, a Cocoa Touch view always has an animation layer counterpart. xvii
  • 21.
    Memory management policies,such as how top-level objects are managed when a nib loads, are simplified and clarified. And so on. At the same time, Cocoa Touch is still a form of Cocoa. It still requires a knowledge of Objective-C. It is not a scripting language; it is certainly not aimed at nonprogrammers, like HyperCard’s HyperTalk or Apple’s AppleScript. It is still huge and complicated. In fact, it’s rather difficult. Meanwhile, Cocoa Touch itself evolves and changes. The iPhone System 2 matured into the iPhone System 3. Then there was a sudden sally in a new direction when the iPad introduced a larger screen and iPhone System 3.2. The iPhone 4 and its double- resolution Retina display also ran on a major system increment, now dubbed iOS 4. Every one of these changes has brought new complexities for the programmer to deal with. To give just one simple example, users rightly complained that switching between apps on the iPhone meant quitting one app and launching another. So Apple gave the iPhone 4 the power of multitasking; the user can switch away from an app and then return to it later to find it still running and in the state it was left previously. All well and good, but now programmers must scurry to make their apps compatible with mul- titasking, which is not at all trivial. The popularity of the iPhone, with its largely free or very inexpensive apps, and the subsequent popularity of the iPad, have brought and will continue to bring into the fold many new programmers who see programming for these devices as worthwhile and doable, even though they may not have felt the same way about Mac OS X. Apple’s own annual WWDC developer conventions have reflected this trend, with their em- phasis shifted from Mac OS X to iOS instruction. The widespread eagerness to program iOS, however, though delightful on the one hand, has also fostered a certain tendency to try to run without first learning to walk. iOS gives the programmer mighty powers that can seem as limitless as imagination itself, but it also has fundamentals. I often see questions online from programmers who are evidently deep into the creation of some interesting app, but who are stymied in a way that reveals quite clearly that they are unfamiliar with the basics of the very world in which they are so happily cavorting. It is this state of affairs that has motivated me to write this book, which is intended to ground the reader in the fundamentals of iOS. I love Cocoa and have long wished to write about it, but it is iOS and its popularity that has given me a proximate excuse to do so. Indeed, my working title was “Fundamentals of Cocoa Touch Programming.” HereIhaveattemptedtomarshalandexpound,inwhatIhopeisapedagogicallyhelpful and instructive yet ruthlessly Euclidean and logical order, the principles on which sound iOS programming rests, including a good basic knowledge of Objective-C (start- ing with C itself) and the nature of object-oriented programming, advice on the use of the tools, the full story on how Cocoa objects are instantiated, referred to, put in com- munication with one another, and managed over their lifetimes, and a survey of the primary interface widgets and other common tasks. My hope, as with my previous xviii | Preface
  • 22.
    books, is thatyou will both read this book cover to cover (learning something new often enough to keep you turning the pages) and keep it by you as a handy reference. This book is not intended to disparage Apple’s own documentation and example projects. They are wonderful resources and have become more wonderful as time goes on. I have depended heavily on them in the preparation of this book. But I also find that they don’t fulfill the same function as a reasoned, ordered presentation of the facts. The online documentation must make assumptions as to how much you already know; it can’t guarantee that you’ll approach it in a given order. And online documentation is more suitable to reference than to instruction. A fully written example, no matter how well commented, is difficult to follow; it demonstrates, but it does not teach. A book, on the other hand, has numbered chapters and sequential pages; I can assume you know C before you know Objective-C for the simple reason that Chapter 1 precedes Chapter 2. And along with facts, I also bring to the table a degree of experience, which I try to communicate to you. Throughout this book you’ll see me referring to “common beginner mistakes”; in most cases, these are mistakes that I have made myself, in ad- dition to seeing others make them. I try to tell you what the pitfalls are because I assume that, in the course of things, you will otherwise fall into them just as naturally as I did as I was learning. You’ll also see me construct many examples piece by piece or extract and explain just one tiny portion of a larger app. It is not a massive finished program that teaches programming, but an exposition of the thought process that developed that program. It is this thought process, more than anything else, that I hope you will gain from reading this book. iOS is huge, massive, immense. It’s far too big to be encompassed in a book even of this size. And in any case, that would be inappropriate and unnecessary. There are entire areas of Cocoa Touch that I have ruthlessly avoided discussing. Some of them would require an entire book of their own. Others you can pick up well enough, when the time comes, from the documentation. This book is only a beginning — the funda- mentals. But I hope that it will be the firm foundation that will make it easier for you to tackle whatever lies beyond, in your own fun and rewarding iOS programming fu- ture. In closing, some version numbers, so that you know what assumptions I am making. At the time I started writing this book, system versions 3.1.3 (on the iPhone) and 3.2 (on the iPad) were most recent. As I was working on the book, iOS 4 and the iPhone 4 came into being, but it didn’t yet run on the iPad. Subsequently iOS 4.2 emerged: the first system able to run on both the iPhone and the iPad. At the same time, Xcode was improved up to 3.2.5. Then, just in time for my final revisions, Xcode 3.2.6 and iOS 4.3 were released, along withthefirstpublicversionofthelong-awaitedXcode4.Xcode4isathoroughoverhaul of the IDE: menus, windows, and preferences are quite different from Xcode 3.2.x. At the same time, both Xcode 4 and Xcode 3.2.x can coexist on the same machine and can be used to work on the same project; moreover, Xcode 3.2.x has some specialized Preface | xix
  • 23.
    capabilities that Xcode4 lacks, so some long-standing developers may well continue to use it. This situation presents a dilemma for an author describing the development process. However, for iOS programming, I recommend adoption of Xcode 4, and this book assumes that you have adopted it. Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. Constant width bold Shows commands or other text that should be typed literally by the user. Constant width italic Shows text that should be replaced with user-supplied values or by values deter- mined by context. This icon signifies a tip, suggestion, or general note. This icon indicates a warning or caution. Using Code Examples This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. xx | Preface
  • 24.
    We appreciate, butdo not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Programming iOS 4 by Matt Neuburg (O’Reilly). Copyright 2011 Matt Neuburg, 978-1-449-38843-0.” If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. Safari® Books Online Safari Books Online is an on-demand digital library that lets you easily search over 7,500 technology and creative reference books and videos to find the answers you need quickly. Withasubscription,youcanreadanypageandwatchanyvideofromourlibraryonline. Read books on your cell phone and mobile devices. Access new titles before they are available for print, and get exclusive access to manuscripts in development and post feedback for the authors. Copy and paste code samples, organize your favorites, down- load chapters, bookmark key sections, create notes, print out pages, and benefit from tons of other time-saving features. O’Reilly Media has uploaded this book to the Safari Books Online service. To have full digital access to this book and others on similar topics from O’Reilly and other pub- lishers, sign up for free at http://my.safaribooksonline.com. How to Contact Us Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) 707-829-0515 (international or local) 707-829-0104 (fax) We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at: http://oreilly.com/catalog/0636920010258/ To comment or ask technical questions about this book, send email to: bookquestions@oreilly.com For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com. Find us on Facebook: http://facebook.com/oreilly Preface | xxi
  • 25.
    Follow us onTwitter: http://twitter.com/oreillymedia Watch us on YouTube: http://www.youtube.com/oreillymedia Acknowledgments It’s a poor craftsman who blames his tools. No blame attaches to the really great tools by which I have been assisted in the writing of this book. I am particularly grateful to the Unicomp Model M keyboard (http://pckeyboard.com), without which I could not have produced so large a book so painlessly. I was also aided by wonderful software, including TextMate (http://macromates.com) and AsciiDoc (http://www.methods.co.nz/ asciidoc). BBEdit (http://www.barebones.com) helped with its diff display. Screenshots were created with Snapz Pro X (http://www.ambrosiasw.com) and GraphicConverter (http://www.lemkesoft.com); diagrams were drawn with OmniGraffle (http://www.om nigroup.com). The splendid O’Reilly production process converted my AsciiDoc text files into PDF while I worked, allowing me to proofread in simulated book format. Were it not for this, and the Early Release program that permitted me to provide my readers with periodic updates of the book as it grew, I would never have agreed to undertake this project in the first place. I would like particularly to thank Tools maven Abby Fox for her constant assistance. I have taken advice from two tech reviewers, Dave Smith and David Rowland, and have been assisted materially and spiritually by many readers who submitted errata and encouragement. I was particularly fortunate in having Brian Jepson as editor; he pro- vided enthusiasm for the O’Reilly tools and the electronic book formats, a watchful eye, and a trusting attitude; he also endured the role of communications pipeline when I needed to prod various parts of the O’Reilly machine. I have never written an O’Reilly book without the help of Nancy Kotary, and I didn’t intend to start now; her sharp eye has smoothed the bristles of my punctuation-laden style. For errors that remain, I take responsibility, of course. xxii | Preface
  • 26.
    Another Random ScribdDocument with Unrelated Content
  • 27.
    The text onthis page is estimated to be only 27.32% accurate DIRECT ELECTRIC CURRENTS. 1409 ohm = 0.239" gramme of water raised 1° C. H = PRt X 0.239 gramme calories = I*Rt X 0.0009478 British thermal units. In electric lighting the energy of the current is converted into heat in the lamps. The resistance of the lamp is made great so that the required quantity of heat may be developed, wnile in the wire leading to and from the lamp the resistance is made as small as is commercially practicable, so that as little energy as possible may be wasted in heating the wire. Heating of Conductors. (From Kapp's Electrical Transmission of Energy.) — It becomes a matter of great importance to determine beforehand what rise in temperature' is to be expected in each given case, and if that rise should be found o be greater than appears safe, provision must be made to increase the rate at which heat is carried off. This can generally be done by increasing the superficial area of the conductor. Say we have one circular conductor of 1 square inch area, and find that with 1000 amperes flowing it would become too hot. Now by splitting up this conductor into 10 separate wires each one- tenth of a square inch crosssectional area, we have not altered the total amount of energy transformed into heat, but we have increased the surface exposed to the cooling action of the surrounding air in the ratio of 1 : v^lO, and therefore the ten thin wires can dissipate more than three times the heat, as compared with the single thick wire. Prof. Forbes states that an insulated wire carries a greater current without overheating than a bare wire if the diameter be not too great, Assuming the diameter of the cable to be twice the diam. of the conductor, a greater current can be carried in insulated wires than in bare wires up to 1.9 inch diam. of conductor. If diam. of cable = 4 times diam. of conductor, this is the case up to 1.1 inch diam. of conductor. Heating of Bare Wires. — The following formulae are given by Keimelly: 72 . 7 72 x 90,000 + t; d=44.8 ' J. •"• -7j /S J7Ufuuw T «,, u. — l-*.o ^ ~ . ' T = temperature of the wire and t that of the air, in Fahrenheit degrees; 7 - current in amperes, d = diameter of the wire in mils. If we take T - t = 90° F.,
  • 28.
    ^/90 = 4.48,then d •= 10 $1* and 7 = V^3 .4. 1000. This latter formula gives for the carrying capacity in amperes of bare wires almost exactly the figures given for weather-proof wires in the Fire Underwriters' table, except in the case of Nos. 18 and 16, B. & S. gauge, for which the formula gives 8 and 11 amperes, respectively, instead of 5 and 8 amperes, given in the table. Heating of Coils. — The rise of temperature in magnet coils due to the passage of current through the wire is approximately proportional to the watts lost in the coil per unit of effective radiating surface, thus: . PR . PR toe— or «-•££• t being the temperature rise in degrees Fahr.; St the effective radiating surface; and k a coefficient which varies widely, according to condition. In electromagnet coils of small size and power, k may be as large as 0.015. Ordinarily it ranges from 0.012 down to 0.005; a fair average is 0.007. The more exposed the coil is to air circulation, the larger is the value of k the larger the proportion of iron to copper, by weight, in the core and winding, the thinner the winding with relation to its dimension parallel with the magnet core, and the larger the "space factor" of the winding, the larger will be the value of k.- The space factor is the ratio of the actual C9pper cross-section of the whole coil to the gross cross- section of copper, insulation, and interstices. Fusion of Wires. — W. H. Preece gives a formula for the current required to fuse wires of different metals, viz., I = ad*h in which d is the diameter in inches and a a coefficient whose value for different metals is as follows: Copper, 10,244; aluminum, 7585; platinum, 5172; German silver, 5230; platinoid, 4750; iron, 3148; tin, 1462; lead, 1379; alloy of 2 lead and 1 tin, 1318.
  • 29.
    The text onthis page is estimated to be only 26.60% accurate 1410 ELECTRICAL ENGINEERING. Allowable Carrying Capacity of Copper Wires. (For inside wiring, National Board of Fire Underwriters' Rules.) B.&S. Gauge. Circular Mils. Amperes. Circular Mils. Amperes. Rubber Covered. Other Insulation. Rubber Covered. Other Insulation. 18 1,624 3 5 200,000 200 300 16 2,583 6 8 300,000 270 400 14 4,107 12 16 400,000 330 500 12 6,530 17 23 500,000 390 590 10 10,380 24 32 600,000 450 680 8 16,510 33 46 700,000 500 760 6 26,250 46 65 800,000 550 840 5 33,100 54 77 900,000 600 920 4 41,740 65 92 ,000,000 650 ,000 3 52,630 76 110 ,100,000 690 ,080 2 66,370 90 131 ,200,000 730 ,150 83,690 107 156 ,300,000 770 ,220 0 105,500 127 185 ,400,000 810 ,290 00 133,100 150 220 ,600,000 890 ,430 000 167,800 177 262 ,800,000 970 ,550 0000 211,600 210 312 2,000,000 1,050 ,670 Wires smaller than No. 14 B. & S. gauge must not be used except in fixtures and pendant cords. The lower limit is specified for rubber-covered wires to prevent deterioration of the insulation by the heat of the wires. For insulated aluminum wire the safe-carrying capacity is 84 per cent of that of copper wire with the same insulation. See pamphlets published by the National Board of Fire Underwriters, New York, for complete specifications and rules for wiring. Underwriters' Insulation. — The thickness of insulation required by the rules of the National Board of Fire Underwriters varies with the size of the wire, the character of the insulatipn, and the voltage. The thickness of insulation on rubber-covered wires carrying voltages up to 600 varies from 1/32 inch for a No. 18 B. & S. gauge wire to 1/8 inch for a wire of 1.000,000 circular mils. Weather-proof insulation is required to be slightly thicker. For voltages of over 600 the insulation varies from i/ie inch for No. 14 B. & S. gage to 9/64 inch for 1,000,000 C. JM. and over. ELECTRIC TRANSMISSION, DIRECT CURRENTS. Cross- section of Wire Required fof a Given Current. — Let R = resistance of a given line of copper wire, in ohms; r = " "1 mil-foot of copper; L = length of wire, in feet; e = drop in voltage between the two ends; I = current, in amperes; A = sectional area of wire, in circular mils;
  • 30.
    then I =— ; R = y ; R = r ^; whence A = r-^. The value of r for soft copper wire at 68° F. is 10.371 international ohms. For ordinary drawn copper wire the value of 10.8 is commonly taken, corresponding to a conductivity of 97.2 per cent. For a circuit, going and return, the total length is 2 L, and the formula becomes A = 21.67L H- e, L here being the distance from the point of supply to the point of deh'very. If E is the voltage at the generator and a the per cent of drop in the line, then e = Ea -r- 100, and A = 2160 IL - =- aE. jp 21 An P7" If P = the power in watts, = El, then I = •=?, and A = =^ — . Cj CLEj* If Pj. = the power in kilowatts, A = 2,160,000 P^L + aE2. If Lm = the distance in miles and A^, the area in circular inches, then
  • 31.
    The text onthis page is estimated to be only 27.17% accurate ELECTRIC TRANSMISSION, DIRECT CURRENT. 1411 Ac = 6405 PkLm + aE2. If As = area in square inches, As = 5030 PkLm H- aE2. When the area in circular mils has been determined by either of these formulae reference should be made to the table of Allowable Capacity of Wires, to see if the calculated size is sufficient to avoid overheating. For all interior wiring the rules of the National Board of Fire Underwriters should be followed. Weight o'f Copper for a Given Power. — Taking the weight of a mil-foot of copper at 0.000003027 lb., the weight of copper in a circuit of length 2 Land cross-section A, in circ. mils, is 0.000006054 LA Ibs., = W. Substituting for A its value 2 160 PL •*• aE2 we have W = 0.0 130766 PL2 ' -*• aE2; P in watts, L in ft. W = 13.0766 PkL2 -*• aE2; P& in kilowatts, L in ft. W = 364,556,000 PkL2m + aE2; Pk in kilowatts, Lm in miles. The weight of copper required varies directly as the power transmitted ; inversely as the percentage of drop or loss; directly as the square of the distance; and inversely as the square of the voltage. From the last formula the following table has been calculated: WEIGHT OF COPPER WIRE TO CARRY 1000 KILOWATTS WITH 10% Loss. Distance in Miles. 1 5 10 20 50 100 Volts. Weight in Lbs. 500 1,000 2,000 5,000 10,000 20,000 40,000 60.000 145,822 36,456 9,114 1,458 365 91 3,645,560 911,390 227,848 36,456 9,114 2,278 570 3,645,560 911,390 145,822 36,456 9,114 2.278 1,013 3,645,560 593,290 145,822 36,456 9,114 4,051 3,645,560 911,390 227,848 * 56,962 25,316 3,645.560 911,390 227,848 101,266 In calculating the distance, an addition of about 5 per cent should be made for sag of the wires. Short-circuiting. — From the law I = E/R it is seen that with any pressure E, the current I will become very great if R is made very small. In short-circuiting the resistance becomes small and the current therefore great. Hence the dangers of short- circuiting a current. ECONOMY OF ELECTRIC TRANSMISSION. The loss of power in a transmission line is ordinarily given in per cent of the total power consumed in the conductors at maximum load. Whatever the line pressure may be, the size of the conductors varies
  • 32.
    inversely with thepercentage of loss. Consequently the maximum line loss which can be allowed is dependent on the most economical size of the line conductors. In 1881 Lord Kelvin gave out a statement in regard to the most economical size of conductors. This statement, which is known as "Kelvin's law," was as follows: "The most economical area of conductor will be that for which the annual interest on the capital outlay equals the annual cost of energy wasted." According to this rule, the cheaper the cost of power, the less should be the capital outlay for the conductors, thus allowing a smaller size to be used. George Forbes states that the most economical section of the conductor is independent of the voltage and the distance, and is proportional to the current. It is generally assumed that the cost of the pole line and the insulators is constant and not affected by the variation in the size of the line conductors. If A = interest cost per year of conductors erected, in dollars, B = value of the line loss per year, in dollars; then for the most economical cross-section of the conductors A =J3.
  • 33.
    The text onthis page is estimated to be only 26.67% accurate 1412 ELECTRICAL ENGINEERING. If K = Cost per kilowatt- year of lost power, in dollars, KI = Cost per pound of wires erected, in dollars, L = Length of line in 1000 ft., £>a s= Cross-section of conductor in circular mils, I = Line current in amperes, p = per cent interest, then A = ^ X KI x 0.003 XLXD*. L B = K X Iz X 10.5 X j=c2 ^ x KI x 0.003 XLXD* = KXI*X lo.s'x ^, Z>2 = 592 I D* is the cross- section, in circular mils, that will give the most economical line loss. In the following, the above equation is worked out for three different rates of interest: For 4%, Z>2 = 296 I |— ; For 5%, DZ = 265 I l — ; II KI i KI ' For 6%, D* = 242 I l— » KI In determining the value of I, care must be taken that the annual mean value of the current is used. The value of K must also be the one for which the power, representing the line loss, can be produced, and not that for which it can be sold. Wire Tables. — The tables on the following page show the relation between load, distance, and "drop" or loss by voltage in a two- wire direct-current circuit of any standard size of wire. The tables are based on the formula (21.6 IL) -7- A - Drop in volts. I = current in amperes, L = distance in feet from point of supply to point of delivery, A = sectional area of wire in circular mils. The factors I and L are combined in the table, in the compound factor "ampere feet." EXAMPLES IN THE USE OF THE WIRE TABLES. — 1. Required the maximum load in amperes at 220 volts that can be carried 95 feet by No. 6 wire without exceeding 11/2% drop. Find No. 6 in the 220-volt column of Table I; opposite this in the 1V2% column is the number 4005, which is the ampere-feet. Dividing this by the required distance (95 feet) gives the load, 42.15 amperes. Example 2. A 500- volt line is to carry 100 amperes 600 feet with a drop not exceeding 5 % ; what size of wire will be required? The ampere-feet will be 100 X 600 = 60,000. Referring to the 5% column of Table II, the nearest number of ampere-feet is 60,750, which is opposite No. 3 wire in the 500- volt column. These tables also show the percentage of the power delivered to a line that is lost in non- inductive alternating-current circuits. Such circuits are obtained
  • 34.
    when the loadconsists of incandescent lamps and the circuit wires lie only an inch or two apart, as in conduit wiring. Efficiency of Electric Systems. — The efficiency of a system is the ratio of the power delivered by the electric motors at the distant end of the line to the power delivered to the dynamo-electric machines at the other end. The efficiency of a generator or motor varies with its load and with the size of the machine, ranging about as follows: Average Full- load Efficiency of Generators: K.W 25 50 100 200 500 1000 2000 3000 Eff. % 88 90 91 92 93 94 94.5 95 Average Full-load Efficiency of Motors: H.P 1 2 5 10 25 50 100 200 500 Eff. % .... 80 82 85 87 88 90 * 91 92 93 The efficiency of both generators and motors decreases, at first very
  • 35.
    The text onthis page is estimated to be only 27.48% accurate ELECTRIC TRANSMISSION, DIRECT CURRENT. 1413 WIRE TABLE — RELATION BETWEEN LOAD, DISTANCE, Loss, AND SIZE OF CONDUCTOR. NOTE. — The numbers in the body of the tables are Ampere-Feet, i.e., Amperes X Distance (length of one wire). See examples below. Table I. — 110-volt and 220-volt Two-wire Circuits. Wire Sizes; B. & S. Gauge. Line Loss in Percentage of the Rated Voltage; and Power Loss in Percentage of the Delivered Power. 110V. 220V. 1 •H/2 2 3 4 5 6 8 10 0000 000 0000 000 00 0 1 21,550 17,080 13,550 10,750 8,520 32,325 25,620 20,325 16,125 12,780 43,100 34,160 27,100 21,500 17,040 64,650 51,240 40,650 32,250 25,560 86,200 68,320 54,200 43,000 34,080 107,750 85,400 67,750 53,750 42,600 129,300 102,480 81,300 64,500 51,120 172,400 136,640 108,400 86,000 68,160 215,500 170,800 135,500 107,500 85,200 00 0 1 2 3 2 3 4 6 6,750 5,360 4,250 3,370 2,670 10,140 8,040 6,375 5,055 4,005 13,520 10,720 8,500 6,740 5,340 20,280 16,080 12,750 10,110 8,010 27,040 21,4^0 17,000 13,480 10,680 33,800 26,800 21,250 16,850 13,350 40,560 32,160 25,500 20,220 16,020 54,080 42,880 34,000 26,960 21,360 67,600 53,600 42,500 33,700 26,700 4 6 7 8 7 8 9 10 11 2,120 1,680 1,330 1,055 838 3,180 2,520 1,995 1,582 1,257 4,240 3,360 2,660 2,110 1,675 6,360 5,040 3,990 3,165 2,514 8,480 6,720 5,320 4,220 3,350 10,600 8,400 6,650 5,275 4,190 12,720 10,800 7,980 6,330 5,028 16,960 13,440 10,640 8,440 6,700 21,200 16,800 13,300 10,550 8,380 9 10 11 12 14 12 13 14 665 527 418 332 209 997 790 627 498 313 1,330 1,054 836 665 418 1,995 1,580 1,254 997 627 2,660 2,108 1,672 1,330 836 3,320 2,635 2,090 1,660 1.045 3,990 3,160 2,508 1,995 1,354 5,320 4,215 3,344 2,660 1,672 . 6.650 5J270 4,180 3,325 2,090 Table II. — 500, 1000, and 2000 Volt Circuits. Wire Sizes; B. & S. Gauge. Line Loss in Percentage of the Rated Voltage ; and Power Loss in Percentage of the Delivered Power. 500V. 1000V. 2000V. 1 H/2 2 2V2 3 4 5 0000 000 00 0 1 2 3 4 5 6 7 8 9 10 n 12 14 0000 000 00 0 1 2 3 4 6 7 8 9 10 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 97,960 77,690 61,620 48,880 38,750 30,760 24,370 19,320
  • 36.
    15,320 12,150 9,6407,640 6,060 4,805 3,810 3,020 2,395 1,900 1,510 950 146,940 116,535 92,430 73,320 58,125 46,140 36,555 28,980 22,980 18,225 14,460 11,460 9,090 7,207 5,715 4,530 3,592 2,850 2,265 1,425 195,920 155,380 123,240 97,760 77,500 61,520 48,740 38,640 30,640 24,300 19,280 15,280 12,120 9,610 7,620 6,040 4,790 3,800 3,020 1,900 244,900 194,225 154,050 122,200 96,875 76,900 60,925 48,300 38,300 30,375 24,100 19,100 15,150 12,010 9,525 7,550 5,985 4,750 3,775 2.375 293,880 233,970 184,860 146,640 116,250 92,280 73,110 57,960 45,960 36,450 28,920 22,920 18,180 14,415 11,430 9,060 7,185 5,700 4,530 2,850 391,840 310,760 246,480 195,420 155,000 123,040 97,480 77,280 61,280 48,300 38,560 30,560 24,240 19,220 15,220 12,080 9,580 7,600 6,040 3,800 489,800 388,450 308,100 244,400 193,750 153,800 121,850 96,600 76,600 60,750 48,200 38,200 30,300 24,025 19,050 15,100 11,975 9,500 7,550 4,750
  • 37.
    The text onthis page is estimated to be only 27.92% accurate 1414 ELECTRICAL ENGINEERING. slowly and then more rapidly, as the load decreases. Each machine has its "characteristic" curve of efficiency, showing the ratio of output to input at different loads. Roughly the decrease in efficiency for directcurrent machines at half-load varies from 3% to 10% for the smallest sizes. The loss in transmission, due to fall in electrical pressure or "dop" in the line, is governed by the size of the wires, the other conditions remaining the same. For a long-distance transmission plant this will vary from 5 % upwards. With generator efficiency and motor efficiency each 90%, and transmission loss 5 %, the combined efficiency is 0.90 X 0.90 X 0.95 = 76.95 %. Resistances of Pure Aluminum Wire.* Conductivity 62 in the Matthiesen Standard Scale. Pure aluminum weighs 167.111 pounds per cubic foot. II OM gog
  • 38.
    The text onthis page is estimated to be only 27.00% accurate ELECTRIC RAILWAYS. 1415 INTERURBAN SERVICE. Max. Miles I >etween Stops. Speed. 1/1 3/4 1 1.5 2 3 4 5 10 30. 14 0 15 5 16 7 18 5 19.7 21 0 22 0 22 5 23 9 40. . 15.4 18.1 20.0 22.7 24.5 26.7 28.0 28.9 30 8 50 16 2 19 5 21 9 25 6 27 9 31 0 32 9 34 2 37 2 60 17.0 20.8 23.6 27.9 30.9 34.8 37.5 39.3 43.6 The figures in the above tables include stops of 5 seconds each for the city service and of 15 seconds for the interurban service, besides a 15 % margin for line drop and traffic delays. The ratio of acceleration is approximately 1.5 miles per hour per second for the city service and 1.2 miles per hour per second for the interurban service, the braking being 1.5 miles per hour per second and the coasting approximately 10% of the running time exclusive of stop. Train Resistance. (General Electric Co.) — The horse-power output at the rim of the wheels is equal to, H P = T XF.X Feet T X F X V 33,000 X Minutes 375 When reduced to Kilowatts, _ TXFX V X 746 _ 2 X TXFX V — 375 X 1000 The kilowatt input to train is equal to, 1000 appro*. T , 2XTXFXV KW. = — : 1000 X Eff. Where T = Total weight of train in tons. F = Train resistance, including that due to grades and curves, in Ibs. per ton. V = Speed in miles per hour. Eff = Efficiency of motors at speed V. The train resistance may be found from the following formula: Where F = Train resistance in Ibs., per ton. T = Total weight of train in tons. V = Speed in miles per hour. A = End cross-section in sq. ft. N = Number of cars in train. — — is limited to a value of 3.5. VT Tractive Resistance of a 28-ton Electric Car (Harold H. Dunn, Bull. 74, Univ'y of 111. Expt. Station, April, 1914). — Mean of all tests: Miles per hr. .5 10 15 -20 25 30 35 40 45 Lb. per ton.. 5.25 6.80 8.62 10.75 13.03 15.75 18.75 22.13 26.12 Two formulae have been derived from the results: R = 4 + 0.222 S + 0.00582 S*. R = 4 + 0.222 3 + 0.00181 ~ S2. A = cross-sectional area of the car in sq. ft. W = weight of the car in tons. The formulae should not be used beyond the limit of 45 miles per hour. Rates of Acceleration. — Electric Locomotive Passenger Service, 0.3 to 0.6 mile per hour per second. Electric Motor Cars, Interurban Service, 0.8 to 1.3 miles per
  • 39.
    hour per second.Electric Motor Cars, City Service, 1.5 miles per hour per second. Electric Motor Cars, Rapid Transit Service, 1.5 to 2.0 miles per hour per second. Highest Practical Bate, 2.0 to 2,5 miles per Jiour per second,
  • 40.
    The text onthis page is estimated to be only 26.57% accurate 1416 ELECTRICAL ENGINEERING. Safe Maximum Speed on Curves. — Radius of Curve, Ft. 10,000 5000 2000 1000 500 200 100 50 Speed, miles per hr., 100 75 50 35 25 15 10 6 The above values apply only when full elevation is given the outer rail. For city service such elevation is not possible and the maximum speed will, therefore, be less under such cpnditions. The same restriction applies with steel wheel flanges of 3/4 inch or less. Coefficient of Adhesion. — The following are the average values of the coefficient of adhesion between wheels and rails, based on a uniform torque: Clean, dry rail, 30%. Wet rail, 18%; Rail covered with sleet, 15? Rail covered with dry snow, 10 £, „ , Electrical Resistance of Steel Bails. — The resistance of steel rails varies considerably, due to the difference in chemical composition. Ordinary traction rails have a specific resistance averaging 12 times that of copper, while for contact rails (third rails) the average is only 8 times. The values given in the following table are in ohms at 75° F. and with no joints. with sand, 22%. with sand, 20%. o', with sand, 15%. Weight of Rails, Lbs. per Yard. Actual Area, Sq. In. Actual Area in Circular Mils. Resistance per Mile, 8 to 1 Ratio. Resistance per Mile, 1 2 to 1 Ratio. 40. 3 92 4 918300 0 09 1 1 8 0 13395 45.. 4 42 5,627 700 0 07915 0 1 1 905 50... 4.90 6,238,800 0 07135 0 10710 60. 5 88 7 486 600 0 05955 0 08920 70... 6 86 8,734400 0 05105 0 07660 75.. 7.35 9,230,900 0 04780 0 07185 80. 7 84 9 982 1 00 0 04465 0 06695 90. . 8 82 1 1 ,229,900 0 03975 0 05955 100 9.80 12,477,700 0.03750 0.05365 Resistance of Rail Bonds. — The resistance of bonded rails will vary, depending on the amount of contact made by the splice bars and rail ends, but in selecting bonds this element of the return circuit should be disregarded, as it is quite unreliable and frequently negligible. Size of Conductor. Diameter of Terminal, in Inches. Resistance per In. of Conductor. 75° Fahr. Carrying Capacity, Amp. 0. . , 1/2 00000829 210 00.. . 5/8 00000657 265 000. . 3/4 00000521 335 0000. . 7/8 000004 1 4 425 250,000 C. M . . 7/8 00000350 500 300,000 C. M. . 00000275 600 350,000 C. M. . .
  • 41.
    00000250 700 400,000C. M. . . 00000219 800 450,000 C. M. . 00000196 900 500,000 C. M .00000175 1000 Electric Locomotives. — In selecting an electric locomotive the principal points to be determined are the weight of the locomotive, the type and capacity of the equipment, and the mechanical features. The weight upon the drivers must be enough to pull the heaviest trains under the most adverse conditions. Therefore the weight of the heaviest train, the maximum grade and curvature must be ascertained. It must be known whether the locomotive is expected to start the train under these conditions, or whether it will start upon the level and only meet maximum grade conditions when running. In order to determine the motor equipment all the data of the service conditions are required, such as the speed required under various conditions of load and grade. The maximum free-running speed will be approximately 50 to 75 per cent greater than the rated full load speed. Mechanical limitations must also be considered, such as track clearajices, limiting weight on drivers, type of couplings, etc,
  • 42.
    The text onthis page is estimated to be only 9.68% accurate RAILWAYS. 1417 -JgJSNO^jI * is is "8 I ! ,£4 I I w H 5 I I 9 £ ON 5 ''ON ON CO • • -ON«N -S • r>.rxo -NOflO -I •ONONON - ONGO -O ^ 3 N ee ON • • • ' -ON < ON ON ON ON ON ON ON ON ON -NO -iA — t^rJ-O ^f> .mt>. -m o • "«f— -mo — r^hN -mt^» H^ O^ pfM^-iAr^ '•«—••• ..O« '^*»— -lAO WN •5 I I i S li i i o r is ers ers sfor smi rm rs.. ir fic|«2gj J*|| f-rt™wrrtHQ}W'3 P£!Illl! 8|8«81 * s-Bsigt?ii iiififii UawwwfeStS •- l od ON o — is aS4 AaSb^rt^ a o; o> rt G, . 4. s^s-g^&s o 2nd 2nd C-J 
  • 43.
    The text onthis page is estimated to be only 12.83% accurate 1418 ELECTRICAL ENGINEERING. •g Aij >' § rt 5**e3 f . T fe'S £ "§.2 £ *3 jj 5 § "8 « 'I'd J'g s 1 IS IS 3 li 1 • 'd ||| i §1 TJ B § § oj'd So HI I'd -d-d 1 o So -d ^^ 1 8 bo l-d 1 3 o EH "^ *".S T^^T! 7i ^-i S b< _g | ^ £ o ,2:5 g c £ c g 1 OOEH ooo oooo H '$ 1 I U H |l 1 1 1 M 888 888 8888 0 8 0 0 0 0 l~ 0 c q^ cq^ § J SH^ QOOO T s" tf tc ? 3 s *. w . NO.™ ^ ^ 00 w ^ l^«*l «NvO r^(N ON 0 -§ § . .0 ^££ ^^^i 5 i/S f {Q ?53i — 88 O» — T NO — > '3 b >> b rt'rt c« '> -u S • 5 CJ c3 ^'S .1 S IS T ga 0 £ BQ i 1 1 1 "3 3 «d ^^ w rt 13 CJ P3 fi r-'EH H H 0 0 H O H 0 O 0 '•£> • d ^a £ | !l «... o o:3 w1^1 cj • 03 "^ Jm w V* oT o j- ^ £ 8 V Y ^^ r^J ^ ^^i ^ V ^ > V c§ > Y 0 OT 32j . * ^0 >^ S*J[ ^^ ^ ^o ^> ^ > -%& > 43^ 02 Jl | | i§§& f| || | 1=1 | | j.8 3,— 8 •<3!} NO NO OQ — CO ^ NO CO NO ^•d J NO ^ — r * |j ie of Road and Section Electrified. altimore & Ohio, Baltimore, Md. •• Baltimore Tunnels ew York Central R.R., New York to Harmon 1 ew York, New Haven & Hartford j R.R., New York to New Haven ! rand Trunk Ry. Co., St. Clair Tunnel Co., Pt. Huron, Mich., St. Clair Tunnel reat Northern R.R., Cascade Tunnel, Washington .ichigan Central R.R., Detroit River Tunnel, Detroit, Mich. Dston & Maine R.R., North Adams, Mass., Hoosac Tunnel snn. Tunnel & Terminal R.R. — Pennsylvania R.R. into New York City utte, Anaconda & Pacific R.R., j Butte to Anaconda, Montana orf oik & Western R.R., Bluefield to Elkhorn, W. Va. anadian Northern, Montreal, Can. Continuous Rating," which means Pounds Tractive Effort," in which 1 i m 2; Z O O 2 W DH PP z 0 : 5 ^3 * * «i NC 30 0 -' * •»—
  • 44.
    The text onthis page is estimated to be only 27.81% accurate ELECTRIC WELDING. 1419 Relative Efficiencies of Electric Railway Distributing Systems.— The table on p. 1417 shows the approximate all-day combined efficiencies from prime mover to train wheels for various methods of trunk line electrifications. The trains are supposed to be handled by electric locomotives, and in each instance a considerable length of line is contemplated, making it necessary to have a 100,000-volt high-tension primary distribution or a multiplicity of power sources. Space will not permit a complete treatment 9f the subject of Electric Railways in this work. For further information consult: "American Handbook for Electrical Engineers"; Standard Handbook for Electrical Engineers"; "Foster's Electrical Engineer's Pocket Book"; Burch, "Electric Traction for Railway Trains"; Harding, "Electric Railway Engineering." ELECTRIC WELDING. Electric welding is divided into two general classes, arc heating and resistance heating. Arc Welding. — In this process the heat of the arc is utilized to bring the metals to be welded to the melting temperature, when thejoint is filled with molten metal, usually introduced in the form of a rod. This system is usually operated by direct current, and as the positive side of a direct current arc generates heat at a rate approximately three times that of the negative side, the positive side is used for performing the welding operation. Two kinds of arcs may be used for this class of welding, the carbon arc and the metallic arc. The former requires an e. m. f. varying from 50 to 100 volts and the value of the current is varied over a range of 100 to 750 amperes, 300 being the average. The metallic arc, however, requires an e. m. f. of only from 15 to 30 volts, the length of the arc being very short as compared with the carbon arc. The arc should be as stable as possible, and the current should, therefore, be of a constant value. The regulation may be accomplished by inserting resistance in series in the circuit, but this system is naturally very wasteful and greater economy may be obtained by providing motor-generator sets, with the generator of the variable voltage The following costs, Table I (from Electrical
  • 45.
    World) were compiledfrom the records of an electric railway repair shop: TABLE I. Data on Electric Welding Repairs in Railway Shops. Time in Minutes. Kw. Average Costs. Gear-case lugs .... 10 6 $0.07 Armature shaft (broken) 2-in 60 20-30 0.80 Dowel-pin holes .' 5-12 4-8 0.07 Broken motor cases 150-200 75-90 4.98 Broken lugs on a compressor cover, doors and grease-cup hinges . . .... 2-5 1-3 0.03 Broken truck frames 30-60 20-35 0.63 Worn bolt holes in motors and trucks ..... Enlarged and elongated holes in brake levers Armature shafts, 2-in., worn in journals . . . Armature shafts worn in keyways . ... 5-10 2-4 120-180 10-15 3-5 1 V2-3 60-90 7-12 0.05 0.03 3.75 0.10 Armature shaft, worn thread 20-30 10-15 0.24 Air-brake armature shafts (broken) . . 20-30 10-20 0.27 Leaking axle boxes 5- 15 3-7 0.08 Resistance Welding. — Resistance welding is done by the heat developed by a large amperage carrying through the joining metals by means of a low voltage. Single-phase alternating current is generally used for the operation, which may be broadly divided into two classes — butt-welding and spot-welding. The former covers all work on which the ends or the sides of the material are welded together, while spotwelding is used for joining metal sheets together at any point by a spot the size of a rivet, without punching holes or using rivets. For resistance welding a very low voltage is used, varying from 2 to 8 volts, the line voltage being stepped down by special transformers.
  • 46.
    The text onthis page is estimated to be only 27.55% accurate 1420 ELECTRICAL ENGINEERING. The current consumption, in amperes, varies with the work and the time taken to make the weld. The following tables (from Iron Trade Review) give the cost of resistance welding. Table II gives the results obtained by buttwelding round stock ranging from 1/4 to 1 inch diameter, in the shortest and longest time possible. The difference in current consumption is very great and in most cases the shorter time in seconds was the most economical of the two, although neither is the most economical rate at which the material can be welded. TABLE II. — Shortest and Longest Butt-welding Periods. Size, In. Time, Seconds. Current Amperes. Volts per Square Inch. Size, In. Time, Seconds. Current Amperes. Volts per Square Inch. 1/4 i 3/8 $ 9/16 9/16 2.7 5 4 5.27 4 15.8 3.6 21.5 1960 1645 4330 2190 6600 1800 8400 3400 39.5 35.5 45.5 19.7 36.6 13 8 12.25 5/8 V8 3/4 3/4 V8 1V8 1 3.5 10.85 4 22.2 17 33 114 9400 5510 10000 9400 11900 10550 7740 4450 33.7 18.85 16.26 19.7 27.7 19.6 10.35 16.1 Table III contains the results of tests made to determine the cost of power for making electric butt welds on material ranging from 1/4 to 2 inches in diameter. TABLE HI.— Cost of Power. Area, Sq. In. Kw. Welding Time, Seconds. Cost per 1000 Welds* Area, Sq. In. Kw. Welding Time, Seconds. Cost per 1000 Welds* 0.05 0.11 0.20 0.31 0.44 0.60 h 10 12 15 5 6 10 12 15 20 $0.07 0.13 0.22 0.33 0.50 0.83 0.79 0.99 1.23 1.77 2.41 3.14 18 20 26 40 45 56 30 30 40 60 70 80 $1.50 1.66 , 2.89 6.67 8.75 ' 12.44 Table IV gives the time, power and! cost per 100 spot-welds, with current at 1/4 cent per Kw.-hr., for welding Nos. 10 to 28 gage sheets. TABLE IV.— Cost of Welding. Gage. Kw. Time in Seconds. Cost per 1000 Welds, Cents.* Gage. Kw. Time in Seconds. Cost per 1000 Welds, Cents. 10 12 14 16 18 18 16 14 12 10 1.5 tlo 0.9 0.8 3.5 2.75 2.5 2.25 20 22 24 26 28 9 8 6 5 0.7 0.6 0.5 0.4 0.3 1.75 1.5 1.25 * Current at 1 cent per Kw.-hr. ELECTRIC HEATERS. Wherever a comparatively small amount of heat is desired to be automatically and uniformly maintained, and started or stopped on the instant without waste, there is the
  • 47.
    province of theelectric heater. The elementary form of heater is some form of resistance, such as coils of thin wire introduced into an electric circuit and surrounded with a substance which will permit the conduction and radiafion of heat, and at the same time serve to electrically insulate the resistance. This resistance should be proportional to the electro-motive force of the current used and to the equation of Joule's law: H = imt X 0.24,
  • 48.
    The text onthis page is estimated to be only 27.86% accurate ELECTRIC HEATING. 1421 where I is the current in amperes! R, the resistance in ohms; t, the time in seconds; and H, the heat in gram-centigrade units. Since the resistance of metals increases as their temperature increases, a thin wire heated by current passing through it will resist more, and grow hotter and hotter until its rate of loss of heat by conduction and radiation equals the rate at which heat is supplied by the current. In a short wire, before heat enough can be dispelled for commercial purposes, fusion will begin ; and in electric heaters it is necessary to use either long lengths of thin wire, or carbon, which alone of all conductors resists fusion. In the majority of heaters, coils of thin wire are used, separately embedded in some substance of poor electrical but good thermal conductivity. Relative Efficiency of Electric and of Steam Heating. — Suppose that by the use of good coal, careful firing, well-designed boilers and triple-expansion engines we are able in daily practice to generate 1 H.P. at the fly-wheel with an expenditure of 2 1/2 Ib. of coal per hour. We have then to convert this energy into electricity, transmit it by wire to the heater, and convert it into heat by passing it through a resistance-coil. We may set the combined efficiency of the dynamo and line circuit at 85.%, and will suppose that all the electricity is converted into heat in the resistance-coils of the radiator. Then 1 brake H.P. at the engine =0.85 electrical H.P. at the resistance coil = 1,683,000 ft.-lb. energy per hour = 2180 heat-units. But since it required 2 1/2 Ibs. of coal to develop 1 brake H.P., it follows that the heat given out at the radiator per pound of coal burned in the boiler furnace will be 2180- ^21/2 = 872 H.U. An ordinary steam-heating system utilizes 9652 H.U. per Ib. of coal for heating; hence the efficiency of the electric system is to the efficiency of the steam-heating system as 872 is to 9652, or about 1 to 11. (Eng'g News, Aug. 9, '90; Mar. 30, '92; May 15, '93.) Heat Required to Warm and Ventilate a Room. — The heat required to raise the temperature of a given space or room to a certain value depends upon the ventilation, the character of the
  • 49.
    walls, the dimensions,proportions of the room, etc. One watt-hour of electrical energy will raise the temperature of one cubic foot of air (measured at 70°) 191° F., or 1 watt will raise the temperature of a cubic foot of air at the rate of 0.0531° F. per second, or approximately 3.2° per minute. In addition to raising the temperature of the air to the desired value, the loss of heat through conduction and ventilation must be supplied. (See Heating and Ventilation.) EXAMPLE. Assume a room of a capacity of 3000 cu. ft., in which the air is changed every 20 minutes, the temperature to be maintained 30° above the outside air. 3000 -T- 20 = 150 cu. ft. per minute. (150 X 30) -s- 3.2 = 1406 watts necessary to supply the ventilation loss. To begin with, to raise the air in the room 30° will require (3000 X 30) -T- 191 =471 watt-hours and therefore the total energy used during the first hour will be 1406 + 471 = 1877 watt- hours or 1.88 Kw.-hours. Domestic Heating. — Electric heating is extensively used for household cooking apparatus. The time taken to heat water in any quantity to any definite temperature not exceeding boiling point can be determined by the formula: V (T* - Ti) 1831 PX Eff. Where t = time in minutes, V = number of pints, T = initial temperature, °F., Tz = final temperature, °F., P = energy consumption in watts, Eff. = Efficiency of cooking utensil, per cent. EXAMPLE. To heat 1 pint of water 100° F. with a 220- watt heater with 50% efficiency, time = (1 X 100 X 1831) -~ (220 X 50) = 16.6 min. The following table (compiled by the National Electric Light Association) gives the watts consumed and cost of operation of different domestic heating devices, the cost of current being at the rate of 5 cents per Kw.-hr.
  • 50.
    The text onthis page is estimated to be only 28.10% accurate 1422 ELECTRICAL ENGINEERING. Cost of Operation of Domestic Heating Appliances. Apparatus. Watts. Cents per hr. Broilers, 3 heat* 300 to 1200 1.5 to 6 Chafing dishes, 3 heat 200 to 500 1 to 2.5 Coffee percolators for 6-in. stove 100 to 440 0.5 to 2.2 Curling-iron heaters 60 0.3 Double boilers for 6-in., 3-heat stove 100 to 440 0.5 to 2.2 Flatiron (domestic size) , 3 Ib 275 1 Flatiron (domestic size), 4 Ib 350 1.4 Flatiron (domestic size) , 5 Ib 400 2 Flatiron (domestic size), 6 Ib 475 2.4 Flatiron (domestic size), 7.5 Ib 540 2.7 Flatiron (domestic size), 9 Ib 610 3.05 Frying kettles, 8 in. diameter 825 4.125 Griddle-cake cookers, 9 in. by 12 in., 3-heat 330 to 880 1.7 to 4.4 Griddle-cake cookers, 12 in. by 18 in., 3-heat 500 to 1500 2.5 to 7.5 Ornamental stoves 250 to 500 1.25 to 2.5 Ovens 1200 to 1500 6 to 7.5 Plate warmers 300 J .5 Radiators . 700 to 6000 3.5 to 30 Ranges: 3-heat, 4 to 6 people 1000 to 4515 5 to 22 Ranges: 3-heat, 6 to 12 people 1100 to 5250 5.5 to 26 Ranges: 3- heat, 12 to 20 people 2000 to 7200 10 to 36 Toasters, 9 in. by 12 in., 3-heat 330 to 880 1.6 to 4.4 Urns, 1-gal., 3-heat 110 to 440 0.5 to 2.2 Urns, 2-gal., 3-heat 220 to 660 1.1 to 3.3 Experience has shown that 300 watt-hours per meal per person is a liberal allowance for electric cooking; or in a family of five, four kilowatt hours per day is an average. ELECTBIC FURNACES. In the combustion furnace, no matter what form of fuel is used, the temperature cannot exceed 2000° C. (3632° F.), and for higher temperatures the electric furnace must be used. The intensity of the heat in this type of furnace depends .on the amount of current that passes, and as most substances are conductors when hot, the degree of intensity possible is theoretically unlimited. In practice, however, the conducting substance begins to fuse when heated to its melting point, and one is then confronted with the physical difficulty of keeping the conducting medium in place, or, if this be accomplished, the conducting medium ultimately vaporizes,, the gaseous materials escape, and heat is thus carried away from the furnace as rapidly as it is supplied. The temperature of the electric
  • 51.
    arc, which issomewhere between 3600° and 4000° C. (6512° - 7232° F.), is perhaps the highest temperature attainable at present. Electric furnaces may be divided in two broad classes, arc furnaces and resistance furnaces. In the former the heat is generated by passing an electric current through the space between the ends of two electrodes, forming the so-called arc. In the resistance furnace the heat is generated in the interior of a body due to its electrical resistance. There are three typical forms of arc furnaces, their common feature being that most and sometimes all of the heat is transmitted to the material by radiation, which extends in all directions. In all the furnaces the arc must be started by a quick movement of the electrodes and afterwards these must be continuously fed together as they are consumed. The chief characteristics of the three main types of arc furnaces are: 1. The direct-heating type, in which two or more electrodes are used and the heating is accomplished by conduction and radiation. The current passes from one electrode down through the slag, across through the bath and up through the slag to the other electrode. The - Heroult furnace belongs to this type. The Girod furnace is also T>f the direct-heating type, the current arcing from the electrodes, which are connected to one side of the circuit. to a fixed electrode in the bottom. * The apparatus can be set at three different heats or temperatures,
  • 52.
    Welcome to ourwebsite – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookfinal.com