download iphone sample code from apple

the iphone sdk documentation has links to sample code, but you have to download them individually from the web. Is there a bundle you can download all at once from apple ?

For example, reading the first iphone tutorial at switchonthecode, the first new word I came across was UIApplication. There are 5 samples on the web...

-------------Problems Reply------------

http://www.jerrybeers.com/index.php/2011/06/18/copying-xcode-samples/ shows how to get all the samples from the existing xcode install on your machine. Very useful!

I'm a beginner as well and found it annoying they don't have an "all examples" zip. They also don't make it easy to pull them down automatically because they use javascript to populate the list of examples.

Fortunately I was able to use Chrome to inspect the examples page and give me the effective "end result" HTML and used it to create this script which will download and unpack all of the examples.

Hopefully we as a community can keep this list maintained, but as of today it does contain all the examples.

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

On a related note, I find that ack is a far superior way to search the examples than find/grep

Hope this helps others as much as it helped me.

Thanks to David Blevins for original posted above. I manually looked for any first added's and grep'd David's script adding new stuff hopefully keeping the script up to date:

#!/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

For those of you on OSX (and don't have wget/don't want to install it just for this). Plus, it looks like it has moved from http to 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

Category:iphone Views:1 Time:2010-04-04

Related post

  • Where can I find older versions of the iPhone sample code 2010-06-29

    I'm trying to find some of the old iphone sample code, becuase it seems like apple will only let you download the most recent versions (compatable with iphone 3.2 +). Is there an archive of these someplace, is there a reason that they remove the olde

  • IOS/iPhone sample code for selecting a location via placename &/or map via use of Google Maps API? 2011-12-09

    Any IOS/iPhone sample code for selecting a location via placename &/or map via use of Google Maps API? So an example of letting the user select a location via user of both: - typing in location & letting Google Maps API attempt to find locati

  • LazyTableImages for iPhone Sample Code Reload Question 2010-11-18

    I am using the LazyTableImages sample code to aynchronusly load images in my table view from an RSS feed. What I would like to know is, how to reload (restart the parsing operation) in this table once a new item has been added, specific to this examp

  • digital zoom iphone sample code 2010-05-24

    any one has sample code or know of a tutorial on how to do a digital zoom for an iphone? or digital zoom in general ? thank in advanced. -Amir --------------Solutions------------- Consider these Categories for NSImage for ways in which you can zoom a

  • Is there a leak in the Scroll View Suite sample code by Apple? 2011-03-22

    I need help with the code from Apple's ScrollViewSuite; specifically I'm looking at the ThumbImageView class, which doesn't have a dealloc method defined. I see in the .h that the property for imageName uses retain. (I wasn't sure if I was allowed to

  • Google + API Iphone sample code 2011-10-12

    I need to integrate google + and +1 sharing in my iphone application. I am looking for a sample code from which i can get some help. Please help me out of this. Thanks, Divya --------------Solutions------------- There is a nice library written by goo

  • For anyone familiar with the "TableViewSuite" sample code in apple dev center 2010-09-17

    In the "sample code" in iOS Dev Center there is a TableViewSuite. In the first example SimpleTableView the simulator provides a list of time zones by country. I can not find the list they are pulling from! it appears to be an array but I can't find t

  • Why doesn't this sample code from Apple work? 2009-12-12

    I am trying to find the full path for a file called 'file1.jpg' I have verified that it is in the app bundle and yet when I run this code: NSBundle* myBundle = [NSBundle mainBundle]; NSString* path = [myBundle pathForResource:@"file1" ofType:@"jpg"];

  • Why does iPhone sample code use so many intermediate variables? 2011-08-12

    I'm currently working through Apress's "Beginning iPhone 3 Development". A standard they use in their example applications is like the following code: - (void)viewDidLoad { BlueViewController *blueController = [[BlueViewController alloc] initWithNibN

  • Unable to download the sample code for theworldsworststackoverflowclone using Tortoise SVN 2011-03-14

    After going through stackapps, just tried downloading theworldsworststackoverflowclone with Tortoise SVN. When I try with Repo-Browser, I get the error: Unrecognized URL scheme for hg clone https ://theworldsworststackoverflowclone.googlecode.com/hg/

  • Apple's iAd sample code throwing errors 2011-05-09

    i am trying to incorporate iAd's into my app and in the process i'v gone through Apple's sample code.This is the link to the sample code. I have downloaded the sample code from apple's developer website and ran the same code without any changes in x-

  • warnning in the PageControl sample code 2011-09-29

    I'm trying to understand the way UIPageControl works. SO I downloaded this sample code from Apple UIPageControlSampleCode It runs fine but there is a warning (Using the result of an assignment as a condition without parentheses) at the if-statement i

  • Sample code for insert and delete row iphone 2010-07-26

    Is there any sample code provides apple for insert and delete rows in a UITableView iphone ? --------------Solutions------------- See the comprehensive article in the iOS Developer library about Inserting and Deleting Rows and Sections.

  • The sample code for admob on iPhone is not showing an ad 2011-05-01

    My goal is to create an AdMob banner in my iPhone app. As a starting point, all I want to do is sucessfully run the example code provided by Google. I registered for an adMob account and got a publisher id. I download the sample code provided by Goog

  • Apple's Services Implementation Guide - Sample Code Not Working 2011-11-16

    Whenever I'm like surfing on the web and I highlight a bunch of text, I see a "New TextWrangler Document with Selection" item on the contextual menu. How do I replicate this functionality with my app so that whenever a user selects text in any other

  • Where can I find iPad Sample Code 2010-02-16

    I know the iPhone has a site with sample apps and code for the iPhone. Are there any resources out there for the iPad? I would like iPad specific examples like using split view, etc. --------------Solutions------------- If you're a member of the Appl

  • UDP communication with some interface (using UDP Echo sample code, problem with main.m) 2011-02-09

    I´ve downloaded the UDPEcho sample code from Apple to make a simple UDP "connection" with a device.. I´m able to make a "connection" setting the ip and port of my device on the main.m provided. Analyzing my console i´m even getting a positive respons

  • iOS: Sample code for simultaneous record and playback 2011-08-25

    I'm designing a simple proof of concept for multitrack recorder. Obvious starting point is to play from file A.caf to headphones while simultaneously recording microphone input into file B.caf This question -- Record and play audio Simultaneously --

  • Reachability sample code 2009-12-21

    I am using Reachability sample code from Apple site. I have added Reachability.h and Reachability.m files to my project, also I have added SystemConfiguration.framework. Added #import "Reachability.h" to my view controller .m file and declared reacha

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.087 (s). 11 q(s)