• 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
Re: Create a NSURL as a way to validate urls - not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Roland King <email@hidden>
  • Date: Tue, 03 Mar 2015 23:27:50 +0800

> 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.

_______________________________________________

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: Create a NSURL as a way to validate urls - not working
      • From: Juanjo Conti <email@hidden>
References: 
 >Create a NSURL as a way to validate urls - not working (From: Juanjo Conti <email@hidden>)
 >Re: Create a NSURL as a way to validate urls - not working (From: Mike Abdullah <email@hidden>)
 >Re: Create a NSURL as a way to validate urls - not working (From: Juanjo Conti <email@hidden>)
 >Re: Create a NSURL as a way to validate urls - not working (From: Jens Alfke <email@hidden>)
 >Re: Create a NSURL as a way to validate urls - not working (From: Mike Abdullah <email@hidden>)
 >Re: Create a NSURL as a way to validate urls - not working (From: Juanjo Conti <email@hidden>)

  • Prev by Date: Re: Create a NSURL as a way to validate urls - not working
  • Next by Date: In app purchase payment queue update - application crash
  • Previous by thread: Re: Create a NSURL as a way to validate urls - not working
  • Next by thread: Re: Create a NSURL as a way to validate urls - not working
  • Index(es):
    • Date
    • Thread