Hey there! Join Readernaut.

Readernaut is a free service that lets you write reviews, keep notes, make reading lists, track your reading progress and find your friends.

Join now!

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.

Multivalue fields must have one and only one row selected, so we have to specify the default value to be used if none has been selected, and it needs to correspond to one of the items in the Values array (not the Titles array if they are different). [Use the key DefaultValue]

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.

One nice thing about the Settings application is that you don't have to design a user interface for your preferences. You create a property list defining your application's available settings, and the Settings application creates the interface for you.

January 26, 2010

Prevent a selected row from being highlighted (while still selectable):

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}

By conforming to UITextFieldDelegate, we'll be notified when a user make a change to a text field so that we can save the field's value. […] A text field could scroll off the screen and, perhaps, be deallocated or reused. If the text field is lost, the value stored in it is lost.

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
  • indexPath tells which row is being edited (for an insert it's the index where the new row should be inserted)

Friends 1 more

  • Nathan Borror
  • Sara Flemming
  • Jeff Croft
  • Jeff Triplett
  • Keith Robinson
  • Wilson Miner
  • Kevin Tamura
  • Garrett Dimon
  • Scott Boms
  • Patrick Haney
  • Brian Ford
  • Ryan Sims
  • Bronwyn Jones
  • Shaun Inman
  • Joshua Lane
  • Regina Goodman
  • Ben Tesch
  • Tiff Fehr
  • Juliette Melton
  • James Mathias
  • Jeff Smith
  • Erik Sagen
  • Rob Weychert
  • Josh Bryant
  • Nate Klaiber
  • Steve Smith
  • Nathan Smith
  • Christopher Davis
  • Travis Gertz
  • Kyle Neath
  • Mike Davidson
  • John Nunemaker
  • Michelle Foster
  • Matthew Pennell
  • Jeremy Keith

Other profiles

Links