Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
Improve documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielctull committed Jan 8, 2011
1 parent 9597016 commit 06f7f77
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 23 deletions.
11 changes: 11 additions & 0 deletions DTResurrectionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,22 @@ extern NSString *const DTResurrectionKitPathDebug;

}

/**
*/
@property (nonatomic, assign) BOOL hasResurrected;


/**
*/
@property (nonatomic, assign) BOOL debugMode;

//- (IBAction)loadResurrection:(id)sender;
//- (IBAction)saveResurrection:(id)sender;

/**
@param path
*/
- (void)resurrectWithArchivePath:(NSString *)path;

@end
10 changes: 8 additions & 2 deletions DTResurrectionKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@
from the resurrection system.
*/
@protocol DTResurrection
/** @brief Initialiser DTResurrectionKit uses to restore the object.



/** Initialiser DTResurrectionKit uses to restore the object.
As shown in DTResurrector, you can save
@param resurrector The resurrector doing the restoration.
*/
- (id)initWithResurrector:(DTResurrector *)resurrector;

/** @brief Method DTResurrectionKit uses to save the object metadata.


/** Method DTResurrectionKit uses to save the object metadata.
@param resurrector The resurrector doing the saving.
*/
- (void)encodeToResurrector:(DTResurrector *)resurrector;
@end


#import "DTResurrector.h"
#import "DTResurrectionController.h"

Expand Down
47 changes: 26 additions & 21 deletions DTResurrector.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,54 +40,59 @@
NSArray *modalViewControllerParents, *modalViewControllerChildren;
}

@property (nonatomic, retain, readonly) NSArray *modalViewControllerParents, *modalViewControllerChildren;
@property (nonatomic, retain, readonly) NSArray *modalViewControllerParents;
@property (nonatomic, retain, readonly) NSArray *modalViewControllerChildren;

- (void)viewController:(UIViewController *)parentVC unpackedModalViewController:(UIViewController *)childVC;


/** Used to test if an the given object is a core object within resurrection kit.
Core objects in the system are currently members of the classes NSNumber, NSString, NSData and NSDate.
If you want to store any other type of object, you will need to implement the initWithResurrector: and
encodeToResurrector: methods from the DTResurrection protocol.
The reason the list of core objects is not the same as any object that conforms to NSCoding is that the
resurrection system keeps a reference of the objects it is saving, and if it comes across the same object
again, it won't need to query it again, and instead will use the existing refernce.
@param object The object to test.
@return YES if the object is a core object, NO if not.
*/
- (BOOL)objectIsCoreObject:(id)object;

/** @name Convert graph hierarchy
@{
*/
/** @brief Encodes the graph hierarchy starting at the given object.
/// @name Convert graph hierarchy

/** Encodes the graph hierarchy starting at the given object.
@param object The root object of the graph.
return A dictionary representing the object graph.
@return A dictionary representing the object graph.
*/
- (NSDictionary *)deconstructWithRootObject:(NSObject<DTResurrection> *)object;

/** @brief Restores a graph hierarchy using a dictionary representation.
@param dictionary A dictionary representing the object graph.
return The root object of the graph.
@return The root object of the graph.
*/
- (id)resurrect:(NSDictionary *)dictionary;


/**
@}
*/

/** @name Storing values
@{
*/
/// @name Storing values

/** @brief Use to save metadata about the object.
/** Use to save metadata about the object.
@param object The object to be saved.
@param key The key to identify the object.
*/
- (void)setObject:(id)object forKey:(NSString *)key;

/** @brief Use to retrive metadata about the object.


/** Use to retrive metadata about the object.
@param key The key to identify the object.
*/
- (id)objectForKey:(NSString *)key;

/**
@}
*/

@end

0 comments on commit 06f7f77

Please sign in to comment.