Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NSURL stringByDeletingPathExtension] creates 2 nested URL instances #110

Closed
nickasd opened this issue Jun 23, 2019 · 1 comment
Closed
Assignees

Comments

@nickasd
Copy link

nickasd commented Jun 23, 2019

http://swiftify.me/as38zd

@tomattoz
Copy link
Collaborator

@nickasd, you initial code is wrong.

Objc (initial, "stringByDeletingPathExtension" is member of NSString, not NSURL):
[NSURL fileURLWithPath:@"/Users/me/asd.txt"].stringByDeletingPathExtension;

Objc (right):
@"/Users/me/asd.txt".stringByDeletingPathExtension;

Swift:
URL(fileURLWithPath: "/Users/me/asd.txt").deletingPathExtension().absoluteString

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants