diff options
author | Teddy Wing | 2018-09-05 19:14:44 +0200 |
---|---|---|
committer | Teddy Wing | 2018-09-05 19:14:44 +0200 |
commit | 83b7beb0c532a199e606d7ba05ffc38ea7e2cd7f (patch) | |
tree | 4bfebe98fff910cf4c9f01722a517696f5ebafd4 | |
parent | da31291a965ea898a59a0859c7e455144eaea195 (diff) | |
download | Copy-Mailto-83b7beb0c532a199e606d7ba05ffc38ea7e2cd7f.tar.bz2 |
saveDefaultURLHandler: Simplify `CFStringRef` creation
Turns out `CFStringRef` can be "toll-free bridged" with `NSString`,
allowing us to simplify the call.
-rw-r--r-- | CopyMailto/DefaultURLHandler.m | 8 |
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); |