知识要点  

1.  xib最终会变成nib文件

2.  NSBundle实例方法  - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)ext;

     如果bundle中不存在某个文件,则返回的path为nil,如果存在 则会返回该文件的路径

 

因此运行时判断xib是否存在某个xib文件(eg:TestXibController.xib)方法:

    NSString *nibPath = [[NSBundle mainBundle] pathForResource:@"TestXibController" ofType:@"nib"];

 

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2021-06-04
  • 2021-08-25
  • 2021-11-28
  • 2021-11-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2021-12-07
  • 2022-02-02
相关资源
相似解决方案