• 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
Stuck in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stuck in Swift


  • Subject: Stuck in Swift
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Thu, 14 Aug 2014 14:12:06 +0700

I have a class called SomeClass which should be able to set some TextFields.
But it just does not compile.
And the error message: "'String' is not a subtype of 'AppDelegate'" while certainly true, is not too helpful.
I tried several variations, but I just can't get it to compile. Very frustrating.

Any insights would be greatly appreciated.


class AppDelegate: NSObject
{
	dynamic var statusString : String?	//	bound to some TextField

	let someThing = SomeClass( myStatusHandler )		<---- this creates strange error messages

	func myStatusHandler( s: String )
	{
		statusString = s
	}
}

class SomeClass
{
	private let statusHandler:  (String) -> Void

	init( statusHandler: (String) -> Void )
	{
        	self.statusHandler = statusHandler
    	}
}

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: Stuck in Swift
      • From: Roland King <email@hidden>
  • Prev by Date: Finder engineer needed - job opportunity
  • Next by Date: Abandoning NSDocument for an app
  • Previous by thread: Finder engineer needed - job opportunity
  • Next by thread: Re: Stuck in Swift
  • Index(es):
    • Date
    • Thread