NNTagging Reference Library

NNTagging Class Reference

NNTagging Class Reference

Inherits from
Declared in NNTagging.h

Overview

Treat this class as a very simple facade to NNTagging.framework with additional helper methods. It provides a synchronous way for searching tagged objects, a way to batch create the tag folder directory structure, a method to clean up the tag DB...

NNTag uses this class when executing taggedObjects.

Tasks

Class Methods

tagging

+ (NNTagging *)tagging
Return Value

Default instance

Declared In
NNTagging.h

Instance Methods

taggedObjectsForTag:

- (NSArray *)taggedObjectsForTag:(NNTag *)tag
Parameters
tag

Tag to search for

Return Value

Tagged objects for tag

Discussion

Searches for objects with tag.

Declared In
NNTagging.h

taggedObjectsForTags:

- (NSArray *)taggedObjectsForTags:(NSArray *)tags
Parameters
tags

Tags to search for

Return Value

Tagged objects for tags

Discussion

Searches for objects with tags.

Declared In
NNTagging.h

allTaggedObjects

- (NSArray *)allTaggedObjects
Return Value

All tagged objects

Discussion

Searches for every object tagged by Punakea.

Declared In
NNTagging.h

relatedTagsForTags:

- (NSArray *)relatedTagsForTags:(NSArray *)tags
Parameters
tags

Tags to get related tags for

Return Value

Tags related to given tags

Discussion

For a given array of tags, returns the tags that are related to them. Tags are related when they are on the same files as the given ones.

Declared In
NNTagging.h

associatedTagsForTags:

- (NSArray *)associatedTagsForTags:(NSArray *)tags
Parameters
tags

Tags to find strongly associated tags for

Return Value

Highly associated tags

Discussion

For a given array of tags, find tags that are strongly associated. These tags are good candidates for suggesting additional tags. Tags are strongly associated if they often occur together with the given tags on the same files/tagged objects

Declared In
NNTagging.h

updateTagRules:

- (void)updateTagRules:(NSArray *)rules
Parameters
rules

Tag association rules

Discussion

Use to set the available tag association rules.

Declared In
NNTagging.h

cleanTagsFolder

- (void)cleanTagsFolder
Discussion

Deletes all folders in tagsFolder corresponding to Punakea tags. Leaves all other folder content intact

Declared In
NNTagging.h

removeTagsFolder

- (void)removeTagsFolder
Discussion

Deletes tagsFolder - use with caution!

Declared In
NNTagging.h

createDirectoryStructure

- (void)createDirectoryStructure
Discussion

Calls createDirectoryStructureWithPrecedingCleanung:NO

Declared In
NNTagging.h

createDirectoryStructureWithPrecedingCleanup:

- (void)createDirectoryStructureWithPrecedingCleanup:(BOOL)cleanup
Parameters
cleanup

If YES, directorey structure will be cleaned before recreating it

Discussion

Batch creates the directory structure representing the tags and relations. the directory structure's location is set in the UserDefaults

Declared In
NNTagging.h

cleanTagDB

- (void)cleanTagDB
Discussion

Looks through all the spotlight comments and adjusts the useCount on the tags. Tags not found on any file are deleted

Declared In
NNTagging.h

tagNamesForTags:

- (NSArray *)tagNamesForTags:(NSArray *)tags
Parameters
tags

Array of NNTag objects

Return Value

Array of NSString objects (tag names)

Discussion

Helper method to extract an array of tag names from NNTag objects

Declared In
NNTagging.h

tagsForTagnames:

- (NSArray *)tagsForTagnames:(NSArray *)tagnames
Parameters
tagnames

Array of tag names (as NSString*)

Return Value

Array of NNTag objects

Discussion

Helper method to get an array of NNTag objects for tag names

Declared In
NNTagging.h

Last updated: 2010-5-13