views:

12843

answers:

9

Sample code is one of the most useful tools for learning about programming. There seem to be many sources on the web for iPhone sample code, but some are harder to find than others. Here's a collection of links I've found so far. Does anyone know of some other sources for iPhone sample code?

+1  A: 

Apple's sample code: http://developer.apple.com/SampleCode/

Here's my delicious list: http://delicious.com/alblue/iphone, including:

AlBlue
Great links for OpenGL ES. Thanks!
Jonah
+1  A: 

http://icodeblog.com/ has many useful tutorials

Nava Carmon
+1  A: 

The sample code from the book I co-wrote is also freely available: http://pragprog.com/titles/amiphd/source_code. Good luck!

invalidname
Hey Chris. In my answer to this question, I mentioned that a few of the samples that I looked at in the book seemed like they didn't separate the model out much to make it MVC. Can you comment on that?
chrish
Like, for example, how we almost never have a separate model class for our table views, typically using an NSArray as the model? That's two things: the concision demanded of a book, and Cocoa convention to a certain degree. The Cocoa collections are really powerful (NSDictionaries support KVC directly), and Cocoa has a preference for direct use of its classes rather than subclassing. So IMHO it's less common to create a FooModel class if it's not clearly necessary. Thanks for the thoughtful comment.
invalidname
+8  A: 

I find that the most useful sample code for me comes with some explanation of what's going on. I prefer a well explained blog post to just source code. Here's some I like

BYU Cocoaheads

http://cocoaheads.byu.edu/

Big Nerd Ranch

http://weblog.bignerdranch.com/

Cocoa with love

http://cocoawithlove.com/

Will Shipley

http://wilshipley.com/blog/

These are just sample code:

Google Code:

http://code.google.com/hosting/search?q=label%3Aiphone

iPhone Cool Projects

http://www.apress.com/book/view/143022357x

iPhone Game Projects

http://www.apress.com/book/downloadfile/4419

Learn Objective-C on the Mac

http://www.apress.com/book/downloadfile/4175

nevan
+1  A: 

You can look around on many of the shared SCM sites (github, google code, etc) and find interesting things just by looking for "iPhone".

Kendall Helmstetter Gelner
+1  A: 

I am starting to look at the Wordpress source. I am interested in applications that correctly show how to organize Model View Controller code. My experience in MVC is from ASP.NET MVC and what I learned there is to have clear separation of the Model from the Controller.

I have seen that Matt Gemmell has some Cocoa source available. There may be some lower level stuff that could be useful.

The samples that I have seen in the iPhone SDK Development book by Bill Dudney and Chris Adamson have bother me that they put the model data directly in the Controller and not in a separate Model object. I will give them the benefit of the doubt to say that they did that to keep the code simpler for book sample code. However, I am interested in seeing high quality, organized, MVC code.

chrish
+2  A: 

http://www.theapptree.com just got started but has a great Navigation and In App purchase sample.

Brian C. Singer
+1  A: 

yeah...

for introductory tutorials about iPhone Application Development, visit: http://msmonir.tech.officelive.com

Thank you.

Mohammed Shirajum Monir
+3  A: 

I hope below collection would help:

1) Blogs on iPhone development:

http://mycodeteacher.com/

http://iphonedevelopment.blogspot.com/

http://iphoneincubator.com/blog/

http://iphone.zcentric.com/

http://iphoneproghelp.blogspot.com/ (Programming Tutorial)

http://icodeblog.com/ (Programming Tutorial)

2) iPhone Source Codes:

http://www.theiphonedev.com/SourceCode/tabid/143/Default.aspx

3) Community:

http://www.iphonekicks.com/

https://devforums.apple.com/

http://iphonedevsdk.com/

4) News:

http://mobileorchard.com/

http://theappleblog.com/

5) Jail breaking/Hacking:

http://theiphoneproject.org/

6) Open source libraries & Applications:

http://www.codingventures.com/2008/12/useful-open-source-libraries-for-iphone-development/#more-43

http://www.sourcemac.com/

http://www.codeplex.com/

Face Detection: http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en

Bar Code: http://stackoverflow.com/questions/838724/barcode-framework-for-the-iphone

Rating: http://github.com/eisernWolf/TouchCustoms

