如何构造NSMutableArray的对象?

[Swift] 纯文本查看 复制代码
import UIKit

class ViewController: UIViewController {
    var timer: NSTimer!
   
    var bulletArray : NSMutableArray?
   
    var bulletImage: UIImage!
    var bulletLayer: CALayer!
   

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        bulletImage = UIImage.init(named: "bullet")
        
        bulletArray = NSMutableArray!.init(nil)
        
        print("====\(bulletArray!.count)")//----------------有问题
        
        bulletLayer = CALayer.init()
        bulletLayer.contents = bulletImage.CGImage
        bulletLayer.frame = CGRectMake(100, 300, 50, 50)
        self.view.layer.addSublayer(bulletLayer)
        
        if bulletArray != nil {
            for i in 0..<bulletArray!.count {



如何构造NSMutableArray的对象?

如何构造NSMutableArray的对象? - 敏捷大拇指 - 如何构造NSMutableArray的对象?