码迷,mamicode.com
首页 > 移动开发 > 详细

iOS学习-UIBundle

时间:2016-01-20 22:43:03      阅读:357      评论:0      收藏:0      [点我收藏+]

标签:

//
//  ViewController.m
//  NSBundle详解
//
//  Created by 大欢 on 16/1/20.
//  Copyright © 2016年 bjsxt. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //束,目录
    NSString * string = [NSBundle mainBundle].bundlePath;
    NSLog(@"%@",string);
    
    //Resource:文件名
    //ofType:文件名后缀
    //inDirectory:Bundle下的目录
    
    
    NSString * path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"plist"];
    
    NSString * path2 = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"plist" inDirectory:@"image"];
    
    NSArray * array = [NSArray arrayWithContentsOfFile:path2];
    
    NSLog(@"%@",array);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
/***************************************************/

技术分享

iOS学习-UIBundle

标签:

原文地址:http://www.cnblogs.com/MrWuYindi/p/5146720.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!