Answer the question
In order to leave comments, you need to log in
How to get the comments of a file from NSURL?
On macOS, you can write a comment for each file. For example in GetInfo.
With method:
NSDate *date = nil;
[url getResourceValue:&date forKey:NSURLCreationDateKey error:nil];
NSFileManager
:[[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil] fileSize];
Answer the question
In order to leave comments, you need to log in
NSMetadataItem *originalFileMetadata = [[NSMetadataItem alloc] initWithURL:[NSURL URLWithString:@"file/path"]];
NSString * comment = [originalFileMetadata valueForAttribute:@"kMDItemFinderComment"];
NSLog(@"%@ ", comment);
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Headers/MDItem.h
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question