原创 2012年03月21日 09:32:30

What is a bundle, you ask? Well, a bundle is just a special type of folder whose contents
follow a specific structure. Applications and frameworks are both bundles, and this call
returns a bundle object that represents our application.
One of the primary uses of NSBundle is to get to resources that you added to the
Resources folder of your project.
Those files will be copied into your application’s
bundle when you build your application. We’ve added resources like images to our
projects, but up to now, we’ve used those only in Interface Builder. If we want to get to
those resources in our code, we usually need to use NSBundle. We use the main bundle
to retrieve the URL of the resource in which we’re interested.


NSURL *plistURL = [bundle URLForResource:@"statedictionary"

This will return a URL containing the location of the statedictionary.plist file.


// image for ios

The first thing we do is load six different images. We do this using a convenience
method on the UIImage class called imageNamed:.
UIImage *seven = [UIImage imageNamed:@"seven.png"];
UIImage *bar = [UIImage imageNamed:@"bar.png"];
UIImage *crown = [UIImage imageNamed:@"crown.png"];
UIImage *cherry = [UIImage imageNamed:@"cherry.png"];


Once we have the six images loaded, we then need to create instances of UIImageView,
one for each image, for each of the five picker components. We do that in a loop.
for (int i = 1; i <= 5; i++) {
UIImageView *sevenView = [[UIImageView alloc] initWithImage:seven];
UIImageView *barView = [[UIImageView alloc] initWithImage:bar];
UIImageView *crownView = [[UIImageView alloc] initWithImage:crown];
UIImageView *cherryView = [[UIImageView alloc]
UIImageView *lemonView = [[UIImageView alloc] initWithImage:lemon];
UIImageView *appleView = [[UIImageView alloc] initWithImage:apple];
After we have the image views, we put them into an array. This array is the one that will
be used to provide data to the picker for one of its five components.
NSArray *imageViewArray = [[NSArray alloc] initWithObjects:
sevenView, barView, crownView, cherryView,
lemonView, appleView, nil];

iOS Code Signing(ios自学笔记)

下面是对此文章的理解再结合自己之前对该部分的认识写出的学习笔记。本文的前提是已经对非对称加密有了一定的了解。 一、数字签名(digital signature) 对指定信息使用哈希算法,得到一个固...
  • wangyang6275
  • wangyang6275
  • 2016年01月19日 10:34
  • 504


策略模式定义 定义了算法族,分别封装起来,让它们之间可以相互替换,此模式让算法的变化独立于使用算法的客户。 设计原则1: 找出应用中可能需要变化之处,把它们独立出来,不要和那些不需要变化的代码混...
  • shuangde800
  • shuangde800
  • 2013年08月04日 00:29
  • 2960


最近终于有空好好看看《iOS应用逆向工程》这本书了,接下来会边学边写博客记录下来,方便日后查阅。 本文摘录了一些最基本的,什么是逆向工程之类的基本知识。...
  • u010962810
  • u010962810
  • 2014年08月03日 21:45
  • 5897


  • jasonjwl
  • jasonjwl
  • 2015年11月05日 15:11
  • 871

IOS Core Animation Advanced Techniques的学习笔记(一)

Core Animation is the technology underlying Apple’s iOS user interface. By unleashing the full power...
  • iunion
  • iunion
  • 2014年05月09日 18:31
  • 3690

RunLoop学习笔记,从CF层面了解由于CFRunLoopMode机制iOS程序ScrollView的滑动为何如此平滑的原因。还有介绍AFNetworking如何单独发起一个global threa

RunLoop学习笔记,从CF层面了解由于CFRunLoopMode机制iOS程序ScrollView的滑动为何如此平滑的原因。还有介绍AFNetworking如何单独发起一个global threa...
  • zhenganzhong_csdn
  • zhenganzhong_csdn
  • 2015年08月06日 16:39
  • 515


1.id与instanncetypeid 与 instancetype 区别 可以当返回值类并且可以声明对象 2.instancetype 只可以当返回值类型 3.instanc...
  • czzj0212
  • czzj0212
  • 2016年04月19日 20:28
  • 514


- (void)registerBtnClicked{    RegisterViewController *vc = [[RegisterViewController alloc] init]; ...
  • tianxiawuzhei
  • tianxiawuzhei
  • 2015年11月10日 10:29
  • 1518

开源项目Coding学习笔记(1):EaseStartView --- 第一个界面

EaseStartView *startView = [EaseStartView startView]; @weakify(self); [startView startAnimatio...
  • tianxiawuzhei
  • tianxiawuzhei
  • 2015年11月05日 15:39
  • 1144


1. main(int argc, char * argv[]){} (因为程序名总是用作启动参数传递,所以argc的值至少是1) 2. NSLog(@"some strings"); @"" ...
  • wen942467928
  • wen942467928
  • 2016年05月09日 14:14
  • 1026