NSBundle
一.获取图片
  1.   NSString *path = [[NSBundle mainBundle] pathForResource:@"resourceName" ofType:@“resourceType"];
       UIImage *image = [[UIImage imageWithContentsOfFile:path];

  2.   UIImage *image = [UIImage imageNamed:@"imageName"];
二.获取plist文件
  NSArray *array =[[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"name"ofType:@"plist"]];
  NSDictionary *dict=[array objectAtIndex:index];//将plist文件中的内容转换成字典

posted on 2014-12-05 09:44  墓厄  阅读(139)  评论(0编辑  收藏  举报