...OS开发中,bundle是一个目录,其中包含了程序会使用到的资源.这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in).对应bundle,cocoa提供了类NSBundle.我们现在用bundle获取程序里的一张图片,并显示到View上。新建一个Single View Application,并在加入viewDidLoad方法里加入如下代码: 1. // 通过使...
NSBundleClassReferenceDataManagement:FileManagement2010-04-29
...t();UIGraphicsEndImageContext(); [myImageview setImage:image1];//[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"step3" ofType:@"png" inDirectory:@"Exam/sysi...
IOS读取文件 //设置读取文件路径NSBundle *bundle=[NSBundlemainBundle];NSString *plistPath=[bundle pathForResource:@"Data"ofType:@&...
... view plaincopyprint?1. //———————————————————播放提示声音———————————————————————2. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"msgcome"ofType:@"wav"];3. NSURL *url = [NSURL fil...
...entedControl *_segmentControl;CGRect _rect;} - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];if (self) {// Cu...
...ViewController = [[RootViewController alloc]initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];[window addSubview:rootViewController.view]; 这个是动态创建了RootView,上一个是利用XIB文件创建.更新方法:TNND,...
...tor(stopURLFetchWithProgress:)forControlEvents:UIControlEventTouchUpInside];NSString*tempFile = [[[[NSBundle mainBundle]bundlePath]stringByDeletingLastPathComponent]stringByAppendingPathComponent:@"Memex...
...…in) 3、 日期与时间(NSDate)、 日期格式(NSDataFormatter)、 日历 (NSCalendar)、定时器(NSTimer) 4、文件管理(NSFileManager)、沙盒(NSBundle)、缓冲 区(NSData) iPhone的基础框架(Foundation), 包含了iOS 开发的基本数据类型以及 常用类,在iOS SDK中以NS开头的类 都属于这个框架, 重点掌握这些常用类的常...
... withColor:(UIColor *)color withTextColor:(UIColor *)textColor { NSString *imageBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"images.bundle"]; NSBundle *i...
对xml进行解析需要使用NSXMLParser类,首先声明一个NSXMLParser对象 NSXMLParser *xmlRead; NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"xml"]; NSFileHandle *file = [NSFi...