Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8445241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:36:34+00:00 2026-06-10T09:36:34+00:00

This is purely a curiosity item — the solution turned out to be to

  • 0

This is purely a curiosity item — the solution turned out to be to check the return value instead of the error — but this code is months old, and that particular section hasn’t been a problem in the past (possibly related to the fact that this code only runs on the first-run of the app?).

I have a section of code where I copy a file from the bundle to the documents directory (a copy of JQuery for some html documents to use). The copy succeeds, but there is in fact an error returned (cocoa error 4, could not complete). Why would the function provide me with an error when it has, in fact, successfully completed?

I’m curious, at least in part, because I suspect that this indicates some major misunderstanding on my part as to how I should handle error files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:36:35+00:00Added an answer on June 10, 2026 at 9:36 am

    I have seen a lot of example code that checks if there is a nil reference for the error: argument to determine if the method was successful, this is wrong! Apple warns in the Error Handling in Cocoa Documentation that this isn’t the documented behavior. You must first check the return value of the method, if it returns an error indication you can then check the NSError reference to learn more about the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is purely out of curiosity, but why does this occur? >>> a =
This question is purely out of curiosity. I am off school for the summer,
So this question is purely for learning purposes and curiosity, but can anyone explain
This is purely hypothetical, but I'm not sure whether the following code will result
System.Diagnostics.Contracts.ContractException is not accessible in my test project. Note this code is purely myself
I would like to convert this piece of logic with purely matrix operations instead
This is a purely pedantic question, to sate my own curiosity. I tend to
I was (purely out of curiosity) trying to find out what the size of
Forewarning: a potentially silly question, purely out of curiosity. If, for example, I perform
These questions are purely asked out of curiosity. I don't actually need to subclass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.