iOS使用XIB文件报错:reason: 'A view can only be associated with at most one view controller at a time!
2017-09-09 16:16
537 查看
分析原因:
由于控制器的xib文件名称和类名不一致,需要进行修改才可以,或者更改加载方法解决。
解决办法:
ViewController *vc = [[NSBundle mainBundle] loadNibNamed:
@"ViewController" owner:nil options:nil ].lastObject;
[self.navigationController pushViewController:vc animated:YES];
由于控制器的xib文件名称和类名不一致,需要进行修改才可以,或者更改加载方法解决。
解决办法:
ViewController *vc = [[NSBundle mainBundle] loadNibNamed:
@"ViewController" owner:nil options:nil ].lastObject;
[self.navigationController pushViewController:vc animated:YES];
相关文章推荐
- ios error:A view can only be associated with at most one view controller at a time
- Reason: Server is in single user mode. Only one administrator can connect at this time
- 1293 - Incorrect table definition; there can be only oneTIMESTAMP column with CURRENT_TIMESTAMP
- [Err] 1293 - there can be only one TIMESTAMP column with CURRENT_TIME in DEFAULT or ON UPDATE clause
- Only one expression can be specified in the select list when the subquery is not introduced with EXI
- ld: -pie can only be used when targeting iOS 4.2 or later clang: error: linker command failed with e
- java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="
- Error: "Database 'XXX' is already open and can only have one user at a time"
- iOS- Please sign in with an app-specific password. You can create one at applied.apple.com.
- Mysql 1293 - Incorrect table definition; there can be only one TIMESTAMP column with C
- there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- mysql单表多timestamp报错#1293 - Incorrect table definition; there can be only one TIMESTAMP column with C
- CHECKOUT can only be performed on a version resource [at this time].
- 数据库建表 there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- 155 Which three statements are true about windows? (Choose three.) A. Only one window can be open at
- Only one expression can be specified in the select list when the subquery is not introduced with EXI
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- Only one expression can be specified in the select list when the subquery is not introduced with(求助)
- Error: "Database 'XXX' is already open and can only have one user at a time"
- ios报错--pie can only be used when targeting iOS 4.2 or later clang: error: linker command failed with