Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

CFRelease call manually ! SOS!

$
0
0

Hey,

I have problem getting finder comment value on file .... Sometimes application user cashed comment... (shows old one) . Here is my code :

            var fileURL = NSUrl.FromFilename (imgPath);
            var mMDItemRef = MDItemCreateWithURL (IntPtr.Zero, fileURL.Handle);
            var mCFTypeRef = MDItemCopyAttribute (mMDItemRef, new CFString ("kMDItemFinderComment").Handle);
            var finderComment = NSString.FromHandle (mCFTypeRef);
            fileURL = null;

            return finderComment;

While searching I found the example:

StringRef comment = MDItemCopyAttribute(item,kMDItemFinderComment);
if (comment)
{
[metadata setObject:(NSString*)comment forKey:@comment];
CFRelease(comment);
}

what I messing is to call CFRelease ... but have no idea how to use it in xamarin....

Any help?


Viewing all articles
Browse latest Browse all 1429

Latest Images

Trending Articles



Latest Images