• 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: Simple Swift question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple Swift question


  • Subject: Re: Simple Swift question
  • From: Rick Mann <email@hidden>
  • Date: Mon, 29 Jun 2015 16:23:21 -0700

> On Jun 29, 2015, at 16:17 , Jens Alfke <email@hidden> wrote:
>
>
>> On Jun 29, 2015, at 3:53 PM, Rick Mann <email@hidden> wrote:
>>
>> The compiler's message was, "Could not find an overload for 'init' that accepts the supplied arguments." Could it instead say "NSURLRequst.init(URL:) does not return Optional type"?
>
> The error message looks correct to me — it's complaining about passing the variable ‘url’ (an NSURL?) to the NSURLRequest initializer (which takes a non-optional NSURL.)
>
> I don’t see any reason the compiler would complain about the return type of NSURLRequest.init, since all you’re doing is assigning it to a constant without giving a type.

I don't think so. The previous email didn't have the right example. I posted it to pastebin to preserve the formatting and show the compiler output:

	http://pastebin.com/Q7sBWBnN

url is unwrapped already, and I'm (wrongly) trying to unwrap the NSURLRequest. But it's not complaining about the arguments to NSURLRequest.init(URL:).

--
Rick Mann
email@hidden



_______________________________________________

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: Simple Swift question
      • From: Jens Alfke <email@hidden>
References: 
 >Simple Swift question (From: Rick Mann <email@hidden>)
 >Re: Simple Swift question (From: Greg Parker <email@hidden>)
 >Re: Simple Swift question (From: Rick Mann <email@hidden>)
 >Re: Simple Swift question (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Simple Swift question
  • Next by Date: Re: Why would scroll events not arrive?
  • Previous by thread: Re: Simple Swift question
  • Next by thread: Re: Simple Swift question
  • Index(es):
    • Date
    • Thread