• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MDItemCreate very, very, very, slow -- and fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MDItemCreate very, very, very, slow -- and fails


  • Subject: Re: MDItemCreate very, very, very, slow -- and fails
  • From: Ryan Britton <email@hidden>
  • Date: Tue, 14 Feb 2006 11:46:56 -0800

nil != NULL.  Try passing NULL as the allocator instead of nil.

Parameters
allocator
The CFAllocator object to be used to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.





On Feb 14, 2006, at 11:36 AM, Doug Knowles wrote:

The code:

- (NSDictionary *)loadMetadata
{
NSDictionary *md;
NSString *path = [self valueForKey:@"uniqueIDValue"];
NSLog( @"Fetching metadata for %@", path );
MDItemRef mdi = MDItemCreate( nil, (CFStringRef)path );
if ( mdi != nil ) {
NSArray *attrNames = (NSArray *)MDItemCopyAttributeNames( mdi );
md = (NSDictionary *)MDItemCopyAttributes( mdi, (CFArrayRef) attrNames );
CFRelease(mdi);
}
else {
md = [NSDictionary dictionary];
}
return md;
}


...and some clarifications:

- The code does work properly sometimes, then starts failing.
- I call this *a lot*; it's not inconceivable that I would invoke this
on hundreds of files, so a leak (most likely on my part) could be
trouble.

Thanks,
Doug K;


What you're describing would be consistent with the framework's MIG call to mds timing out for some reason. It would be helpful if you could post a short example snippet that demonstrates this problem. If you can reproduce it, please file a Radar: <http:// bugreport.apple.com.>.

HTH,

-- Kaelin


 _______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: MDItemCreate very, very, very, slow -- and fails
      • From: Guy English <email@hidden>
References: 
 >Re: MDItemCreate very, very, very, slow -- and fails (From: Matt Neuburg <email@hidden>)
 >Re: MDItemCreate very, very, very, slow -- and fails (From: Kaelin Colclasure <email@hidden>)
 >Re: MDItemCreate very, very, very, slow -- and fails (From: Doug Knowles <email@hidden>)

  • Prev by Date: Re: MDItemCreate very, very, very, slow -- and fails
  • Next by Date: Best way to customize Cocoa
  • Previous by thread: Re: MDItemCreate very, very, very, slow -- and fails
  • Next by thread: Re: MDItemCreate very, very, very, slow -- and fails
  • Index(es):
    • Date
    • Thread