iPhone SDK文档提供了示例代码的链接,但需要从网上单独下载。是否有一个捆绑包可以从苹果一次性下载?
例如,在switchonthecode上阅读第一个iPhone教程时,我遇到的第一个新词是UIApplication。在网上有5个样例...
iPhone SDK文档提供了示例代码的链接,但需要从网上单独下载。是否有一个捆绑包可以从苹果一次性下载?
例如,在switchonthecode上阅读第一个iPhone教程时,我遇到的第一个新词是UIApplication。在网上有5个样例...
#!/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
顺便说一下,我发现ack比find/grep更好地搜索示例。
希望这能像对我一样对其他人有所帮助。
http://www.jerrybeers.com/index.php/2011/06/18/copying-xcode-samples/展示了如何获取您机器上已经安装的Xcode中所有样例。非常实用!
#!/bin/bash
# Found here:
# https://dev59.com/AEzSa4cB1Zd3GeqPrPuH
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
CoreTelephonyDemo
CryptoExercise
CurrentAddress
DateCell
DateSectionTitles
DocInteraction
DrillDownSave
EADemo
ExternalDisplay
FastEnumerationSample
Formulaic
GKAuthentication
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
MVCNetworking
NavBar
PVRTextureLoader
PageControl
PhotoLocations
PhotoPicker
Popovers
PrintPhoto
PrintWebView
QuartzDemo
QuickContacts
Reachability
Reflection
Scrolling
SeismicXML
SimpleDrillDown
SimpleEKDemo
SimpleFTPSample
SimpleGestureRecognizers
SimpleNetworkStreams
SimpleTextInput
SimpleURLConnections
SimpleUndo
SpeakHere
SysSound
TableSearch
TableViewSuite
TableViewUpdates
TaggedLocations
Teslameter
TheElements
ThreadedCoreData
ToolbarSearch
TopPaid
TopSongs
TouchCells
Touches
Trailers
TransWeb
UICatalog
URLCache
ViewTransitions
WeatherMap
WhichWayIsUp
WiTap
WorldCities
ZoomingPDFViewer
aurioTouch
avTouch
iAdSuite
iPhoneACFileConvertTest
iPhoneCoreDataRecipes
iPhoneExtAudioFileConvertTest
iPhoneMixerEQGraphTest
iPhoneMultichannelMixerTest
iPhoneUnitTests
oalTouch
EOF
对于那些使用OSX的人(并且没有wget/不想仅为此安装它)。另外,看起来它已经从http移动到https:
while read n; do
curl -o $n.zip https://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
CoreTelephonyDemo
CryptoExercise
CurrentAddress
DateCell
DateSectionTitles
DocInteraction
DrillDownSave
EADemo
ExternalDisplay
FastEnumerationSample
Formulaic
GKAuthentication
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
MVCNetworking
NavBar
PVRTextureLoader
PageControl
PhotoLocations
PhotoPicker
Popovers
PrintPhoto
PrintWebView
QuartzDemo
QuickContacts
Reachability
Reflection
Scrolling
SeismicXML
SimpleDrillDown
SimpleEKDemo
SimpleFTPSample
SimpleGestureRecognizers
SimpleNetworkStreams
SimpleTextInput
SimpleURLConnections
SimpleUndo
SpeakHere
SysSound
TableSearch
TableViewSuite
TableViewUpdates
TaggedLocations
Teslameter
TheElements
ThreadedCoreData
ToolbarSearch
TopPaid
TopSongs
TouchCells
Touches
Trailers
TransWeb
UICatalog
URLCache
ViewTransitions
WeatherMap
WhichWayIsUp
WiTap
WorldCities
ZoomingPDFViewer
aurioTouch
avTouch
iAdSuite
iPhoneACFileConvertTest
iPhoneCoreDataRecipes
iPhoneExtAudioFileConvertTest
iPhoneMixerEQGraphTest
iPhoneMultichannelMixerTest
iPhoneUnitTests
oalTouch
EOF