Re: Create a NSURL as a way to validate urls - not working
Re: Create a NSURL as a way to validate urls - not working
- Subject: Re: Create a NSURL as a way to validate urls - not working
- From: Juanjo Conti <email@hidden>
- Date: Tue, 03 Mar 2015 12:38:46 -0300
Missing return type!!! Argh... caming from Python and Ruby doesn't help.
Thanks!!!
On Tue, Mar 3, 2015 at 12:27 PM, Roland King <email@hidden> wrote:
>
> On 3 Mar 2015, at 22:42, Juanjo Conti <email@hidden> wrote:
>
> Ok, first of all thanks all for the replies.
>
> I'm trying to solve it this an util class method:
>
> import Cocoa
>
> class Utils: NSObject {
>
> class func isValidUrl(url: NSURL?) {
> var lower = url?.scheme?.lowercaseString
> return lower == "http" || lower == "https"
> }
> }
> Sadly I'm getting and error in the return line that I can't interprete:
> Cannot invoke == with argument list of type `($T4, $T8)`
>
>
>
> What I'm doing wrong?
>
>
> Using Swift :)
>
> Thanks,
>
>
> If you use the latest beta you get a slightly better error message “Bool
> is not convertible to ()”, that is one thing that version has fixed, the
> $T3 variables in error messages, which is a good step forward.
>
> That error message might lead you to realise what I didn’t from the
> original error message either, that your function definition is missing
> “->Bool” to give it a return type. Would still prefer an error message
> which directly said ‘Incorrect return type” but at least this one gave
> enough hints to figure it out.
>
>
--
Juanjo Conti <jjconti <http://goog_2023646312>@carouselapps.com
<email@hidden>>
Software Engineer - Carousel Apps <https://carouselapps.com>
--
Carousel Apps Limited, registered in England & Wales with registered number
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel
App Ltd or any of its subsidiary, holding or affiliated companies or
entities (together "Watu") is confidential and may be privileged or
otherwise protected. If you receive it in error please inform us and then
delete it from your system. You should not copy it or disclose its contents
to anyone. Messages sent to and from Watu may be monitored to ensure
compliance with our internal policies and to protect our business. Emails
are not secure and cannot be guaranteed to be error free. Anyone who
communicates with us by email is taken to accept these risks.
_______________________________________________
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