Re: Stuck in Swift
Re: Stuck in Swift
- Subject: Re: Stuck in Swift
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 14 Aug 2014 15:51:46 +0700
On 14 Aug 2014, at 14:45, Muhammad Hussein Nasrollahpour <email@hidden> wrote:
> The problem is with your calling convention in specified line. Notice that when you call a method which is part of a class you should write the parameter name and then value.
Ok. You are right.
> class AppDelegate: NSObject
> {
> var statusString : String?
>
> let someThing = SomeClass(statusHandler: myStatusHandler)
>
> func myStatusHandler(s: String)
> {
> statusString = s
> }
> }
>
> class SomeClass
> {
> var statusHandler: (String) -> Void
>
> init( statusHandler: (String) -> Void)
> {
> self.statusHandler = statusHandler
> }
> }
>
> Now it does compile.
Well, it should, but it does not. I still get the error: 'String' is not a subtype of 'AppDelegate'
Kind regards,
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