我是swift的新手
我正在尝试将项目附加到infopacks数组,但不知何故没有项目添加到数组中
import UIKit
class Tag: NSObject {
var id:Int?
var infopacks = [InfoPack]()
init(tag :AnyObject)
{
self.id = (tag["id"] as NSNumber).integerValue
if(tag["infopacks"] != nil)
{
var tmpInfopackArr:NSMutableArray = tag["infopacks"] as NSMutableArray
if(tmpInfopackArr.count>0)
{
for index in 0...tmpInfopackArr.count - 1
{
var infopack:InfoPack = InfoPack(infopack: tmpInfopackArr[index])
**self.infopacks.append(infopack)**
}
}
}
}
}
非常欢迎任何帮助或建议