• 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: Swift Autocomplete and closures
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift Autocomplete and closures


  • Subject: Re: Swift Autocomplete and closures
  • From: John Tsombakos <email@hidden>
  • Date: Mon, 09 Mar 2015 22:10:17 -0400

Well, I just tried with the newly released Xcode 6.2, and still the editor does not recognize the passed in variables to the block. I’m trying to find another call that has a completion handler to see if it’s just this call or is a bigger problem.


On Mar 5, 2015, at 7:09 PM, John Tsombakos <email@hidden> wrote:


On Thu, Mar 5, 2015 at 1:54 PM, Fritz Anderson <email@hidden> wrote:
On 5 Mar 2015, at 6:24 AM, John Tsombakos <email@hidden> wrote:

I entered this line of code:

        let task = session.dataTaskWithRequest(request, completionHandler: { (myData, myResponse, myError) -> Void in

        });

and when I go to write code in the completion handler block, Xcode does not recognize the variables that are being passed in - in this case myData, myResponse and myError.

Ami I doing something wrong, or does XCode just not know how to do this?

Quincey’s advice is sound as to the coding style. Let me embarrass myself once again; I’m working my way up to total humiliation, which gets you BOGO on all Developer Programs renewals and the exemption of your choice from the app-review guidelines:

My experience is that when the compiler claims not to recognize a function parameter, it’s because something up the chain isn’t unwrapped (such as session, here).



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Swift Autocomplete and closures
      • From: Chris Lattner <email@hidden>
References: 
 >Swift Autocomplete and closures (From: John Tsombakos <email@hidden>)
 >Re: Swift Autocomplete and closures (From: Fritz Anderson <email@hidden>)
 >Re: Swift Autocomplete and closures (From: John Tsombakos <email@hidden>)
 >Re: Swift Autocomplete and closures (From: John Tsombakos <email@hidden>)

  • Prev by Date: Re: developer.apple.com/downloads — me or everybody?
  • Next by Date: Re: Swift Autocomplete and closures
  • Previous by thread: Re: Swift Autocomplete and closures
  • Next by thread: Re: Swift Autocomplete and closures
  • Index(es):
    • Date
    • Thread