閲覧ありがとうございます!
早速質問なんですが、他のファイルの変数の値を参照するにはどうすればいいのでしょうか?上手くできず困っています;
swift
1//AppDalegate.swift 2 3 var cnt = 0 4 5 func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) { 6 switch identifier { 7 8 case .Some(USRemainderAction.BEGIN): 9 println("出席します。") 10 11 cnt = cnt + 1
このようにAppDalegate.swiftファイル(↑)で宣言したcntという変数を、
swift
1//ViewController.swift 2 3//ボタン 4 button.tag = 11 5 button.setTitle("出席回数:\(cnt)", forState: .Normal)
ViewController.swiftでボタンのタイトルにAppDalegete.swiftで宣言した変数cntを用いて表示したいんです。が上手く持ってこれません。こういうときどうすればいいんでしょうか?教えて下さいm(_ _)m
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/11/10 01:24
2015/11/10 03:33
2015/11/10 03:39