Parse SDK 1.7.1 does not work in Xcode 6.3

My code worked fine in Xcode 6.2. After upgrading to Xcode 6.3, I had some Nullabilty errors.

I could solve these errors after downloading Parse SDK 1.7.1. Therefore, I deleted the old Parse framework files in my project and inserted new ones into it. Additionally, I will convert my code into the latest fast syntax "Edit / Convert / Last Fast Syntax". Now I have no problem with Nullabilty errors, but a few others. In my project, I have a simple Tableviewcontroller with the following code:

import UIKit class HaendlerTableViewController: PFQueryTableViewController { // Initialise the PFQueryTable tableview override init!(style: UITableViewStyle, className: String!) { //1. Falialbe initialize init/style:className:)' cannot override a non-failable initializer super.init(style: style, className: className) } required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder) // Configure the PFQueryTableView self.parseClassName = "Haendler" self.textKey = "name" self.pullToRefreshEnabled = true self.paginationEnabled = false } // Define the query that will provide the data for the table view override func queryForTable() -> PFQuery! { //2. Ovverriding method with selector queryForTable has incompatitble typ () -> PFQuery var query = PFQuery(className: "Haendler") query.orderByAscending("name") return query } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject) -> PFTableViewCell { //3. Ovverriding method with selector 'tableView:cellForRowAtindexPath:object:' has incompatible type '(UITableView, NSIndexPath, PFObject) -> PFTableViewCell var cell = tableView.dequeueReusableCellWithIdentifier("HaendlerCell") as! HaendlerCell! if cell == nil { cell = HaendlerCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell") } // Extract values from the PFObject to display in the table cell cell.haendlerName.text = object["name"] as! String! var thumbnail = object["logo"] as! PFFile var initialThumbnail = UIImage(named: "haendler") cell.haendlerBild.image = initialThumbnail cell.haendlerBild.file = thumbnail cell.haendlerBild.loadInBackground() return cell } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { var detailScene = segue.destinationViewController as! HaendlerDetailViewController // Pass the selected object to the destination view controller. if let indexPath = self.tableView.indexPathForSelectedRow() { let row = Int(indexPath.row) detailScene.currentObject = objects[row] as? PFObject //4. Could not find an overload for 'subscript' that accepts the supplied agruments } } } 

I wrote errors in the comments on the right side of the code and below.

  • Falialbe initializes init / style: className :) 'cannot override initializer without fail
  • Ovverriding method with queryForTable selector has incompatible type () -> PFQuery
  • Ovverriding method with the selector 'tableView: cellForRowAtindexPath: object:' has an incompatible type '(UITableView, NSIndexPath, PFObject) -> PFTableViewCell
  • Could not find overload for "index" that accepts provided agents

I have the same errors when I create a new Swift project from Parse Quickstart and add one Tableviewcontroller. My old project had an objective-C bridge header, which I deleted because I had the opportunity to add Parse SDK 1.7.1 directly to my Swift project.

Now I need help because I don’t see what I need to change.

PS: Sorry for the combination of German and English code. I will adjust it as soon as the project is launched.

+3
source share
2 answers

I had the same problem as I just upgraded Xcode to 6.3 about 20 minutes ago.

For your second error, remove the '!' after "PFQuery". So now it should look. override func queryForTable() -> PFQuery {

This solved my problem regarding this particular error.

I never used the init method, as in the first error, but try deleting it and see what you get. My PFQueryTableViewController works fine without it.

+1
source

There were the same problems.

To solve the first initialization problem, remove the '!' after "override init". It should look like this:

 // Initialise the PFQueryTable tableview override init(style: UITableViewStyle, className: String!) { //1. Falialbe initialize init/style:className:)' cannot override a non-failable initializer super.init(style: style, className: className) } 

Do the same for the second error after "PFQuery"

 override func queryForTable() -> PFQuery { 

Hope this will be helpful. Since the latest item deployment updates, you typically need to review for possible errors.

+1
source

All Articles