aboutsummaryrefslogtreecommitdiffstats
path: root/CopyMailto/DefaultURLHandler.m
diff options
context:
space:
mode:
authorTeddy Wing2018-09-05 19:14:44 +0200
committerTeddy Wing2018-09-05 19:14:44 +0200
commit83b7beb0c532a199e606d7ba05ffc38ea7e2cd7f (patch)
tree4bfebe98fff910cf4c9f01722a517696f5ebafd4 /CopyMailto/DefaultURLHandler.m
parentda31291a965ea898a59a0859c7e455144eaea195 (diff)
downloadCopy-Mailto-83b7beb0c532a199e606d7ba05ffc38ea7e2cd7f.tar.bz2
saveDefaultURLHandler: Simplify `CFStringRef` creation
Turns out `CFStringRef` can be "toll-free bridged" with `NSString`, allowing us to simplify the call.
Diffstat (limited to 'CopyMailto/DefaultURLHandler.m')
-rw-r--r--CopyMailto/DefaultURLHandler.m8
1 files changed, 1 insertions, 7 deletions
diff --git a/CopyMailto/DefaultURLHandler.m b/CopyMailto/DefaultURLHandler.m
index a8d124f..6ea69c1 100644
--- a/CopyMailto/DefaultURLHandler.m
+++ b/CopyMailto/DefaultURLHandler.m
@@ -10,14 +10,8 @@
@implementation DefaultURLHandler
-//LSSetDefaultHandlerForURLScheme();
+ (void)saveDefaultURLHandler {
- CFStringRef mailto = CFStringCreateWithCString(
- kCFAllocatorDefault,
- "mailto",
- kCFStringEncodingUTF8
- );
-
+ CFStringRef mailto = (CFStringRef)@"mailto";
CFStringRef bundle_identifier = LSCopyDefaultHandlerForURLScheme(mailto);
NSLog(@"%@", bundle_identifier);