Re: Can't create temporary file
Re: Can't create temporary file
- Subject: Re: Can't create temporary file
- From: Fritz Anderson <email@hidden>
- Date: Sat, 14 May 2011 12:53:37 -0500
On 14 May 2011, at 12:46 AM, Rick Mann wrote:
> NSError* err = nil;
> NSURL* tempDir = [fm URLForDirectory: NSItemReplacementDirectory
> inDomain: NSUserDomainMask
> appropriateForURL: inURL
> create: true
> error: &err];
> if (err != nil)
> {
> NSLog(@"Error creating temporary directory for URL %@: %@", inURL, err);
> return;
> }
[similar check of err later in the code]
Quincey Morris identified your problem, but you can't do this. Methods that take NSError** are entitled to fill in the error return even if they succeed. Always check the principal return value (tempDir being nil, here) and _then_ you'll know that the NSError represents the actual description of a problem.
— F
_______________________________________________
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