NNTagging Reference Library

NNTag Class Reference

NNTag Class Reference

Inherits from
Declared in NNTag.h

Overview

Treat this class as the abstract superclass for all Tags, most of the methods are not implemented here, subclasses need to overwrite!

Tasks

Instance Methods

isEqual:

- (BOOL)isEqual:(id)other
Parameters
other

NSObject to compare to

Return Value

YES if equal; NO otherwise

Discussion

must overwrite

Declared In
NNTag.h

copyWithZone:

- (id)copyWithZone:(NSZone *)zone
Parameters
zone

NSZone to use

Return Value

copied NNTag subclass

Discussion

must overwrite

Declared In
NNTag.h

renameTo:

- (void)renameTo:(NSString *)aName
Parameters
aName

new tag name

Discussion

must overwrite

Use this method if you want to implement a tag renaming which updates the backing storage.

Declared In
NNTag.h

absoluteRating

- (CGFloat)absoluteRating
Return Value

Tag rating

Discussion

must overwrite

Tag rating should be between 0.0 and infinity.

Declared In
NNTag.h

relativeRatingToTag:

- (CGFloat)relativeRatingToTag:(NNTag *)otherTag
Parameters
otherTag

Tag to compare rating to

Return Value

Value in [0.0,1.0]

Discussion

must overwrite

Declared In
NNTag.h

remove

- (void)remove
Discussion

must overwrite

This method is called when the tag should be removed from the backing storage.

Declared In
NNTag.h

initWithName:

- (id)initWithName:(NSString *)aName
Parameters
aName

Name for the new tag

Return Value

NNTag subclass with aName

Discussion

may overwrite

Initializes the tag with the given name. It will be decomposed to its canonical mapping, i.e. diacritics are stored as separate characters.

Declared In
NNTag.h

name

- (NSString *)name
Return Value

The tag name that is represented in its decomposed form, i.e. diacritics are stored as separate characters.

Discussion

may overwrite

Declared In
NNTag.h

precomposedName

- (NSString *)precomposedName
Return Value

The tag name that is represented in its precomposed form, i.e. diacritics are stored as one single character.

Discussion

may overwrite

Declared In
NNTag.h

setName:

- (void)setName:(NSString *)aName
Parameters
aName

New tag name that will be decomposed to its canonical mapping, i.e. diacritics are stored as separate characters.

Discussion

may overwrite

Declared In
NNTag.h

setName:decompose:

- (void)setName:(NSString *)aName decompose:(BOOL)decompose
Parameters
aName

New tag name

decompose

Decompose string with canonical mapping

Discussion

may overwrite

Declared In
NNTag.h

query

- (NSString *)query
Return Value

Query for this tag in spotlight syntax

Discussion

may overwrite

Declared In
NNTag.h

negatedQuery

- (NSString *)negatedQuery
Return Value

Negated query for this tag in spotlight syntax

Discussion

may overwrite

Declared In
NNTag.h

setQuery:

- (void)setQuery:(NSString *)aQuery
Parameters
aQuery

Query in spotlight syntax

Discussion

may overwrite

Declared In
NNTag.h

taggedObjects

- (NSArray *)taggedObjects
Return Value

NNTaggableObjects array for tag

Discussion

Executes a spotlight query for the tag. Blocks the thread until results have been gathered.

Declared In
NNTag.h

lastClicked

- (NSDate *)lastClicked
Return Value

The time when this tag was most recently clicked

Discussion

may overwrite

Declared In
NNTag.h

setLastClicked:

- (void)setLastClicked:(NSDate *)clickDate
Parameters
clickDate

New last clicked date

Discussion

may overwrite

Declared In
NNTag.h

lastUsed

- (NSDate *)lastUsed
Return Value

The time when this tag was most recently assigned to a NNTaggableObject

Discussion

may overwrite

Declared In
NNTag.h

setLastUsed:

- (void)setLastUsed:(NSDate *)useDate
Parameters
useDate

New last used date

Discussion

may overwrite

Declared In
NNTag.h

clickCount

- (NSUInteger)clickCount
Return Value

How often this tag was clicked

Discussion

may overwrite

Declared In
NNTag.h

setClickCount:

- (void)setClickCount:(NSUInteger)count
Parameters
count

New click count

Discussion

may overwrite

Declared In
NNTag.h

useCount

- (NSUInteger)useCount
Return Value

How often this tag was used

Discussion

may overwrite

Declared In
NNTag.h

setUseCount:

- (void)setUseCount:(NSUInteger)count
Parameters
count

New use count

Discussion

may overwrite

Declared In
NNTag.h

incrementClickCount

- (void)incrementClickCount
Discussion

may overwrite

Increments the click count.

Declared In
NNTag.h

incrementUseCount

- (void)incrementUseCount
Discussion

may overwrite

Increments the use count.

Declared In
NNTag.h

decrementUseCount

- (void)decrementUseCount
Discussion

may overwrite

decrements the use count

Declared In
NNTag.h

writeToTagDatabase

- (BOOL)writeToTagDatabase
Return Value

YES if successful

Discussion

may overwrite

Saves tag to sql store.

Declared In
NNTag.h

removeFromTagDatabase

- (BOOL)removeFromTagDatabase
Return Value

YES if successful

Discussion

may overwrite

Removes tag from sql store.

Declared In
NNTag.h

compare:

- (NSComparisonResult)compare:(id)object
Return Value

NSComparisonResult

Discussion

may overwrite

Compares tag to another tag - by name.

Declared In
NNTag.h

Last updated: 2010-5-13