objective-c method 'controller:didchangeobject:atindexpath:forchangetype:newindexpath:' provided method 'controller(:didchangeobject:atindexpath:forchangetype:newindexpath:)' conflicts optional requirement method 'controller(:didchangeobject:atindexpath:forchangetype:newindexpath:)' in protocol 'nsfetchedresultscontrollerdelegate'
func controller(controller: nsfetchedresultscontroller, didchangeobject anobject: nsmanagedobject, atindexpath indexpath: nsindexpath?, forchangetype type: nsfetchedresultschangetype, newindexpath: nsindexpath?) { if self.collectionview?.window == nil { return } let change = nsmutabledictionary() switch(type) { case .insert: change[nsnumber(unsignedlong:type.rawvalue)] = newindexpath case .delete: change[nsnumber(unsignedlong:type.rawvalue)] = indexpath case .update: change[nsnumber(unsignedlong:type.rawvalue)] = indexpath case .move: change[nsnumber(unsignedlong:type.rawvalue)] = nsarray(objects: indexpath!, newindexpath!) default: break } self.objectchanges?.addobject(change) }
it looks proper method signature is:
func controller(controller: nsfetchedresultscontroller, didchangeobject anobject: anyobject, atindexpath indexpath: nsindexpath?, forchangetype type: nsfetchedresultschangetype, newindexpath: nsindexpath?) { }
any easy way fix these problems allow xcode autocomplete method signature. then, replace method's signature auto generated signature. this, need type controller
when defining method see list of methods match.
Comments
Post a Comment