http://github.com/erica/iphone-3.0-cookbook-

http://stackoverflow.com/questions/843167/is-there-a-gallery-of-reusable-iphone-components-on-the-web

http://mattgemmell.com/source

http://stackoverflow.com/questions/200850/are-there-any-open-source-iphone-applications-around

http://stackoverflow.com/questions/640805/open-source-iphone-components-reusable-views-controllers-buttons-table-cells

http://open.iphonedev.com/

http://www.opensourceresources.org/

http://www.raywenderlich.com/tag/sample-code

7) Topic-wise:

App Store: https://developer.apple.com/appstore/resources/approval/guidelines.html

GIF Support: http://stackoverflow.com/questions/1379818/how-can-i-make-an-animated-gif-with-the-iphone-sdk

In App Purchase: http://www.sixtemia.com/journal/2009/08/12/using-store-kit-framework/

IP Address: http://www.iphonedevsdk.com/forum/iphone-sdk-development/5293-get-current-ip-address.html

Page Curl Animation: http://stackoverflow.com/questions/2646714/what-iphone-os-apis-could-i-use-to-implement-a-transition-animation-similar-to-th

TTF Font http://github.com/zynga/FontLabel

Rotate Label: http://iphonedevelopment.blogspot.com/2009/12/better-two-finger-rotate-gesture.html

Speech Recognition: http://cmusphinx.sourceforge.net/

Operation & Thread: http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/

Web service: http://icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/

Code Analyzer: http://clang.llvm.org/StaticAnalysis.html

8) Game Development with Cocos2D:

http://code.google.com/p/cocos2d-iphone/

http://blog.sapusmedia.com/search/label/cocos2d

http://iphonesdkdev.blogspot.com/2009/01/xcode-template-for-cocos2d.html

http://monoclestudios.com/cocos2d_whitepaper.ht

http://lethain.com/entry/2008/oct/03/notes-on-cocos2d-iphone-development/

http://lethain.com/entry/2008/oct/20/touch-detection-in-cocos2d-iphone/

Open GL: http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Archive.html

9) Drawing Chart & Graph

http://code.google.com/p/core-plot/

http://code.google.com/p/s7graphview/

http://github.com/duivesteyn-enterprises/deSimpleChart

http://www.rgraph.net/ (Will work on UIWebView only)

http://sebkade.wordpress.com/2010/05/06/basic-graph-class-for-iphone/ (a blog where demo is given to create a graph)

10) Map Kit

http://github.com/kishikawakatsumi/MapKit-Route-Directions

http://www.iphonedevsdk.com/forum/iphone-sdk-development/8100-opening-maps-app-given-route-direction.html

http://spitzkoff.com/craig/?p=65

11) Audio Streaming

http://code.google.com/p/indie1031/

http://cocoawithlove.com/2010/03/streaming-mp3aac-audio-again.html

http://code.google.com/p/audiostreamer-meta/

http://github.com/DigitalDJ/AudioStreamer

http://lists.apple.com/archives/coreaudio-api/2009/Jan//msg00143.html

12) Twitter

http://code.google.com/p/tweetphoto-api-objective-c/

http://tweetphoto-api-objective-c.googlecode.com/files/TweetPhoto.zip

13) Scroll View

http://github.com/andreyvit/ScrollingMadness

http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/UIScrollView_pg/Introduction/Introduction.html

http://stackoverflow.com/questions/975708/uiscrollview-image-photo-viewer-with-paging-enabled-and-zooming

14) SQLITE:

http://code.google.com/p/sqlitepersistentobjects/

http://www.slideshare.net/360conferences/using-sqlite

15) Video:

http://stackoverflow.com/questions/1617723/how-to-play-youtube-movie-on-an-iphone-application-when-tapped-on-uitableviewcell

http://www.iphonedevsdk.com/forum/iphone-sdk-development/41322-convert-image-sequences-video.html

16) SCM:

http://iphonedevelopment.blogspot.com/2009/03/version-control-is-your-friend.html

http://developer.apple.com/tools/subversionxcode.html

http://stackoverflow.com/questions/431881/scm-for-xcode

http://www.covertapps.com/development/6-setting-up-your-xcode-scm-repositories

Apoorv