Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa error 260

I keep getting this error. I'm uploading via ftp to a server. It works fine and uploads completely while running in the simulator, but when I provision it on my iPhone, it says: Error Occurred. Upload failed: The operation couldn’t be completed. (Cocoa error 260.)

Any suggestions? I've been debugging and researching for hours on end and can't figure this out. I've tried cleaning targets, resetting device, resetting xcode.

One thing I narrowed down was:

NSError *attributesError = nil; NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.filePath error:&attributesError]; if (attributesError) {     [self failWithError:attributesError];     return; } 

In the device attributesError is true, in the simulator it is false

like image 457
Chris Avatar asked Feb 02 '11 01:02

Chris


People also ask

What does Nscocoaerrordomain mean?

This error means that the directory cannot be created because of a permission error.

What is made up of NSError object?

The core attributes of an NSError object are an error domain (represented by a string), a domain-specific error code and a user info dictionary containing application specific information.

What is NSError in Swift?

Information about an error condition including a domain, a domain-specific error code, and application-specific information.


1 Answers

I've tried cleaning targets, resetting device, resetting xcode.

Blind pounding on random targets is never a good debugging technique. At best, you'll fix the problem and not know how. At worst, you'll break something else.

Instead, find out what the problem is. For a “Cocoa error”, you'll want to look in FoundationErrors.h and CoreDataErrors.h (and AppKitErrors.h when not targeting Cocoa Touch). The former file gives the name for Cocoa error 260:

NSFileReadNoSuchFileError = 260,                        // Read error (no such file) 

You're unable to get the attributes of that file because it doesn't exist (on your device).

You may want to edit your question to include the code that creates the path that you store into self.filePath.

like image 133
Peter Hosey Avatar answered Sep 19 '22 15:09

Peter Hosey