• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Converting to Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting to Swift


  • Subject: Converting to Swift
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Mon, 11 Aug 2014 15:35:21 +0700

I am trying to convert:
	NSString * helperName = @"de.mdenkmann.Xpc-Exchange”;
	CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLaunchd, (__bridge CFStringRef)helperName );
	NSDictionary *jobDict = (NSDictionary *)CFBridgingRelease(diref);
	if ( jobDict == nil ) need to start the helper

to Swift:
	let name = xpcServiceName!
	let diref = SMJobCopyDictionary( kSMDomainSystemLaunchd, name )
but get an error for name: "'NSString' is not a subtype of 'CFString'"

	let cref = CFString(name) → error:  'CFString' cannot be constructed because it has no accessible initializers

How to get a CFString?

Gerriet.


_______________________________________________

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


  • Follow-Ups:
    • Re: Converting to Swift
      • From: Bavarious <email@hidden>
  • Prev by Date: Re: Obtaining baseline from CATextLayer
  • Next by Date: Re: Converting to Swift
  • Previous by thread: Re: NSTableRowView appearance when group rows float - SOLVED
  • Next by thread: Re: Converting to Swift
  • Index(es):
    • Date
    • Thread