NSURL Does Not Honor NSURLHasHiddenExtensionKey When I set it via -setResourceValue:forKey:error:

I set the value of NSURLHasHiddenExtensionKey. I provide a textfield to rename a file and I set this flag based on whether the user has deleted or left on the path extension.

So -setResourceValue:forKey:error: returns YES, does not populate the error, but does not honor the value I just set it to.

I'm always setting it off the main thread on the same serial queue. Works the first time I rename the file then it just starts failing (silently).

For example:

	
		NSError *setError = nil;
		if ([theURL setResourceValue:@(NO) forKey:NSURLHasHiddenExtensionKey error:&setError])
		{
			[theURL removeAllCachedResourceValues];
			NSNumber *freshRead = nil;
			NSError *getError = nil;
			if ([theURL getResourceValue:&freshRead forKey:NSURLHasHiddenExtensionKey error:&getError])
			{
				if (freshRead.boolValue)
				{
					NSLog(@"it is yes when it should be NO.");
				}
			}
			if (getError != nil)
				{
					NSLog(@"Get error: %@",getError);
				}
		}
		if (setError != nil)
			{
			NSLog(@"Set error: %@",setError);
		}

While I get that it is possible for there to be other apps setting this value at the same time as my app, doesn't really seem possible in my local environment right now.

No errors log out but "it is yes when it should be NO." does log out.

The NSURL resource value for keys saga continues. This API continues to haunt me.

NSFileManager -setAttributes:ofItemAtPath:error: works though. That's a couple hours I won't get back aye!

NSURL Does Not Honor NSURLHasHiddenExtensionKey When I set it via -setResourceValue:forKey:error:
 
 
Q