NSMetadataQueryResultContentRelevanceAttribute?
NSMetadataQueryResultContentRelevanceAttribute?
- Subject: NSMetadataQueryResultContentRelevanceAttribute?
- From: Steve Gehrman <email@hidden>
- Date: Sun, 26 Jun 2005 15:57:31 -0700
I can't seem to get NSMetadataQueryResultContentRelevanceAttribute
working.
I'm not even sure I'm using it right. The docs kind of blow.
Help! relevanceNum is always nil. What is wrong?
- (NSArray*)results;
{
[[self query] disableUpdates];
unsigned i, cnt = [[self query] resultCount];
NSMetadataItem* item;
NSString* path;
NTFileDesc* desc;
NSMutableArray* results = [NSMutableArray arrayWithCapacity:cnt];
float relevance;
for (i=0;i<cnt;i++)
{
item = [[self query] resultAtIndex:i];
path = [item valueForAttribute:(NSString*)kMDItemPath];
NSNumber* relevanceNum = [item
valueForAttribute:NSMetadataQueryResultContentRelevanceAttribute];
relevance = 1.0;
if (relevanceNum) // ### alway nil !!!!!!!!!!!!!!!!
relevance = [relevanceNum floatValue];
if (path)
{
desc = [NTFileDesc descNoResolve:path];
[results addObject:[NTFindResult result:desc
relevance:relevance]];
}
}
[[self query] enableUpdates];
return results;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden