Brett Park from Shiverware / Saskatchewan iOS (SKiOS.ca)
Aug 19, 2012
July 28, 2012
Use git from the get go. (Bitbucket as a suggestion).
Click on the project name to edit Build Settings, Icons, Splashs
No memory management (As of iOS 5)
Auto Setters/Getters (Properties)
Option Click on class names or methods
Command Click on class names or methods
Refactor
Command-Ctrl-Up - Switch between header and implementation
Command-Ctrl-Left/Right - Switch between previous and current location
Quickly Open Command-Shift-o
https://github.com/Machx/Xcode-Keyboard-Shortcuts
http://www.cocoanetics.com/2011/11/amazing-apple-like-documentation/
http://www.jetbrains.com/objc/
https://github.com/github/objective-c-conventions
Typical way of persisting settings
//Saving
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
// saving an NSString
[prefs setObject:@"TextToSave" forKey:@"keyToLookupString"];
// saving an NSInteger
[prefs setInteger:42 forKey:@"integerKey"];
// Write changes to plist
[prefs synchronize];
Retrieving
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
// getting an NSString
NSString *myString = [prefs stringForKey:@"keyToLookupString"];
// getting an NSInteger
NSInteger myInt = [prefs integerForKey:@"integerKey"];
[prefs setObject:@"TextToSave" forKey:@"keyToLookupString"];
#import "Settings.h"
@interface CurrentSettings : NSObject
+ (void)initialize;
+ (CurrentSettings *) shared;
+ (Settings *) settings;
-(void) saveSettings;
-(void) saveSettingsAs:(NSString *) settingsName;
-(NSArray *) savedSettingsNames;
-(BOOL) loadSettingsWithName:(NSString *) settingName;
-(void) deleteSettings:(NSString *) settingName;
-(BOOL) currentSettingsAreModified;
@property (retain) Settings * settings;
@end
//Define key names with static strings
#define kNOTE_COLORING_KEY @"noteColoring"
//This method gets called when being saved
- (void)encodeWithCoder:(NSCoder *)encoder
//Save the object with a static key
[encoder encodeObject:self.noteColoring forKey:kNOTE_COLORING_KEY];
//This is called when the object is initialized
- (id)initWithCoder:(NSCoder *)decoder
//Detects the value and sets from storage or initialization
if ([decoder containsValueForKey:kNOTE_COLORING_KEY])
self.noteColoring = [decoder decodeObjectForKey:kNOTE_COLORING_KEY];
else
self.noteColoring = @"Scale Coloring";
//Let us know when the noteColoring is changed
[[CurrentSettings settings].layout addObserver:self forKeyPath:@"noteColoring" options:NSKeyValueObservingOptionNew context:NULL];
//This method gets called when the value changes
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
//If note coloring is changed, perform the proper method action
if ([keyPath isEqualToString:@"noteColoring"])
[self setNoteLayerStyleFormatFromString:[CurrentSettings settings].layout.noteColoring];
//Stop observing the key value
[[CurrentSettings settings].layout removeObserver:self forKeyPath:@"noteColoring"];
Tables in a Giffy. http://escoz.com/open-source/quickdialog
What to choose?
Add functionality to existing classes
@interface NSString (Formatting)
- (NSString*) firstFiveLetters;
@end
Add instance variables with Associative References
42% of apps released on Sunday make Top 240 list
(December 19th, 2011)
http://techcrunch.com/2011/12/19/sunday-is-the-best-day-to-launch-your-mobile-app/
* More Features
* Cheaper, better interface
60% iPhone's on iOS 6 in one week
41% of iPad's updated
iOS 5? Sure
iOS 4? Not for long