0
prepareForSqueの次のビューコントローラにselectedFocus
を送信するにはどうすればよいですか? (または、prepareForSequeでセグメント化されたコントロールボタンのどの部分に基づいて変数を割り当てるか)"Use of unresolved identifier 'segmentedControlVariable"
は私のエラーです。あなたのthirdviewcontrollerのSegmented Control変数を準備するにはどうすればよいですか?
class SecondSignUpViewController: UIViewController {
// DECLARATIONS...
// user's focus to be sent to next view contr.
var selectedFocus = String()
// 1. LOAD IN SENT VARS (so that it exists in this view) (at top it seems oposed to in viewdidload?...)
var passedPassword_toView2:String!
var passedUsername_toView2:String!
var passedEmail_toView2:String!
@IBAction func continueButtonPressed2(sender: AnyObject) {
performSegueWithIdentifier("SegueAfterJoin2", sender: self)
}
@IBAction func indexChanged(sender: AnyObject) {
switch segmentedControl.selectedSegmentIndex {
case 0:
print("case0")
textLabel.text = "You are a music artist who needs services.";
imageShown.image = image0
selectedFocus = "artist"
case 1:
print("case1")
textLabel.text = "You want to share your talent with music artists.";
imageShown.image = image1
selectedFocus = "provider"
default:
break;
}
}
// VAR SHIFT
// GET FROM PREV. VIEW
override func viewDidLoad() {
super.viewDidLoad()
print("view 2 loaded")
// 2. (for ease,) TRANSFER TO VAR NAMES
var myLocalPassword = passedPassword_toView2
var myLocalUsername = passedUsername_toView2
var myLocalEmail = passedEmail_toView2
}
// 3. SEND VARS TO NEW VIEW
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if (segue.identifier == "SegueAfterJoin2") {
var nextViewCont = segue!.destinationViewController as! ThirdSignUpViewController;
// PASS VARS FROM THIS VIEW TO NEXT
nextViewCont.passedPassword_toView3 = passedPassword_toView2
nextViewCont.passedEmail_toView3 = passedUsername_toView2
nextViewCont.passedUsername_toView3 = passedEmail_toView2
//how can I toss this in too?
nextViewCont.passedFocus_toView3 = selectedfocus
}
}
と呼ばれるあなたが今直面している問題は何ですか?あなたは他のtoView2 varsを渡すようにselectedFocusをnextViewContに渡しますか? –
はいこれに近づける方法がわかりません –
"未解決の識別子 'segmentedControlVariable'の使用は私が得るエラーです –