Skip to content
Browse files

Adding readme for URL schemes

  • Loading branch information...
1 parent ff081e3 commit 5d3df10d94813daa0a2832f1864bc674170596e8 Erica Sadun committed Oct 5, 2009
Showing with 648 additions and 209 deletions.
  1. +4 −8 C12-GameKit/01-Simple GameKit/main.m
  2. +4 −6 C12-GameKit/02-Monitoring GameKit/main.m
  3. +0 −6 C12-GameKit/06-PictureCatcher AppleTCP/Catcher.h
  4. +18 −24 C12-GameKit/06-PictureCatcher AppleTCP/Catcher.m
  5. +4 −9 C12-GameKit/08-Bonjour Helper/main.m
  6. +4 −8 C12-GameKit/09-GameKit Online Mode/main.m
  7. +1 −2 C13-Networking/04-Recovering IP Information/main.m
  8. +1 −3 C13-Networking/05-Site Reachability/main.m
  9. +1 −3 C13-Networking/06-Synchronous Downloads/main.m
  10. +4 −8 C13-Networking/07-Asynchronous Downloads/main.m
  11. +4 −8 C13-Networking/08-Authentication Challenge/main.m
  12. +0 −2 C13-Networking/09-UNPW Settings Screen/SettingsViewController.h
  13. +8 −10 C13-Networking/09-UNPW Settings Screen/SettingsViewController.m
  14. +0 −2 C13-Networking/09-UNPW Settings Screen/main.m
  15. +0 −2 C13-Networking/10-iTweet/SettingsViewController.h
  16. +8 −10 C13-Networking/10-iTweet/SettingsViewController.m
  17. +7 −11 C13-Networking/10-iTweet/main.m
  18. +0 −2 C13-Networking/11-iTweetPic/SettingsViewController.h
  19. +8 −10 C13-Networking/11-iTweetPic/SettingsViewController.m
  20. +6 −12 C13-Networking/11-iTweetPic/main.m
  21. +0 −2 C13-Networking/12a-MultiApp 1/SettingsViewController.h
  22. +8 −10 C13-Networking/12a-MultiApp 1/SettingsViewController.m
  23. +7 −11 C13-Networking/12a-MultiApp 1/main.m
  24. +0 −2 C13-Networking/12b-MultiApp 2/SettingsViewController.h
  25. +8 −10 C13-Networking/12b-MultiApp 2/SettingsViewController.m
  26. +7 −11 C13-Networking/12b-MultiApp 2/main.m
  27. +1 −0 C13-Networking/13-XML Browser/TreeNode.m
  28. +1 −3 C13-Networking/14-Web Browser/main.m
  29. +7 −9 C13-Networking/15-FTP Helper/main.m
  30. +2 −4 C13-Networking/ZZ-Unique IDs/main.m
  31. +1 −0 C14-Device/README.markdown
  32. +1 −0 C15-Media/07-OffsiteVideo/main.m
  33. BIN C15-Media/07b-Video Loop/Default.png
  34. +239 −0 C15-Media/07b-Video Loop/HelloWorld.xcodeproj/project.pbxproj
  35. +8 −0 C15-Media/07b-Video Loop/HelloWorld_Prefix.pch
  36. +26 −0 C15-Media/07b-Video Loop/Info.plist
  37. +180 −0 C15-Media/07b-Video Loop/TestBedViewController.xib
  38. BIN C15-Media/07b-Video Loop/cover320x416.png
  39. BIN C15-Media/07b-Video Loop/icon.png
  40. +66 −0 C15-Media/07b-Video Loop/main.m
  41. +1 −1 C17-CoreLocation/09-Geocoding/main.m
  42. +3 −0 C21-Grab Bag/README.markdown
