swift總結4

1/   控件 可用 var 可用  let 

var tempTableView: UITableView = UITableView (frame: self.view.bounds, style: .Plain)


2/ 

self.zyTableView.separatorStyle = .SingleLine

self.zyTableView.separatorColor = .redColor()


3/  類方法 

    class func heros() -> NSArray{

        let bundle: NSBundle = NSBundle .mainBundle()

        let array: NSArray = NSArray (contentsOfFile: NSBundle .mainBundle() .pathForResource("heros.plist", ofType: nil)!)!

        print("打印英雄數組: %@",array)

        let arrayM: NSMutableArray = NSMutableArray ()

        for object in array{

            arrayM .addObject(ZYHero .heroWithDict(object as! NSDictionary))

        }

        return array

    }

    

    class func heroWithDict(zydictionary: NSDictionary)-> ZYHero {

        return ZYHero (zyDictionary: zydictionary)

    }

    

4/  調用類方法 

var heros: NSArray = ZYHero .heros()



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章