不知道如何使用sstring

时间:2016-08-15 16:06:36

标签: ios swift

我不明白如何使用NSString,有人可以解决我的错误吗?

import UIKit

class ViewController: UIViewController {            

    @IBOutlet var ship: UIImageView!
    @IBOutlet var mothership: UIImageView!
    @IBOutlet var enemy: UIImageView!
    @IBOutlet var missel: UIImageView!
    @IBOutlet var lives: UILabel!
    @IBOutlet var score: UILabel!
    @IBOutlet var startb: UIButton!

    nsstring *touch;
    String *livesstring;
    nsstring *scorestring;

    nstimer *enemyMovmentTimer;
    nstimer *missileMovemmentTimer;


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    -(IBAction)startGame:(id)sender;

    }
}

1 个答案:

答案 0 :(得分:1)

我认为这就是你要找的东西:

import UIKit

class ViewController: UIViewController {            

    @IBOutlet var ship: UIImageView!
    @IBOutlet var mothership: UIImageView!
    @IBOutlet var enemy: UIImageView!
    @IBOutlet var missel: UIImageView!
    @IBOutlet var lives: UILabel!
    @IBOutlet var score: UILabel!
    @IBOutlet var startb: UIButton!

    var touch = NSString()
    var livesstring = String()
    var scorestring = NSString()

    var enemyMovmentTimer = NSTimer()
    var missileMovemmentTimer = NSTimer()


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func startGame(sender: AnyObject) {

    }

}