Now we can jump in and write the program code to implement this method as follows:
Start by putting a comment in the
NewDefaults.m
file that describes the method in plain English:/* This method will execute the command line tool defaults to read a value from a domain for a specific key Input: a_domain - a reverse domain id for the defaults to read a_key - a key value to read Output: Either the string value of the result or Nil if there is no value to return. */
The method needs to match the interface from the
.h
file. So now we can add the function body to the.m
file. Note the opening and closing braces that delimit the start and the end of the method. The implementation of the method will appear between these braces as shown in the following code snippet:- (NSString *) readDefaults...