• 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: Static Analyzer and Core Foundation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static Analyzer and Core Foundation


  • Subject: Re: Static Analyzer and Core Foundation
  • From: Steve Cronin <email@hidden>
  • Date: Fri, 18 Sep 2009 19:25:08 -0500

Luke;

I've adapted the code to accomodate your's and Chris' answer to question 2.

Here's the entire method, which now shows not static analyzer issues but I still would like to understand why not.

+ (NSDictionary *)metadataForFilePath:(NSString *)thisPath {
	NSDictionary *md = [NSDictionary dictionary];
	if (![[NSFileManager defaultManager] fileExistsAtPath:thisPath]) {
		NSLog(@"file does not existl");
	} else {
		MDItemRef mdi = MDItemCreate( nil, (CFStringRef)thisPath );
		if  ( mdi != nil )  {
			CFArrayRef arrayRef = MDItemCopyAttributeNames(mdi);
			CFDictionaryRef dictRef = MDItemCopyAttributes( mdi, arrayRef);
			md = [NSDictionary dictionaryWithDictionary:(NSDictionary *)dictRef];
			CFRelease(dictRef);
			CFRelease(arrayRef);
		} else {
			NSLog(@"mdi is nil");
		}
	}
	return md;
}

Is this the 'best' this can be?
Thanks for helping me learn,
Steve

On Sep 18, 2009, at 6:44 PM, Luke the Hiesterman wrote:

There's not enough code here to give a good answer to question 1.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Static Analyzer and Core Foundation
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: Static Analyzer and Core Foundation
      • From: Jens Alfke <email@hidden>
References: 
 >Static Analyzer and Core Foundation (From: Steve Cronin <email@hidden>)
 >Re: Static Analyzer and Core Foundation (From: Luke the Hiesterman <email@hidden>)
 >Re: Static Analyzer and Core Foundation (From: Steve Cronin <email@hidden>)
 >Re: Static Analyzer and Core Foundation (From: Luke the Hiesterman <email@hidden>)

  • Prev by Date: Re: Static Analyzer and Core Foundation
  • Next by Date: Re: NSString vs. encoding
  • Previous by thread: Re: Static Analyzer and Core Foundation
  • Next by thread: Re: Static Analyzer and Core Foundation
  • Index(es):
    • Date
    • Thread