ios - Using Object Initializers in Swift to replace AllocWithZone -


i updated xcode xcode 7 beta 4 xcode 7 beta 5 , began have error wasn't present before. being: "allocwithzone unavailable in swift: use object initializers instead."

here code error found:

public func copywithzone(zone: nszone) -> anyobject {     let copy = self.dynamictype.allocwithzone(zone) chartdataset     copy.colors = colors     copy.label = self.label     return copy } 

what substitute in place of ".allocwithzone" utilizes object initializer instead of obj c component?

i used this, , ios charts library works me:

let copy=self.dynamictype.initialize() as! chartdataentry 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -