Skip to content

Instantly share code, notes, and snippets.

View doyle's full-sized avatar

Christian Doyle doyle

View GitHub Profile
// This gist demonstrates how to play a movie on the iPhone
// This code sample assumes you have a file called "Movie.m4v" in your Resources folder, and
// have /included the MediaPlayer Framework (/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/MediaPlayer.framework)
#import <MediaPlayer/MediaPlayer.h>
...
-(IBAction)playMovie:(id)sender{
// This sample creates a repeating timer and updates a label on the view each time the timer executes
@interface TimerTextViewController : UIViewController {
IBOutlet UILabel *label;
NSTimer *repeatingTimer;
NSUInteger timerCount;
}
@doyle
doyle / Including resources on the iPhone and loading text files
Created June 21, 2009 02:59
Including files with your iPhone add + loading text files
//This sample loads a text file which is included with your iPhone application and sends the text to
// standard error
//
// This sample assumes you have added a file named "sometext.txt" to your "Resources" folder in your project.
-(NSString *)getFileLocation
{
NSBundle *bundle = [NSBundle mainBundle];
NSString *filePath = [bundle pathForResource:@"sometext" ofType:@"txt"];