ios - Xcode 6 Beta 4: Use of Unresolved Identifier 'NSFetchedResultsChangeInsert' -


Text after "div class =" itemprop = "text">

Installed Xcode 6 Beta 4, and it's already compiled code now 'Not resolved identifier' on every switch of NSFetchedResultsChangeType Fails with I examined the release notes, and of course to see that someone has experienced this, but nothing has come so far. ! Any information appreciated

thanks

  function controller! (Controller: NSFetchedResultsController, didChangeSection sectionInfo: NSFetchedResultsSectionInfo, atIndex sectionIndex: int, forChangeType type: NSFetchedResultsChangeType) {println ("Running CordetTV.V. controllerDidChangeSection") Switch type {Case NSFetchedResultsChangeInsert: self.tableView.insertSections (NSIndexSet (index: sectionIndex) , withRowAnimation: Fade) case NSFetchedResultsChangeDelete: self.tableView.deleteSections (NSIndexSet (index: sectionIndex), withRowAnimation: Fade) when an enumeration  
   

NS_ENUM (NSUInteger, NSFetchedResultsChangeType) typedef {NSFetchedResultsChangeInsert = 1, NSFetchedResultsChangeDelete = 2, NSFetchedResultsChangeMove = 3, NSFetchedResultsChangeUpdate = 4};

Swift is mapped, a common prefix is ​​automatically removed from the calculated values:

  enum NSFetchedResultsChangeType: uint {remove case cases Case move case update}  

Comparing the "Use of Swift with Cocoa and Objective-C" document.

Your code should look like

  Func Controller (Controller: NSFetchedResultsController, didChangeSection section Info: NSFetchedResultsSectionInfo, atEndex Section index: Int, forChangeType type: NSFetchedResultsChangeType) {switch type {case.}: type: self.tableView.insertSections (NSIndexSet (index: sectionIndex), withRowAnimation: fade) case .Delete: self.tableView.deleteSections (NSIndexSet (index: sectionIndex), withRowAnimation: .Fade) default: return} }  

Tip: If you create a "master-detail" application in Xcode with selected "use core data" You will get Sam code which you can start.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -