- 博客(9)
- 收藏
- 关注
转载 ios检测摄像头、指南针、陀螺仪的状态的代码
//检查前后摄像头 - (void)cameraBtnAction:(id)sender { BOOL cameraAvailable = [UIImagePickerController isCameraDeviceAvailable: UIImagePickerControllerCameraDevi
2015-03-27 15:50:18 1005
转载 设置Table Cell的背景图的类
#import <Foundation/Foundation.h> #import <UIKit/UIKit.h>@interface UITableViewCell (UITableViewCellExt)- (void)setBackgroundImage:(UIImage*)image; - (void)setBackgroundImageByName:(NSString*)imageName
2015-03-27 11:12:26 520
转载 IOS JSON解析之JSONKit使用
JSONKit使用相当简单。 将JSONKit.h和JSONKit.m拖到项目中。 下载地址:https://github.com/johnezang/JSONKit/下面代码://string to dictionary NSString *resultStr = @"{\"name\": \"admin\",\"list\": [\"one\",\"two\",\"three\"]}";
2015-03-27 11:07:29 273
转载 MBProgressHUD使用
MBProgressHUD是替代UIProgressHUD的一个小工具,使用方法也非常简单下载地址是: http://github.com/matej/MBProgressHUD#import <UIKit/UIKit.h> #import "MBProgressHUD.h"@interface HudDemoViewController : UIViewController <MBProgress
2015-03-27 11:05:03 339
转载 MBProgressHUD的基本使用
和gitHub上的Demo其实差不多,就是小整理了下,当备忘,想做复杂的效果可以参考MBProgressHUD在gitHub上的DEMO,写得也很清楚明了。先下载MBProgressHUD.h和.m文件,拖入工程。地址:MBProgressHUD以下是代码:(先在.h文件里定义 MBProgressHUD *HUD;)//方式1.直接在View上show HUD = [[MBProgressHU
2015-03-27 11:00:37 311
转载 NSOperationQueue的简单应用
NSOperationQueue的简单应用在使用NSOperationQueue简化多线程开发中介绍了iOS的操作队列使用方法。这里补充一下队列的优先级功能。 假设现在队列中有多个操作(NSOperation),现在再向队列中加入新的操作,并且希望新增加的操作排在未执行操作的最前面。这时就需要设置操作的优先级了。编写了个最简单的NSOperation,头文件:import@interface My
2015-03-27 10:56:04 257
转载 IOS根据路径读取文件大小
c语言 实现include “sys/stat.h” (long long) fileSizeAtPath:(NSString*) filePath{ struct stat st; if(lstat([filePath cStringUsingEncoding:NSUTF8StringEncoding], &st) == 0){ return st.st_size; } return 0
2015-03-27 10:54:15 745
转载 IOS中获取各个文件的目录路径的方法和NSFileManager类
IOS中获取各种文件的目录路径的方法 iphone沙箱模型的有四个文件夹,分别是什么,永久数据存储一般放在什么位置,得到模拟器的路径的简单方式是什么. documents,tmp,app,Library。 (NSHomeDirectory()), 手动保存的文件在documents文件里 Nsuserdefaults保存的文件在tmp文件夹里
2015-03-27 10:45:30 342
转载 ios开发--启动页面的动画
ios开发--启动页面的动画 在你的应用代理中找到application didFinishLaunching,添加以下代码: - (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { self.window.rootViewCon
2015-03-26 13:36:49 291
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人