摘要:
阅读全文
摘要:
1、包含运行时头文件 <objc/runtime.h> 2、获取某个类的成员变量或者属性; 3、获取成员函数 阅读全文
摘要:
NSString *str; // 使用stringWithFormat生成一格式化字符串 str = [NSString stringWithFormat:@"This is %@","John"]; NSLog(@"str--->%@",str); // 字符串长度length; NSLog(@"The length of this string is %@",[str length]); ... 阅读全文
摘要:
// 从路径中获得完整的文件名(带后缀) exestr = [filePath lastPathComponent]; NSLog(@"%@",exestr); // 获得文件名(不带后缀) exestr = [exestr stringByDeletingPathExtension]; NSLog(@"%@",exestr); //... 阅读全文
摘要:
// 当Documents内文件发生改变时,启动计时器,每秒计算一次大小,当大小不发生改变时说明传输完毕,就开始刷新。 @property (nonatomic, strong) NSTimer *timer; // 原Documents内文件大小 @property (nonatomic, assign) NSInteger filesSize; /... 阅读全文
摘要:
-(NSInteger)getSizeOfFilePath:(NSString *)filePath{ /** 定义记录大小 */ NSInteger totalSize = 0; /** 创建一个文件管理对象 */ NSFileManager * manager = [NSFileManager defaultManager]; /**获取文件下的所有路... 阅读全文
摘要:
旧方法:在iOS7.0以后过期了,但是还是可以用。 新方法:要导入头文件 :#import <AVFoundation/AVFoundation.h> 阅读全文
摘要:
//枚举定义图片类型 //定义方法 //调用 阅读全文
摘要:
在Info.plist文件中添加UIFileSharingEnabled键,并将键值设置为YES。将您希望共享的文件放在应用程序的Documents目录。 阅读全文
摘要:
iOS 10 开始对隐私权限更加严格,如果你不设置就会直接崩溃,现在很多遇到崩溃问题了,一般解决办法都是在info.plist文件添加对应的Key-Value就可以了。 以上Value值,圈出的红线部分的文字是展示给用户看的,必须添加。 阅读全文