Stuck in Swift
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