1. 新建一個(gè)靜態(tài)庫(kù)工程bundle
成都創(chuàng)新互聯(lián)專注于企業(yè)成都全網(wǎng)營(yíng)銷推廣、網(wǎng)站重做改版、襄州網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、HTML5、商城網(wǎng)站制作、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)營(yíng)銷網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為襄州等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。

2. 新建一個(gè)Viewcontroller

3. 新建一個(gè)Target Bundle并指定SDK為iOS, 并將TestViewController.xib加到Copy Bundle Resouce


5. bundle 代碼如下
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface bundle : NSObject
- (void) addViewController:(UIView *)view;
@end
#import "bundle.h"
#import "TestViewController.h"
@implementation bundle
- (void) addViewController:(UIView *)view
{
NSBundle *bundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"Test" withExtension:@"bundle"]];
TestViewController *testCtrl = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:bundle];
[view addSubview:testCtrl.view];
}
@end6. 新建一個(gè)工程TestBundle, 把libbundle.a,Test.bundle拖入到工程中,然后調(diào)用即可

#import "ViewController.h"
#import "bundle.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
bundle * addView = [[bundle alloc] init];
[addView addViewController:self.view];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
分享文章:iOS靜態(tài)庫(kù)結(jié)合Bundle隱藏代碼,對(duì)外接口整理
瀏覽地址:http://www.chinadenli.net/article44/isjiee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、App設(shè)計(jì)、全網(wǎng)營(yíng)銷推廣、網(wǎng)站導(dǎo)航、面包屑導(dǎo)航、微信公眾號(hào)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)