NMBFolderController Class Reference
NMBFolderController is an utility to help you implement a file browser. With it you can access the file system of NimbusBase, and be notified when changes happened. Basically, the files contained by NimbusBase are a subset of your files on the cloud. Once you access your cloud, the retrieved files can be browsed offline. The usage of NMBFolderController is much like NSFetchedResultsController’s.
The object that is notified when the files or file promises in this folder changed.
@property (nonatomic, weak) id<NMBFolderControllerDelegate> delegate
The folder you passed into method initWithFolder:server:.
@property (nonatomic, readonly, strong) NMBFile *folder
It has to be a folder type file, or you will get an exception.
The sections for the file promises and files.
@property (nonatomic, readonly) NSArray *sections
The objects in the sections array implement the NSFetchedResultsSectionInfo protocol. There are always two sections returned via this property. The first one contains instances of NMBPromise, which present creating and updating operations of files. Deleting and retrieving are not contained. The second section contains instances of NMBFile, which present the files not being modified. The order of files is ‘modified-recently-first’.
Returns a folder controller initialized using the given arguments.
- (instancetype)initWithFolder:(NMBFile *)folder server:(NMBServer *)server
The folder contains the files you want to retrieve.
Returns the object at the given index path in the file promises and files.
- (id)objectAtIndexPath:(NSIndexPath *)indexPath
An index path in file promises and files. If indexPath does not describe a valid index path in the fetch results, an exception is raised.
The object at a given index path in the file promises and files.
Executes the receiver’s fetch request.
- (BOOL)performFetch:(NSError **)error
If the fetch is not successful, upon return contains an error object that describes the problem.
YES if the fetch executed successfully, otherwise NO.
After executing this method, you can access the file promises and files contained in the receiver with the property sections.