社区
iOS
帖子详情
关于IOS7 的 mainbundle的 pathForResource
昵称90天可以改一次
2014-03-04 04:20:48
最近升级到xcode5 发现 pathForResource 不能获取到Caches下面的目录(文件存在)
...全文
221
回复
打赏
收藏
关于IOS7 的 mainbundle的 pathForResource
最近升级到xcode5 发现 pathForResource 不能获取到Caches下面的目录(文件存在)
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
自定义开关按钮(
ios
)
可以设置开关的颜色,修改字符串等。例如,用图片代替:UIImage *normal_left = [[UIImage alloc] initWithContentsOfFile:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"left_normal" ofType:@"png"]]; UIImage *normal_right = [[UIImage alloc] initWithContentsOfFile:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"right_normal" ofType:@"png"]]; NSMutableArray *unselectImages = [[NSMutableArray alloc]initWithObjects:normal_left, normal_right, nil]; [normal_left release]; [normal_right release]; UIImage *select_left = [[UIImage alloc] initWithContentsOfFile:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"left_press" ofType:@"png"]]; UIImage *select_right = [[UIImage alloc] initWithContentsOfFile:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"right_press" ofType:@"png"]]; NSMutableArray *selectImages = [[NSMutableArray alloc]initWithObjects: select_left, select_right, nil]; [select_left release]; [select_right release]; CQSegmentControl *_segmentedControl= [[CQSegmentControl alloc] initWithItemsAndStype:titleItems stype:TitleAndImageSegmented]; for (UIView *subView in _segmentedControl.subviews) { [subView removeFromSuperview]; } _segmentedControl.normalImageItems = unselectImages; [unselectImages release]; _segmentedControl.highlightImageItems = selectImages;
IOS
设备类型获取PLIST
IOS
设备类型获取PLIST struct utsname systemInfo; uname(&systemInfo); NSString *
iOS
DeviceModels
Path
= [[NS
Bundle
main
Bundle
]
path
For
Resource
:@"
iOS
DeviceModelMapping" ofType:@"plist"]; NSDictionary *
iOS
Devices = [NSDictionary dictionaryWithContentsOfFile:
iOS
DeviceModels
Path
]; NSString* deviceModel = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; return [
iOS
Devices valueForKey:deviceModel];
封装的启动引导图
作者bing6,源码KSGuide,启动引导图,使用很简单,只要配置图片路径就可以了。代码如下 NSMutableArray *
path
s = [NSMutableArray new]; [
path
s addObject:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"1" ofType:@"jpg"]]; [
path
s addObject:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"2" ofType:@"jpg"]]; [
path
s addObject:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"3" ofType:@"jpg"]]; [
path
s addObject:[[NS
Bundle
main
Bundle
]
path
For
Resource
:@"4" ofType:@"jpg"]]; [[KSGuideManager shared] showGuideViewWithImages:
path
s];
BookPDF:
iOS
7 iBooks like PDF Viewer with Thumbnail Bar
图书PDF 职能
iOS
7 iBooks like PDF Viewer with Thumbnail Bar 缩略图栏 隐藏/显示用户界面 设置 initWithPDFAtURL: NSString *
path
= [[NS
Bundle
main
Bundle
]
path
For
Resource
:@"demo1" ofType:@"pdf"]; NSURL *url = [NSURL fileURLWith
Path
:
path
]; BookPDF *page = [[BookPDF alloc] initWithPDFAtURL:url]; [self presentViewController:page animated:YES completion:NULL]; 初始化数据: NSString *
path
= [[NS
Bundle
main
Bundle
]
path
ForReso
tom猫游戏源码
iOS
ios
开发的tom,全部素材和源代码,战士部分代码 //调用button监听方法 -(IBAction)tomAction:(UIButton *)button{ [self tomAnimationWithName:button.currentTitle count:button.tag]; } //让tom猫动起来,name是要执行动作的名字 count是图片的个数 -(void) tomAnimationWithName:(NSString *) name count:(NSInteger) count { //如果动画正在播放就返回不执行 if (self.tom.isAnimating) { return; } //序列帧动画 播放一组图片 //指定动画图片的数组 NSMutableArray *arrayM = [NSMutableArray array]; //添加动画播放的素材 for (int i = 0; i
path = [[NS
Bundle
main
Bundle
]
path
For
Resource
:imageName ofType:nil]; UIImage *image = [UIImage imageWithContentsOfFile:
path
]; arrayM[i] = image; };
iOS
29,027
社区成员
12,466
社区内容
发帖
与我相关
我的任务
iOS
主要讨论与iOS相关的软件和技术
复制链接
扫一扫
分享
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章