• 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: removeItemAtPath in 10.7
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: removeItemAtPath in 10.7


  • Subject: Re: removeItemAtPath in 10.7
  • From: Conrad Shultz <email@hidden>
  • Date: Wed, 26 Aug 2015 09:45:35 -0700

> On Aug 26, 2015, at 8:11 AM, sqwarqDev <email@hidden> wrote:
>
> I built my app in Xcode 6.4 on 10.10.5.
>
> Runs without issue on Yosemite and Mavericks. However, when I boot into Lion 10.7, I get an “unrecognized selector” error on the “removeItemAtPath” line. Here’s the snippet"
>
> NSError *err;
>    int i;
>    for (i=0; i < offendersList.count; i++)
>    {
>
>        NSString *thisPath = offendersList[i];
>
>        [[NSFileManager defaultManager] removeItemAtPath:thisPath error:&err];
>
>        if (!err)
> 	{
> 		//blah blah
>
> Anybody got any idea why this is objectionable in Lion but not in Mavericks +? The headers indicate removeItemAtPath is good to go from 10.5 onwards.

It’s not immediately obvious to me why you’d get such an error. Could you post the actual error and backtrace?

Note, though, that it is incorrect to check for errors in this manner. In Cocoa, the value of the error out parameter is not guaranteed in the success case. You should test the return value of -removeItemAtPath:error: (or, better yet, -removeItemAtURL:error:) and, only if the value is NO, then inspect the error.

-Conrad
_______________________________________________

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


References: 
 >removeItemAtPath in 10.7 (From: sqwarqDev <email@hidden>)

  • Prev by Date: Re: NSSegmentedControl & NSSegmentStyleSeparated & autolayout
  • Next by Date: Auto Layout and XCode/IB Warnings
  • Previous by thread: removeItemAtPath in 10.7
  • Next by thread: Re: removeItemAtPath in 10.7
  • Index(es):
    • Date
    • Thread