View
12 C12-GameKit/01-Simple GameKit/main.m
@@ -15,18 +15,14 @@ @interface TestBedViewController : UIViewController <GameKitHelperDataDelegate,
IBOutlet UITextView *sendView;
IBOutlet UITextView *receiveView;
}
-@property (retain) UITextView *sendView;
-@property (retain) UITextView *receiveView;
@end
@implementation TestBedViewController
-@synthesize sendView;
-@synthesize receiveView;
- (void)textViewDidChange:(UITextView *)textView
{
if (![GameKitHelper sharedInstance].isConnected) return;
- NSString *text = self.sendView.text;
+ NSString *text = sendView.text;
if (!text || (text.length == 0)) text = @"xyzzyclear";
NSData *textData = [text dataUsingEncoding:NSUTF8StringEncoding];
[GameKitHelper sendData:textData];
@@ -35,12 +31,12 @@ - (void)textViewDidChange:(UITextView *)textView
-(void) receivedData: (NSData *) data
{
NSString *text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
- self.receiveView.text = [text isEqualToString:@"xyzzyclear"] ? @"" : text;
+ receiveView.text = [text isEqualToString:@"xyzzyclear"] ? @"" : text;
}
- (void) clear
{
- self.sendView.text = @"";
+ sendView.text = @"";
}
- (void) viewDidLoad
@@ -52,7 +48,7 @@ - (void) viewDidLoad
[GameKitHelper sharedInstance].dataDelegate = self;
[GameKitHelper assignViewController:self];
- [self.sendView becomeFirstResponder];
+ [sendView becomeFirstResponder];
}
@end
View
10 C12-GameKit/02-Monitoring GameKit/main.m
@@ -15,18 +15,16 @@ @interface TestBedViewController : UIViewController <GameKitHelperDataDelegate,
{
IBOutlet UITextView *textView;
}
-@property (retain) UITextView *textView;
@end
@implementation TestBedViewController
-@synthesize textView;
- (void) listenForStderr: (NSTimer *) timer;
{
- NSString *contents = [NSString stringWithContentsOfFile:STDERR_OUT];
+ NSString *contents = [NSString stringWithContentsOfFile:STDERR_OUT encoding:NSUTF8StringEncoding error:NULL];
contents = [contents stringByReplacingOccurrencesOfString:@"\n" withString:@"\n\n"];
- if ([contents isEqualToString:self.textView.text]) return;
- [self.textView setText:contents];
- self.textView.contentOffset = CGPointMake(0.0f, MAX(self.textView.contentSize.height - self.textView.frame.size.height, 0.0f));
+ if ([contents isEqualToString:textView.text]) return;
+ [textView setText:contents];
+ textView.contentOffset = CGPointMake(0.0f, MAX(textView.contentSize.height - textView.frame.size.height, 0.0f));
}
- (void) viewDidLoad
View
6 C12-GameKit/06-PictureCatcher AppleTCP/Catcher.h
@@ -16,12 +16,6 @@
BOOL success;
}
-@property (retain) NSImageView *imageView;
-@property (retain) NSTextField *textField;
-@property (retain) NSTextField *statusText;
-@property (retain) NSButton *button;
-@property (retain) NSProgressIndicator *progress;
-@property (retain) NSMenuItem *saveItem;
@property (retain) NSData *imageData;
@property (retain) NSNetServiceBrowser *browser;
View
42 C12-GameKit/06-PictureCatcher AppleTCP/Catcher.m
@@ -12,15 +12,9 @@
#import "TCPConnection.h"
#define STRINGEQ(X,Y) ([X caseInsensitiveCompare:Y] == NSOrderedSame)
-#define ANNOUNCE(format, ...) [self.statusText setTitleWithMnemonic:[NSString stringWithFormat:format, ##__VA_ARGS__]];
+#define ANNOUNCE(format, ...) [statusText setTitleWithMnemonic:[NSString stringWithFormat:format, ##__VA_ARGS__]];
@implementation Catcher
-@synthesize imageView;
-@synthesize textField;
-@synthesize statusText;
-@synthesize button;
-@synthesize progress;
-@synthesize saveItem;
@synthesize imageData;
@synthesize browser;
@@ -73,12 +67,12 @@ - (void) connection:(TCPConnection*)connection didReceiveData:(NSData*)data;
success = YES;
self.imageData = data;
NSImage *image = [self imageFromData:data];
- [self.imageView setImage:image];
+ [imageView setImage:image];
- [self.saveItem setEnabled:YES];
- [self.button setEnabled:YES];
+ [saveItem setEnabled:YES];
+ [button setEnabled:YES];
- [self.progress stopAnimation:nil];
+ [progress stopAnimation:nil];
ANNOUNCE(@"Recived JPEG image (%d bytes).\n\nUse File > Save to save the received image to disk.", data.length);
}
@@ -90,10 +84,10 @@ - (void) connectionDidClose:(TCPConnection*)connection
ANNOUNCE(@"Connection denied or lost. Sorry.");
self.imageData = nil;
- [self.saveItem setEnabled:NO];
- [self.imageView setImage:nil];
- [self.button setEnabled:YES];
- [self.progress stopAnimation:nil];
+ [saveItem setEnabled:NO];
+ [imageView setImage:nil];
+ [button setEnabled:YES];
+ [progress stopAnimation:nil];
}
// Upon resolving address, create a connection to that address and request data
@@ -104,24 +98,24 @@ - (void)netServiceDidResolveAddress:(NSNetService *)netService
struct sockaddr* address = (struct sockaddr*)[[addresses objectAtIndex:0] bytes];
TCPConnection *connection = [[TCPConnection alloc] initWithRemoteAddress:address];
[connection setDelegate:self];
- [self.statusText setTitleWithMnemonic:@"Requesting data..."];
- [self.progress startAnimation:nil];
+ [statusText setTitleWithMnemonic:@"Requesting data..."];
+ [progress startAnimation:nil];
[netService release];
[connection receiveData];
}
}
// Complain when resolve fails
- (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict {
- [self.statusText setTitleWithMnemonic:@"Error resolving service. Sorry."];
+ [statusText setTitleWithMnemonic:@"Error resolving service. Sorry."];
}
// Upon finding a service, stop the browser and resolve
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didFindService:(NSNetService *)netService moreComing:(BOOL)moreServicesComing
{
[self.browser stop];
self.browser = nil;
- [self.statusText setTitleWithMnemonic:@"Resolving service."];
+ [statusText setTitleWithMnemonic:@"Resolving service."];
[[netService retain] setDelegate:self];
[netService resolveWithTimeout:0.0f];
}
@@ -130,17 +124,17 @@ - (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didFindServic
- (IBAction) catchPlease: (id) sender
{
success = NO;
- [self.statusText setTitleWithMnemonic:@"Scanning for service"];
+ [statusText setTitleWithMnemonic:@"Scanning for service"];
self.browser = [[[NSNetServiceBrowser alloc] init] autorelease];
[self.browser setDelegate:self];
NSString *type = [TCPConnection bonjourTypeFromIdentifier:@"PictureThrow"];
[self.browser searchForServicesOfType:type inDomain:@"local"];
- [self.button setEnabled:NO];
+ [button setEnabled:NO];
self.imageData = nil;
- [self.saveItem setEnabled:NO];
- [self.imageView setImage:nil];
+ [saveItem setEnabled:NO];
+ [imageView setImage:nil];
}
// Write data to disk based on save panel settings
@@ -151,7 +145,7 @@ - (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextI
else
{
[self.imageData writeToFile:[sheet filename] atomically:YES];
- [self.saveItem setEnabled:NO];
+ [saveItem setEnabled:NO];
}
}
View
13 C12-GameKit/08-Bonjour Helper/main.m
@@ -15,18 +15,13 @@ @interface TestBedViewController : UIViewController <BonjourHelperDataDelegate,
IBOutlet UITextView *sendView;
IBOutlet UITextView *receiveView;
}
-@property (retain) UITextView *sendView;
-@property (retain) UITextView *receiveView;
@end
@implementation TestBedViewController
-@synthesize sendView;
-@synthesize receiveView;
-
- (void)textViewDidChange:(UITextView *)textView
{
if (![BonjourHelper sharedInstance].isConnected) return;
- NSString *text = self.sendView.text;
+ NSString *text = sendView.text;
if (!text || (text.length == 0)) text = @"xyzzyclear";
NSData *textData = [text dataUsingEncoding:NSUTF8StringEncoding];
[BonjourHelper sendData:textData];
@@ -35,20 +30,20 @@ - (void)textViewDidChange:(UITextView *)textView
-(void) receivedData: (NSData *) data
{
NSString *text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
- self.receiveView.text = [text isEqualToString:@"xyzzyclear"] ? @"" : text;
+ receiveView.text = [text isEqualToString:@"xyzzyclear"] ? @"" : text;
}
- (void) clear
{
- self.sendView.text = @"";
+ sendView.text = @"";
}
- (void) viewDidLoad
{
self.navigationController.navigationBar.tintColor = COOKBOOK_PURPLE_COLOR;
self.navigationItem.leftBarButtonItem = BARBUTTON(@"Clear", @selector(clear));
self.title = @"Let's chat";
- [self.sendView becomeFirstResponder];
+ [sendView becomeFirstResponder];
if (![BonjourHelper performWiFiCheck]) return;
View
12 C12-GameKit/09-GameKit Online Mode/main.m
@@ -16,17 +16,13 @@ @interface TestBedViewController : UIViewController <GameKitHelperDataDelegate,
IBOutlet UITextView *sendView;
IBOutlet UITextView *receiveView;
}
-@property (retain) UITextView *sendView;
-@property (retain) UITextView *receiveView;
@end
@implementation TestBedViewController
-@synthesize sendView;
-@synthesize receiveView;
- (void)textViewDidChange:(UITextView *)textView
{
- NSString *text = self.sendView.text;
+ NSString *text = sendView.text;
if (!text || (text.length == 0)) text = @"xyzzyclear";
NSData *textData = [text dataUsingEncoding:NSUTF8StringEncoding];
@@ -37,12 +33,12 @@ - (void)textViewDidChange:(UITextView *)textView
-(void) receivedData: (NSData *) data
{
NSString *text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
- self.receiveView.text = [text isEqualToString:@"xyzzyclear"] ? @"" : text;
+ receiveView.text = [text isEqualToString:@"xyzzyclear"] ? @"" : text;
}
- (void) clear
{
- self.sendView.text = @"";
+ sendView.text = @"";
}
- (void) viewDidLoad
@@ -54,7 +50,7 @@ - (void) viewDidLoad
[GameKitHelper sharedInstance].dataDelegate = self;
[GameKitHelper assignViewController:self];
- [self.sendView becomeFirstResponder];
+ [sendView becomeFirstResponder];
}
@end
View
3 C13-Networking/04-Recovering IP Information/main.m
@@ -16,7 +16,6 @@ @interface TestBedViewController : UIViewController
IBOutlet UITextView *textView;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
@end
@implementation TestBedViewController
@@ -32,7 +31,7 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- self.textView.text = self.log;
+ textView.text = self.log;
}
- (void) action: (UIBarButtonItem *) bbi
View
4 C13-Networking/05-Site Reachability/main.m
@@ -20,12 +20,10 @@ @interface TestBedViewController : UIViewController
IBOutlet UITextView *textView;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
// Direct from Apple. Thank you Apple
- (BOOL)addressFromString:(NSString *)IPAddress address:(struct sockaddr_in *)address
@@ -98,7 +96,7 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- self.textView.text = self.log;
+ textView.text = self.log;
}
#define CHECK(SITE) [self doLog:@"%@ : %@", SITE, [self hostAvailable:SITE] ? @"available" : @"not available"];
View
4 C13-Networking/06-Synchronous Downloads/main.m
@@ -17,13 +17,11 @@ @interface TestBedViewController : UIViewController
NSString *savePath;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
@property (retain) NSString *savePath;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
@synthesize savePath;
// relatively short movie (3 MB)
@@ -60,7 +58,7 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- [self.textView performSelectorOnMainThread:@selector(setText:) withObject:self.log waitUntilDone:NO];
+ [textView performSelectorOnMainThread:@selector(setText:) withObject:self.log waitUntilDone:NO];
}
- (void) finishedGettingData
View
12 C13-Networking/07-Asynchronous Downloads/main.m
@@ -19,15 +19,11 @@ @interface TestBedViewController : UIViewController
NSString *savePath;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
-@property (retain) UIProgressView *progress;
@property (retain) NSString *savePath;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
-@synthesize progress;
@synthesize savePath;
#define SMALL_URL @"http://www.archive.org/download/Drive-inSaveFreeTv/Drive-in--SaveFreeTv_512kb.mp4"
@@ -58,7 +54,7 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- [self.textView setText:self.log];
+ [textView setText:self.log];
}
- (void) restoreGUI
@@ -68,13 +64,13 @@ - (void) restoreGUI
self.navigationItem.leftBarButtonItem = BARBUTTON(@"Play", @selector(startPlayback:));
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
[(UISegmentedControl *)self.navigationItem.titleView setEnabled:YES];
- [self.progress setHidden:YES];
+ [progress setHidden:YES];
}
- (void) dataDownloadAtPercent: (NSNumber *) aPercent
{
- [self.progress setHidden:NO];
- [self.progress setProgress:[aPercent floatValue]];
+ [progress setHidden:NO];
+ [progress setProgress:[aPercent floatValue]];
}
- (void) dataDownloadFailed: (NSString *) reason
View
12 C13-Networking/08-Authentication Challenge/main.m
@@ -18,15 +18,11 @@ @interface TestBedViewController : UIViewController
NSString *savePath;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
-@property (retain) UIProgressView *progress;
@property (retain) NSString *savePath;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
-@synthesize progress;
@synthesize savePath;
#define DEST_PATH [NSHomeDirectory() stringByAppendingString:@"/Documents/"]
@@ -40,21 +36,21 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- [self.textView setText:self.log];
+ [textView setText:self.log];
}
- (void) restoreGUI
{
self.navigationItem.rightBarButtonItem = BARBUTTON(@"Unauthorized", @selector(unauthorized:));
self.navigationItem.leftBarButtonItem = BARBUTTON(@"Authorized", @selector(authorized:));
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
- [self.progress setHidden:YES];
+ [progress setHidden:YES];
}
- (void) dataDownloadAtPercent: (NSNumber *) aPercent
{
- [self.progress setHidden:NO];
- [self.progress setProgress:[aPercent floatValue]];
+ [progress setHidden:NO];
+ [progress setProgress:[aPercent floatValue]];
}
- (void) dataDownloadFailed: (NSString *) reason
View
2 C13-Networking/09-UNPW Settings Screen/SettingsViewController.h
@@ -14,7 +14,5 @@
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *username;
-@property (retain) UITextField *password;
@property (retain) KeychainItemWrapper *wrapper;
@end
View
18 C13-Networking/09-UNPW Settings Screen/SettingsViewController.m
@@ -10,8 +10,6 @@
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
@implementation SettingsViewController
-@synthesize username;
-@synthesize password;
@synthesize wrapper;
- (void)textFieldDidBeginEditing:(UITextField *)textField
@@ -23,8 +21,8 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField
- (void) dismiss: (id) sender
{
// recover data, save it, and dismiss
- NSString *uname = [self.username text];
- NSString *pword = [self.password text];
+ NSString *uname = [username text];
+ NSString *pword = [password text];
if (uname) [self.wrapper setObject:uname forKey:(id)kSecAttrAccount];
if (pword) [self.wrapper setObject:pword forKey:(id)kSecValueData];
@@ -49,17 +47,17 @@ - (void) viewDidLoad
NSString *uname = [self.wrapper objectForKey:(id)kSecAttrAccount];
NSString *pword = [self.wrapper objectForKey:(id)kSecValueData];
- if (uname) self.username.text = uname;
- if (pword) self.password.text = pword;
+ if (uname) username.text = uname;
+ if (pword) password.text = pword;
- self.username.delegate = self;
- self.password.delegate = self;
+ username.delegate = self;
+ password.delegate = self;
}
- (void) dealloc
{
- self.username = nil;
- self.password = nil;
+ username = nil;
+ password = nil;
self.wrapper = nil;
[super dealloc];
}
View
2 C13-Networking/09-UNPW Settings Screen/main.m
@@ -17,11 +17,9 @@ @interface TestBedViewController : UIViewController <UITextFieldDelegate>
{
IBOutlet UITextField *textField;
}
-@property (retain) UITextField *textField;
@end
@implementation TestBedViewController
-@synthesize textField;
- (void) settings: (UIBarButtonItem *) bbi
{
View
2 C13-Networking/10-iTweet/SettingsViewController.h
@@ -14,7 +14,5 @@
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *username;
-@property (retain) UITextField *password;
@property (retain) KeychainItemWrapper *wrapper;
@end
View
18 C13-Networking/10-iTweet/SettingsViewController.m
@@ -10,8 +10,6 @@
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
@implementation SettingsViewController
-@synthesize username;
-@synthesize password;
@synthesize wrapper;
- (void)textFieldDidBeginEditing:(UITextField *)textField
@@ -23,8 +21,8 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField
- (void) dismiss: (id) sender
{
// recover data, save it, and dismiss
- NSString *uname = [self.username text];
- NSString *pword = [self.password text];
+ NSString *uname = [username text];
+ NSString *pword = [password text];
if (uname) [self.wrapper setObject:uname forKey:(id)kSecAttrAccount];
if (pword) [self.wrapper setObject:pword forKey:(id)kSecValueData];
@@ -49,17 +47,17 @@ - (void) viewDidLoad
NSString *uname = [self.wrapper objectForKey:(id)kSecAttrAccount];
NSString *pword = [self.wrapper objectForKey:(id)kSecValueData];
- if (uname) self.username.text = uname;
- if (pword) self.password.text = pword;
+ if (uname) username.text = uname;
+ if (pword) password.text = pword;
- self.username.delegate = self;
- self.password.delegate = self;
+ username.delegate = self;
+ password.delegate = self;
}
- (void) dealloc
{
- self.username = nil;
- self.password = nil;
+ username = nil;
+ password = nil;
self.wrapper = nil;
[super dealloc];
}
View
18 C13-Networking/10-iTweet/main.m
@@ -32,15 +32,11 @@ @interface TestBedViewController : UIViewController <UITextFieldDelegate, Twitte
IBOutlet UIActivityIndicatorView *activity;
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *textField;
@property (retain) KeychainItemWrapper *wrapper;
-@property (retain) UIActivityIndicatorView *activity;
@end
@implementation TestBedViewController
-@synthesize textField;
@synthesize wrapper;
-@synthesize activity;
- (void) hideButtons
{
@@ -56,7 +52,7 @@ - (void) showButtons
- (void) doneTweeting : (NSString *) outstring
{
- [self.activity stopAnimating];
+ [activity stopAnimating];
if (outstring.length < 60) // probable error
showAlert(outstring);
@@ -66,26 +62,26 @@ - (void) doneTweeting : (NSString *) outstring
{
// probable success
showAlert(@"Success! Your message was tweeted.");
- self.textField.text = @"";
+ textField.text = @"";
}
- [self.textField setEnabled:YES];
+ [textField setEnabled:YES];
[self showButtons];
}
- (void) tweet: (UIBarButtonItem *) bbi
{
- NSString *text = self.textField.text;
+ NSString *text = textField.text;
if (!text || (text.length == 0))
{
showAlert(@"Please enter text before you tweet.");
return;
}
- [self.textField resignFirstResponder];
- [self.textField setEnabled:NO];
+ [textField resignFirstResponder];
+ [textField setEnabled:NO];
[self hideButtons];
- [self.activity startAnimating];
+ [activity startAnimating];
TwitterOperation *operation = [[[TwitterOperation alloc] init] autorelease];
operation.delegate = self;
View
2 C13-Networking/11-iTweetPic/SettingsViewController.h
@@ -14,7 +14,5 @@
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *username;
-@property (retain) UITextField *password;
@property (retain) KeychainItemWrapper *wrapper;
@end
View
18 C13-Networking/11-iTweetPic/SettingsViewController.m
@@ -10,8 +10,6 @@
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
@implementation SettingsViewController
-@synthesize username;
-@synthesize password;
@synthesize wrapper;
- (void)textFieldDidBeginEditing:(UITextField *)textField
@@ -23,8 +21,8 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField
- (void) dismiss: (id) sender
{
// recover data, save it, and dismiss
- NSString *uname = [self.username text];
- NSString *pword = [self.password text];
+ NSString *uname = [username text];
+ NSString *pword = [password text];
if (uname) [self.wrapper setObject:uname forKey:(id)kSecAttrAccount];
if (pword) [self.wrapper setObject:pword forKey:(id)kSecValueData];
@@ -49,17 +47,17 @@ - (void) viewDidLoad
NSString *uname = [self.wrapper objectForKey:(id)kSecAttrAccount];
NSString *pword = [self.wrapper objectForKey:(id)kSecValueData];
- if (uname) self.username.text = uname;
- if (pword) self.password.text = pword;
+ if (uname) username.text = uname;
+ if (pword) password.text = pword;
- self.username.delegate = self;
- self.password.delegate = self;
+ username.delegate = self;
+ password.delegate = self;
}
- (void) dealloc
{
- self.username = nil;
- self.password = nil;
+ username = nil;
+ password = nil;
self.wrapper = nil;
[super dealloc];
}
View
18 C13-Networking/11-iTweetPic/main.m
@@ -35,17 +35,11 @@ @interface TestBedViewController : UIViewController <TwitPicOperationDelegate, U
UIImage *image;
KeychainItemWrapper *wrapper;
}
-@property (retain) UIButton *button;
-@property (retain) UIImageView *imageView;
-@property (retain) UIActivityIndicatorView *activity;
@property (retain) UIImage *image;
@property (retain) KeychainItemWrapper *wrapper;
@end
@implementation TestBedViewController
-@synthesize button;
-@synthesize imageView;
-@synthesize activity;
@synthesize wrapper;
@synthesize image;
@@ -63,18 +57,18 @@ - (void) showButtons
- (void) doneTweeting : (NSString *) outstring
{
- [self.activity stopAnimating];
+ [activity stopAnimating];
showAlert(outstring);
- [self.button setEnabled:YES];
+ [button setEnabled:YES];
[self showButtons];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *img = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
self.image = [ImageHelper image:img fillSize:(CGSizeMake(320.0f, 480.0f))];
- UIImage *thumb = [ImageHelper image:self.image fitInSize:self.imageView.frame.size];
- self.imageView.image = thumb;
+ UIImage *thumb = [ImageHelper image:self.image fitInSize:imageView.frame.size];
+ imageView.image = thumb;
[self dismissModalViewControllerAnimated:YES];
[picker release];
@@ -104,8 +98,8 @@ - (void) tweet: (UIBarButtonItem *) bbi
}
[self hideButtons];
- self.button.enabled = NO;
- [self.activity startAnimating];
+ button.enabled = NO;
+ [activity startAnimating];
TwitPicOperation *operation = [[[TwitPicOperation alloc] init] autorelease];
operation.delegate = self;
View
2 C13-Networking/12a-MultiApp 1/SettingsViewController.h
@@ -14,7 +14,5 @@
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *username;
-@property (retain) UITextField *password;
@property (retain) KeychainItemWrapper *wrapper;
@end
View
18 C13-Networking/12a-MultiApp 1/SettingsViewController.m
@@ -10,8 +10,6 @@
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
@implementation SettingsViewController
-@synthesize username;
-@synthesize password;
@synthesize wrapper;
- (void)textFieldDidBeginEditing:(UITextField *)textField
@@ -23,8 +21,8 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField
- (void) dismiss: (id) sender
{
// recover data, save it, and dismiss
- NSString *uname = [self.username text];
- NSString *pword = [self.password text];
+ NSString *uname = [username text];
+ NSString *pword = [password text];
if (uname) [self.wrapper setObject:uname forKey:(id)kSecAttrAccount];
if (pword) [self.wrapper setObject:pword forKey:(id)kSecValueData];
@@ -48,17 +46,17 @@ - (void) viewDidLoad
NSString *uname = [self.wrapper objectForKey:(id)kSecAttrAccount];
NSString *pword = [self.wrapper objectForKey:(id)kSecValueData];
- if (uname) self.username.text = uname;
- if (pword) self.password.text = pword;
+ if (uname) username.text = uname;
+ if (pword) password.text = pword;
- self.username.delegate = self;
- self.password.delegate = self;
+ username.delegate = self;
+ password.delegate = self;
}
- (void) dealloc
{
- self.username = nil;
- self.password = nil;
+ username = nil;
+ password = nil;
self.wrapper = nil;
[super dealloc];
}
View
18 C13-Networking/12a-MultiApp 1/main.m
@@ -32,15 +32,11 @@ @interface TestBedViewController : UIViewController <UITextFieldDelegate, Twitte
IBOutlet UIActivityIndicatorView *activity;
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *textField;
@property (retain) KeychainItemWrapper *wrapper;
-@property (retain) UIActivityIndicatorView *activity;
@end
@implementation TestBedViewController
-@synthesize textField;
@synthesize wrapper;
-@synthesize activity;
- (void) hideButtons
{
@@ -56,7 +52,7 @@ - (void) showButtons
- (void) doneTweeting : (NSString *) outstring
{
- [self.activity stopAnimating];
+ [activity stopAnimating];
if (outstring.length < 60) // probable error
showAlert(outstring);
@@ -66,26 +62,26 @@ - (void) doneTweeting : (NSString *) outstring
{
// probable success
showAlert(@"Success! Your message was tweeted.");
- self.textField.text = @"";
+ textField.text = @"";
}
- [self.textField setEnabled:YES];
+ [textField setEnabled:YES];
[self showButtons];
}
- (void) tweet: (UIBarButtonItem *) bbi
{
- NSString *text = self.textField.text;
+ NSString *text = textField.text;
if (!text || (text.length == 0))
{
showAlert(@"Please enter text before you tweet.");
return;
}
- [self.textField resignFirstResponder];
- [self.textField setEnabled:NO];
+ [textField resignFirstResponder];
+ [textField setEnabled:NO];
[self hideButtons];
- [self.activity startAnimating];
+ [activity startAnimating];
TwitterOperation *operation = [[[TwitterOperation alloc] init] autorelease];
operation.delegate = self;
View
2 C13-Networking/12b-MultiApp 2/SettingsViewController.h
@@ -14,7 +14,5 @@
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *username;
-@property (retain) UITextField *password;
@property (retain) KeychainItemWrapper *wrapper;
@end
View
18 C13-Networking/12b-MultiApp 2/SettingsViewController.m
@@ -10,8 +10,6 @@
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
@implementation SettingsViewController
-@synthesize username;
-@synthesize password;
@synthesize wrapper;
- (void)textFieldDidBeginEditing:(UITextField *)textField
@@ -23,8 +21,8 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField
- (void) dismiss: (id) sender
{
// recover data, save it, and dismiss
- NSString *uname = [self.username text];
- NSString *pword = [self.password text];
+ NSString *uname = [username text];
+ NSString *pword = [password text];
if (uname) [self.wrapper setObject:uname forKey:(id)kSecAttrAccount];
if (pword) [self.wrapper setObject:pword forKey:(id)kSecValueData];
@@ -49,17 +47,17 @@ - (void) viewDidLoad
NSString *uname = [self.wrapper objectForKey:(id)kSecAttrAccount];
NSString *pword = [self.wrapper objectForKey:(id)kSecValueData];
- if (uname) self.username.text = uname;
- if (pword) self.password.text = pword;
+ if (uname) username.text = uname;
+ if (pword) password.text = pword;
- self.username.delegate = self;
- self.password.delegate = self;
+ username.delegate = self;
+ password.delegate = self;
}
- (void) dealloc
{
- self.username = nil;
- self.password = nil;
+ username = nil;
+ password = nil;
self.wrapper = nil;
[super dealloc];
}
View
18 C13-Networking/12b-MultiApp 2/main.m
@@ -32,15 +32,11 @@ @interface TestBedViewController : UIViewController <UITextFieldDelegate, Twitte
IBOutlet UIActivityIndicatorView *activity;
KeychainItemWrapper *wrapper;
}
-@property (retain) UITextField *textField;
@property (retain) KeychainItemWrapper *wrapper;
-@property (retain) UIActivityIndicatorView *activity;
@end
@implementation TestBedViewController
-@synthesize textField;
@synthesize wrapper;
-@synthesize activity;
- (void) hideButtons
{
@@ -56,7 +52,7 @@ - (void) showButtons
- (void) doneTweeting : (NSString *) outstring
{
- [self.activity stopAnimating];
+ [activity stopAnimating];
if (outstring.length < 60) // probable error
showAlert(outstring);
@@ -66,26 +62,26 @@ - (void) doneTweeting : (NSString *) outstring
{
// probable success
showAlert(@"Success! Your message was tweeted.");
- self.textField.text = @"";
+ textField.text = @"";
}
- [self.textField setEnabled:YES];
+ [textField setEnabled:YES];
[self showButtons];
}
- (void) tweet: (UIBarButtonItem *) bbi
{
- NSString *text = self.textField.text;
+ NSString *text = textField.text;
if (!text || (text.length == 0))
{
showAlert(@"Please enter text before you tweet.");
return;
}
- [self.textField resignFirstResponder];
- [self.textField setEnabled:NO];
+ [textField resignFirstResponder];
+ [textField setEnabled:NO];
[self hideButtons];
- [self.activity startAnimating];
+ [activity startAnimating];
TwitterOperation *operation = [[[TwitterOperation alloc] init] autorelease];
operation.delegate = self;
View
1 C13-Networking/13-XML Browser/TreeNode.m
@@ -251,6 +251,7 @@ - (void) teardown
{
for (TreeNode *node in [[self.children copy] autorelease]) [node teardown];
[self.parent.children removeObject:self];
+ self.parent = nil;
}
- (void) dealloc
View
4 C13-Networking/14-Web Browser/main.m
@@ -25,12 +25,10 @@ @interface TestBedViewController : UIViewController <WebHelperDelegate>
IBOutlet UITextView *textView;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
- (void) doLog: (NSString *) formatstring, ...
{
va_list arglist;
@@ -40,7 +38,7 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- self.textView.text = self.log;
+ textView.text = self.log;
}
- (void) serviceCouldNotBeEstablished
View
16 C13-Networking/15-FTP Helper/main.m
@@ -21,12 +21,10 @@ @interface TestBedViewController : UIViewController <UITextFieldDelegate>
IBOutlet UITextView *textView;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
- (void) doLog: (NSString *) formatstring, ...
{
@@ -37,13 +35,13 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- self.textView.text = self.log;
+ textView.text = self.log;
}
#pragma mark ***** TESTING LISTINGS
- (void) receivedListing: (NSArray *) listing
{
- self.textView.font = [UIFont fontWithName:@"Courier" size:10.0f];
+ textView.font = [UIFont fontWithName:@"Courier" size:10.0f];
self.log = [NSMutableString string];
[self doLog:@"FILE LISTING"];
@@ -53,23 +51,23 @@ - (void) receivedListing: (NSArray *) listing
- (void) listingFailed
{
- self.textView.font = [UIFont systemFontOfSize:16.0f];
+ textView.font = [UIFont systemFontOfSize:16.0f];
self.log = [NSMutableString string];
[self doLog:@"Listing failed."];
}
#pragma mark ***** TESTING UPLOAD
- (void) dataUploadFinished: (NSNumber *) bytes;
{
- self.textView.font = [UIFont systemFontOfSize:16.0f];
+ textView.font = [UIFont systemFontOfSize:16.0f];
self.log = [NSMutableString string];
[self doLog:@"Upload Finished!"];
[self doLog:@"Uploaded %@ bytes", bytes];
}
- (void) dataUploadFailed: (NSString *) reason
{
- self.textView.font = [UIFont systemFontOfSize:16.0f];
+ textView.font = [UIFont systemFontOfSize:16.0f];
self.log = [NSMutableString string];
[self doLog:@"Upload Failed."];
}
@@ -78,7 +76,7 @@ - (void) dataUploadFailed: (NSString *) reason
- (void) downloadFinished
{
- self.textView.font = [UIFont systemFontOfSize:16.0f];
+ textView.font = [UIFont systemFontOfSize:16.0f];
self.log = [NSMutableString string];
// There are probably better ways to get the file size
@@ -89,7 +87,7 @@ - (void) downloadFinished
- (void) dataDownloadFailed: (NSString *) reason
{
- self.textView.font = [UIFont systemFontOfSize:16.0f];
+ textView.font = [UIFont systemFontOfSize:16.0f];
self.log = [NSMutableString string];
[self doLog:@"Download failed..."];
[self doLog:reason];
View
6 C13-Networking/ZZ-Unique IDs/main.m
@@ -15,12 +15,10 @@ @interface TestBedViewController : UIViewController
IBOutlet UITextView *textView;
}
@property (retain) NSMutableString *log;
-@property (retain) UITextView *textView;
@end
@implementation TestBedViewController
@synthesize log;
-@synthesize textView;
- (void) doLog: (NSString *) formatstring, ...
{
@@ -31,7 +29,7 @@ - (void) doLog: (NSString *) formatstring, ...
va_end(arglist);
[self.log appendString:outstring];
[self.log appendString:@"\n"];
- self.textView.text = self.log;
+ textView.text = self.log;
}
- (NSString *) uniqueString
@@ -50,7 +48,7 @@ - (void) generate
- (void) clear
{
self.log = [NSMutableString string];
- self.textView.text = @"";
+ textView.text = @"";
}
- (void) viewDidLoad
View
1 C14-Device/README.markdown
@@ -0,0 +1 @@
+Please see http://github.com/erica/uidevice-extension for a full UIDevice category
View
1 C15-Media/07-OffsiteVideo/main.m
@@ -20,6 +20,7 @@ @implementation TestBedViewController
-(void)myMovieFinishedCallback:(NSNotification*)aNotification
{
MPMoviePlayerController* theMovie=[aNotification object];
+ CFShow([aNotification userInfo]);
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
[theMovie release];
self.navigationItem.rightBarButtonItem = BARBUTTON(@"Play", @selector(play:));
View
BIN C15-Media/07b-Video Loop/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
239 C15-Media/07b-Video Loop/HelloWorld.xcodeproj/project.pbxproj
@@ -0,0 +1,239 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ 8E3A1F090FAA199F009B0518 /* cover320x416.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E3A1F080FAA199F009B0518 /* cover320x416.png */; };
+ 8E4156E90FA4EE0E0006D27C /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E4156E70FA4EE0E0006D27C /* Default.png */; };
+ 8E4156EA0FA4EE0E0006D27C /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E4156E80FA4EE0E0006D27C /* icon.png */; };
+ 8E785FCB0FCDB853006EA81F /* TestBedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8E785FCA0FCDB853006EA81F /* TestBedViewController.xib */; };
+ 8ED756FD102BADEF00AF9B7A /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8ED756FC102BADEF00AF9B7A /* MediaPlayer.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 1D6058910D05DD3D006BFB54 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 32CA4F630368D1EE00C91783 /* HelloWorld_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloWorld_Prefix.pch; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8E3A1F080FAA199F009B0518 /* cover320x416.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cover320x416.png; sourceTree = "<group>"; };
+ 8E4156E70FA4EE0E0006D27C /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
+ 8E4156E80FA4EE0E0006D27C /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
+ 8E785FCA0FCDB853006EA81F /* TestBedViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TestBedViewController.xib; sourceTree = "<group>"; };
+ 8ED756FC102BADEF00AF9B7A /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
+ 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */,
+ 8ED756FD102BADEF00AF9B7A /* MediaPlayer.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1D6058910D05DD3D006BFB54 /* HelloWorld.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97316FDCFA39411CA2CEA /* main.m */,
+ 8E785FCA0FCDB853006EA81F /* TestBedViewController.xib */,
+ 8EB688610FA64AD100489E4B /* Support */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 8ED756FC102BADEF00AF9B7A /* MediaPlayer.framework */,
+ 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */,
+ 1D30AB110D05D00D00671497 /* Foundation.framework */,
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 8EB688610FA64AD100489E4B /* Support */ = {
+ isa = PBXGroup;
+ children = (
+ 8E3A1F080FAA199F009B0518 /* cover320x416.png */,
+ 32CA4F630368D1EE00C91783 /* HelloWorld_Prefix.pch */,
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 8E4156E80FA4EE0E0006D27C /* icon.png */,
+ 8E4156E70FA4EE0E0006D27C /* Default.png */,
+ );
+ name = Support;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1D6058900D05DD3D006BFB54 /* HelloWorld */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloWorld" */;
+ buildPhases = (
+ 1D60588D0D05DD3D006BFB54 /* Resources */,
+ 1D60588E0D05DD3D006BFB54 /* Sources */,
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = HelloWorld;
+ productName = HelloWorld;
+ productReference = 1D6058910D05DD3D006BFB54 /* HelloWorld.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloWorld" */;
+ compatibilityVersion = "Xcode 3.1";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 1D6058900D05DD3D006BFB54 /* HelloWorld */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1D60588D0D05DD3D006BFB54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8E4156E90FA4EE0E0006D27C /* Default.png in Resources */,
+ 8E4156EA0FA4EE0E0006D27C /* icon.png in Resources */,
+ 8E3A1F090FAA199F009B0518 /* cover320x416.png in Resources */,
+ 8E785FCB0FCDB853006EA81F /* TestBedViewController.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1D60588E0D05DD3D006BFB54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1D6058940D05DD3E006BFB54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Erica Sadun";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = HelloWorld_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ PREBINDING = NO;
+ PRODUCT_NAME = HelloWorld;
+ };
+ name = Debug;
+ };
+ 1D6058950D05DD3E006BFB54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = HelloWorld_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ PREBINDING = NO;
+ PRODUCT_NAME = HelloWorld;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CODE_SIGN_IDENTITY = "Erica Sadun";
+ "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ PRODUCT_NAME = "Oh Hello";
+ SDKROOT = iphoneos2.0;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ PREBINDING = NO;
+ SDKROOT = iphoneos2.0;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloWorld" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1D6058940D05DD3E006BFB54 /* Debug */,
+ 1D6058950D05DD3E006BFB54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloWorld" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
View
8 C15-Media/07b-Video Loop/HelloWorld_Prefix.pch
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'HelloWorld' target in the 'HelloWorld' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+#endif
View
26 C15-Media/07b-Video Loop/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.sadun.${EXECUTABLE_NAME}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+</dict>
+</plist>
View
180 C15-Media/07b-Video Loop/TestBedViewController.xib
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.03">
+ <data>
+ <int key="IBDocument.SystemTarget">768</int>
+ <string key="IBDocument.SystemVersion">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="32"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ </object>
+ <object class="IBProxyObject" id="843779117">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ </object>
+ <object class="IBUIView" id="440620744">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIImageView" id="1064941195">
+ <reference key="NSNextResponder" ref="440620744"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{320, 416}</string>
+ <reference key="NSSuperview" ref="440620744"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">4</int>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">cover320x416.png</string>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 416}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
+ <bool key="IBUIPrompted">NO</bool>
+ </object>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="440620744"/>
+ </object>
+ <int key="connectionID">33</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="884947135">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="884947135"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="843779117"/>
+ <reference key="parent" ref="884947135"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">32</int>
+ <reference key="object" ref="440620744"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1064941195"/>
+ </object>
+ <reference key="parent" ref="884947135"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">34</int>
+ <reference key="object" ref="1064941195"/>
+ <reference key="parent" ref="440620744"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>32.IBEditorWindowLastContentRect</string>
+ <string>32.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>TestBedViewController</string>
+ <string>UIResponder</string>
+ <string>{{21, 492}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">34</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">TestBedViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">view</string>
+ <string key="NS.object.0">UIView</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">HelloWorld.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">3.1</string>
+ </data>
+</archive>
View
BIN C15-Media/07b-Video Loop/cover320x416.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN C15-Media/07b-Video Loop/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
66 C15-Media/07b-Video Loop/main.m
@@ -0,0 +1,66 @@
+/*
+ Erica Sadun, http://ericasadun.com
+ iPhone Developer's Cookbook, 3.0 Edition
+ BSD License, Use at your own risk
+ */
+
+#import <UIKit/UIKit.h>
+#import <MediaPlayer/MediaPlayer.h>
+
+#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]
+#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
+
+// Offsite resource Silence short @Archive.org
+#define PATHSTRING @"http://www.archive.org/download/silence/silence_512kb.mp4"
+
+@interface TestBedViewController : UIViewController
+@end
+
+@implementation TestBedViewController
+-(void)myMovieFinishedCallback:(NSNotification*)aNotification
+{
+ MPMoviePlayerController* theMovie=[aNotification object];
+ [theMovie play];
+ // [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
+ // self.navigationItem.rightBarButtonItem = BARBUTTON(@"Play", @selector(play:));
+ // self.title = nil;
+ // [self play:nil];
+}
+
+- (void) play: (UIBarButtonItem *) bbi
+{
+ self.navigationItem.rightBarButtonItem = nil;
+ self.title = @"Contacting Server";
+ MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:PATHSTRING]];
+ // theMovie.movieControlMode = MPMovieControlModeVolumeOnly;
+ // theMovie.backgroundColor = [UIColor blackColor];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
+ [theMovie play];
+}
+
+- (void) viewDidLoad
+{
+ self.navigationController.navigationBar.tintColor = COOKBOOK_PURPLE_COLOR;
+ self.navigationItem.rightBarButtonItem = BARBUTTON(@"Play", @selector(play:));
+}
+@end
+
+@interface TestBedAppDelegate : NSObject <UIApplicationDelegate>
+@end
+
+@implementation TestBedAppDelegate
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+ UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[TestBedViewController alloc] init]];
+ [window addSubview:nav.view];
+ [window makeKeyAndVisible];
+}
+@end
+
+int main(int argc, char *argv[])
+{
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, @"TestBedAppDelegate");
+ [pool release];
+ return retVal;
+}
View
2 C17-CoreLocation/09-Geocoding/main.m
@@ -15,7 +15,7 @@
#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]
#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
#define API_KEY @"YOUR API KEY HERE" // please use your own API key, not mine
-#define LOCATIONS [NSArray arrayWithObjects:@"White House", @"Big Chicken", @"LA Zoo", @"Big Hot Dog", @"Ray's Donuts", nil]
+#define LOCATIONS [NSArray arrayWithObjects:@"White House", @"Big Chicken", @"LA Zoo", @"Big Hot Dog", @"Randy's Donuts", nil]
#define PIC_SIZE 32.0f
@interface TestBedViewController : UIViewController <CLLocationManagerDelegate, MKMapViewDelegate>
View
3 C21-Grab Bag/README.markdown
@@ -0,0 +1,3 @@
+<h3>URL Scheme samples</h3>
+
+The samples for URL Schemes are found here: http://github.com/ars/copy-paste

0 comments on commit 5d3df10

Please sign in to comment.
Something went wrong with that request. Please try again.