iphone sdk文档有链接到示例代码,但你必须单独从网上下载它们。是否有可以一次从苹果下载的软件包?从苹果下载iphone示例代码
例如,在switchonthecode处读取first iphone tutorial,我碰到的第一个新单词是UIApplication。有5个样本在网上...
iphone sdk文档有链接到示例代码,但你必须单独从网上下载它们。是否有可以一次从苹果下载的软件包?从苹果下载iphone示例代码
例如,在switchonthecode处读取first iphone tutorial,我碰到的第一个新单词是UIApplication。有5个样本在网上...
http://www.jerrybeers.com/index.php/2011/06/18/copying-xcode-samples/演示如何获取所有从现有的Xcode样品在机器上安装。很有用!
我是一个初学者,以及发现它烦人,他们没有“所有示例”zip。由于他们使用javascript来填充示例列表,因此他们也不会轻易将其拉下来。
幸运的是,我可以使用Chrome来检查示例页面,并为我提供有效的“最终结果”HTML,并使用它创建此脚本,该脚本将下载并解压所有示例。
希望我们作为一个社区可以保持这个列表的维护,但截至今天它确实包含所有的例子。
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
与此相关的,我发现ack是寻找比找到的例子远远优于方式/ grep的
希望这有助于其他人一样多因为它帮助了我。
我只希望苹果在github或其他东西中托管示例代码。 – 2010-12-31 00:29:39
我希望他们根据Apple Public Source License授权他们。 – 2010-12-31 01:35:34
感谢David Blevins为上面张贴的原文。我看着手动对任何第一次添加的和grep'd大卫的脚本文件,添加新的东西,希望保持脚本最新:
#!/bin/bash
# Found here:
# http://stackoverflow.com/questions/2576256/download-iphone-sample-code-from-apple
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
让他们知道这将是一个更好的方式来获取示例代码:http://developer.apple.com/bugreporter/ – 2011-08-23 00:23:23