2016-12-14 4 views
0

これまでのところ、私のSignInViewControllerのユーザー名とパスワードフィールドを完了した後です。デバッグ領域に次のメッセージを持つ信号SIGABRTエラー:スレッド1:シグナルSIGABRT( 'SignInViewController'にタイプの値を 'AWSCognitoIdentityPasswordAuthentication'にキャストできませんでした)

func startPasswordAuthentication() -> AWSCognitoIdentityPasswordAuthentication { 
     return self as! AWSCognitoIdentityPasswordAuthentication 
} 

マイSignInViewControllerExtensionsスレッド1をスローSignInViewControllerExtensionクラスから

コード:

これは、コードは次のようになります。

タイプ 'Elixr.SignIn'の値をキャストできませんでしたViewController '(0x1001460a8)から' AWSCognitoIdentityPasswordAuthentication '(0x100134468)に変更します。

答えて

0

おそらくElixr.SignInViewControllerAWSCognitoIdentityPasswordAuthenticationとして割り当てようとしています。しかし、私は実際のコードを見ずにもっと言い表すことはできません。

しかし、私はこのような何かを探すようになるだろう推測している...

let someVc = SignInViewController(args_here) as! AWSCognitoIdentityPasswordAuthentication 

上記as!力にしようとしているので、コードがクラッシュしようとしているではないAWSCognito...され何かをキャスト。

+0

私のコードを追加しました。以前に追加するのを忘れました。 –

+0

@TimmyTここに「自己」って何?私はそれが 'AWSCognitoIdentityPasswordAuthentication'ではないと思っています –

+0

私はすべてのコードを追加しました。 'Self'は 'SignInViewController'を指します。 –

関連する問題