Re: Simple Swift question
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