Tôi cũng là người mới bắt đầu và thấy khó chịu khi họ không có zip "tất cả các ví dụ". Họ cũng không làm cho nó dễ dàng để kéo chúng xuống tự động bởi vì họ sử dụng javascript để điền danh sách các ví dụ. May mắn là tôi đã có thể sử dụng Chrome để kiểm tra trang ví dụ và cung cấp cho tôi HTML "kết quả cuối cùng" hiệu quả và sử dụng nó để tạo tập lệnh này sẽ tải xuống và giải nén tất cả các ví dụ.
Hy vọng rằng chúng tôi là một cộng đồng có thể giữ danh sách này được duy trì, nhưng tính đến hôm nay, nó chứa tất cả các ví dụ.
ios-examples.sh
#!/bin/bash
while read n; do
wget "http://developer.apple.com/library/ios/samplecode/$n/$n.zip" &&
unzip "$n.zip" &&
rm "$n.zip"
done <<EOF
AQOfflineRenderTest
AccelerometerGraph
Accessory
AddMusic
AdvancedTableViewCells
AdvancedURLConnections
AlternateViews
AppPrefs
BatteryStatus
BonjourWeb
Breadcrumb
BubbleLevel
CopyPasteTile
CoreDataBooks
CryptoExercise
CurrentAddress
DateCell
DateSectionTitles
DocInteraction
DrillDownSave
EADemo
FastEnumerationSample
Formulaic
GKRocket
GKTank
GKTapper
GLES2Sample
GLGravity
GLImageProcessing
GLPaint
GLSprite
GLTextureAtlas
GenericKeychain
HazardMap
HeaderFooter
HeadsUpUI
HelloWorld_iPhone
Icons
InternationalMountains
KMLViewer
KeyboardAccessory
LaunchMe
LazyTableImages
ListAdder
LocateMe
Locations
MailComposer
MapCallouts
MessageComposer
Metronome
MixerHost
MoveMe
MoviePlayer_iPhone
MultipleDetailViews
MusicCube
NavBar
PVRTextureLoader
PageControl
PhotoLocations
PhotoPicker
Popovers
PrintPhoto
PrintWebView
QuartzDemo
QuickContacts
Reachability
Reflection
Scrolling
SeismicXML
SimpleDrillDown
SimpleEKDemo
SimpleFTPSample
SimpleGestureRecognizers
SimpleNetworkStreams
SimpleURLConnections
SimpleUndo
SpeakHere
SysSound
TableSearch
TableViewSuite
TableViewUpdates
TaggedLocations
Teslameter
TheElements
ToolbarSearch
TopPaid
TopSongs
TouchCells
Touches
Trailers
TransWeb
UICatalog
URLCache
ViewTransitions
WeatherMap
WhichWayIsUp
WiTap
WorldCities
ZoomingPDFViewer
aurioTouch
avTouch
iAdSuite
iPhoneCoreDataRecipes
iPhoneExtAudioFileConvertTest
iPhoneMixerEQGraphTest
iPhoneMultichannelMixerTest
iPhoneUnitTests
oalTouch
EOF
Trên một lưu ý liên quan, tôi thấy rằng ack là một cách cao hơn nhiều so với tìm kiếm các ví dụ hơn tìm/grep
Hy vọng điều này giúp những người khác càng nhiều vì nó đã giúp tôi.
Nguồn
2010-12-31 00:20:01
Nó không thể làm tổn thương để cho họ biết đó là cách tốt hơn để bạn lấy mã mẫu: http://developer.apple.com/bugreporter/ –