0

If I simply download the starter project, open it in xcode 6.3, update the setApplicationID line and run it, as it says to on the Quickstart screens, i get the error

Cannot invoke 'subscribeToChannelInBackground' with an argument list of type '(String, block: (Bool, NSError!) -> Void)'

in AppDelegate.swift.

Is there a problem with the latest version of Swift or/and Xcode or have I missed something?

siegy22
  • 4,295
  • 3
  • 25
  • 43
Charlbury
  • 13
  • 3
  • This is something about swift 1.2 The optionals changed.. I think the error is optional (NSError?) – siegy22 Apr 18 '15 at 17:13

1 Answers1

1

As RaVeN said, NSError has been changed in Swift 1.2 to be optional. Therefore, go to where the error is happening, the subscribeToChannelInBackground.

Change this:

        PFPush.subscribeToChannelInBackground("", block: { (succeeded: Bool, error: NSError!)

To this:

        PFPush.subscribeToChannelInBackground("", block: { (succeeded: Bool, error: NSError?)

You should be able to compile now without problem.

Michael Lee
  • 698
  • 5
  • 13