一,封装.bundle和.a使用xib的方式前面已经说过了,具体方式不再赘述,简单介绍于下:

静态库加.h  bundle:删plist,改sdk,加xib 简称psx三步

引用库的项目,加.a .bundle 编辑edit scheme

二,storyboard出现的比较晚,封装的教程如今全网仅此一家,方便开发!

首先创建静态库,方法都和以前的一样,就把xib换成storyBoard就行了,难就难在怎么引用上,下面介绍于下:

在跟控制器上声明一个属性一个方法,为了调用的时候更方便

//比如A控制器要跳转过来,就把A的实例赋值给此source属性然后调用 startViewController方法就可以跳转过来

@property (nonatomic,strong)UIViewController *sourceViewController;

//启动该视图控制器,显示天气视图,为sourceViewController赋值之后就调用该方法

-(void)startViewController;

然后实现方式如下:

-(void)startViewController

{

NSBundle *bundle=[NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"WeatherDataLibResources" withExtension:@"bundle"]];

UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"WeatherStoryboard" bundle:bundle];

[self.sourceViewController presentViewController:[storyboard instantiateInitialViewController] animated:YEScompletion:^{

}];

}

三,在引用的地方先引入头文件,然后实例化,设置参数,方式如下:

WeatherViewController *weatherViewController=[[WeatherViewController alloc]init];

weatherViewController.sourceViewController=self;

[weatherViewController startViewController];

使用中遇到问题  Unknown class <class name> in interface Builder file.

遇到这个问题的人一时半会解决不了这个问题,真他妈蛋疼,我弄了一天多

解决:

1,xcode优化机制制造的这个问题,在任意一个类中调用一下这个类就行,比如打log或直接[类 class];

2,在project中的link flag加  -all_load

另外一个奇葩问题

[self.sourceViewController presentViewController:[storyboard instantiateInitialViewController] animated:YEScompletion:^{}];

这个方法可以显示视图,但是没有navigationBar!

还是直接使用push方法才能解决

在静态库中操作时经验终结:

使用模拟器.a
单例作为入口
built setting (other link) -objc  (解决不是别类的bug)
[self presentViewController:controller animated:YES completion:^{
    }];没有navigationBar可以显示,要换成 [self.navigationController pushViewController:qucontroller animated:YES];

多个storyboard开发应用程序,封装.bundle和.a不用xib使用storyboard!!!的更多相关文章

  1. iOS- Could not find a storyboard named 'Main' in bundle NSBundle

    1.删掉工程中main.storyboard 后要删除plist文件中对应的键值,否则会报如下错误: Could not find a storyboard named 'Main' in bundl ...

  2. Could not find a storyboard named 'Main' in bundle NSBundle

    转自:http://www.cnblogs.com/ygm900/p/3836580.html 1.删掉工程中main.storyboard 后要删除plist文件中对应的键值,否则会报如下错误: C ...

  3. 使用 Eclipse C/C++ Development Toolkit 开发应用程序

    使用 Eclipse C/C++ Development Toolkit 开发应用程序 (转) 来自http://blog.csdn.net/favory/article/details/189080 ...

  4. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 Excel Services中新功能

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序  Excel Services中新功能         从S ...

  5. UI5-文档-2.3-使用SAPUI5工具为Eclipse开发应用程序

    用于为简单用例开发应用程序.用于Eclipse的SAPUI5应用程序开发工具提供向导来支持您以一种简单的方式创建应用程序.使用application project向导,将自动创建包含视图和控制器的必 ...

  6. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 总结

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序  总结         SP2013新的server端Off ...

  7. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 WOPI和新的Office Web Apps Server

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序  WOPI和新的Office Web Apps Server ...

  8. 微信小程序封装storage(含错误处理)

    这次给你们安利的是微信小程序封装storage,先说下微信官方的 wx.getStorage({ key:"", success: function (res) { }, fail ...

  9. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 新的机器翻译服务

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序  新的机器翻译服务         机器翻译服务也是继Wor ...

随机推荐

  1. 初学java之(盒子分布)

    import javax.swing.*; import java.awt.*; class WinGrid extends JFrame { Box basebox , boxv1,boxv2; p ...

  2. 【新手练习】类似Path的按钮,

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. maven install 时提示“程序包 javax.crypto不存在”

    但是javax.crypto是在jdk的jre\lib目录下的 解决方案: <compilerArguments> <bootclasspath>${java.home}/li ...

  4. AppSettings和ConnectionStrings的区别

    AppSettings是ASP.NET1.1时期用的,在.NET Framework 2.0中,新增了ConnectionStrings. 1.<connectionStrings> &l ...

  5. for循环语句以及迭代法和穷举法

    循环语句: 四要素:初始条件,循环条件,状态改变,循环体 for(初始条件;循环条件;状态改变){ //循环体} 案例1:打印等腰直角三角形和菱形 左上三角 static void Main(stri ...

  6. 使用JQuery的Ajax调用SOAP-XML Web Services(Call SOAP-XML Web Services With jQuery Ajax)(译+摘录)

    假设有一个基于.Net的Web Service,其名称为SaveProduct POST /ProductService.asmx HTTP/1.1 Host: localhost Content-T ...

  7. async 和await

    这个是.NET 4.5的特性,所以要求最低.NET版本为4.5. 看很多朋友还是使用的Thread来使用异步多线程操作,基本上看不见有使用Async.Await进行异步编程的.各有所爱吧,其实都可以. ...

  8. linux 下echo命令写入文件内容

    http://blog.csdn.net/xukai871105/article/details/35834703 echo "Raspberry" > test.txt

  9. Oracle内置函数内容整理

    --绝对值select abs(-100) from dual; --取余select mod(8,3) from dual; --取整,大于该数的最小整数(上限值)select ceil(12.0) ...

  10. 二模 (2) day1

    第一题: 题目描述:淘汰赛制是一种极其残酷的比赛制度.2n名选手分别标号1,2,3,…,2n-1,2n,他们将要参加n轮的激烈角逐.每一轮中,将所有参加该轮的选手按标号从小到大排序后,第1位与第2位比 ...