Activity timeline
February 21, 2010
Notification is a lightweight mechanism to communicate between objects.
- can have one or more notifications
- notifications are indications an event has happened
February 20, 2010
Every application gets its own /Documents folder, and applications are only allowed to read and write from their own /Documents directory.
Here's some code to retrieve the path to the Documents directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
The constant NSDocumentDirectory says we are looking for the path to the Documents directory. The second constant, NSUserDomainMask, indicates that we want to restrict our search to our application's sandbox.
February 7, 2010
When you create your own child settings views, the easiest way to do it is to make a copy of Root.plist and give it a new name. Then delete all of the existing preference specifiers except the first one, and add whatever preference specifiers you need to that new file.
Sliders allow placement of a small 21-pixel × 21-pixel image at each end of the slider.
If we had not supplied the option FalseValue and TrueValue items, we would create a new row with a key of DefaultValue and change the type from String to Boolean. however, because we did add those two items [FalseValue & TrueValue], the value we put in DefaultValue has to match either the value passed in TrueValue or the one passed in FalseValue.
January 28, 2010
PSGroupSpecifier is used to indicate that this item represents the start of a new group. Each item that follows will be part of this group until the next Type of PSGroupSpecifier.
In addition to Dictionary nodes, which allow you to store other nodes under a key, there are also Array nodes, which store an ordered list of other nodes similar to an NSArray. The Dictionary and Array types are the only property list node types that can contain other nodes. There are also a number of other node types designed to hold data. The data node types are Boolean, Data, Date, Number, and String.
The Settings application bases the display of preferences for a given application on the contents of the settings bundle inside that application. Each settings bundle must have a property list, called Root.plist, which defines the root level preferences view. […]
If we want our preferences to include any subviews, we have to add additional property lists to the bundle and add an entry to Root.plist for each child view.
January 26, 2010
Prevent a selected row from being highlighted (while still selectable):
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
return nil;
}
January 21, 2010
method to delete/insert a row in a table
- (void)tableView:(UITableView )tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath )indexPath
first argument is the table view to which the row belongs
second argument (
editingStyle) tells what kind of edit was made-
UITableViewCellEditingStyleNone: indicates row can't be edited -
UITableViewCellEditingStyleDelete: default option -
UITableViewCellEditingStyleInsert: inserts a new row at a specific spot in a list
-
indexPathtells which row is being edited (for an insert it's the index where the new row should be inserted)































