随笔分类 -  IOS随笔小记

1 2 3 4 下一页
IOS - NSDate 自己挖的坑,自己跳
摘要:NSDate:5是坑啊啊! 1 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 2 3 [dateFormatter setDateFormat:@"yyyy/MM/dd hh:mm:ss"]; 4 ... 阅读全文
posted @ 2015-02-03 09:45 tx天翔 阅读(242) 评论(0) 推荐(0) 编辑
IOS - Display a base64 image within a UIImageView: 显示一个base64的图片
摘要:base64字符串(base64String)-存的是image数据NSData* data = [[NSData alloc] initWithBase64EncodedString:base64String options:0];UIImage* image = [UIImage imageWi... 阅读全文
posted @ 2014-12-26 12:05 tx天翔 阅读(485) 评论(0) 推荐(0) 编辑
IOS - 绘制文字 drawInRect: withFont: not working
摘要:在图形绘制中,我们经常会需要绘制文本,但我在给PDF上绘制Text时,始终绘制不上,使用过:[str drawInRect:cubeRect withAttributes:attrs];CGContextShowTextAtPoint(ctx, 100.0, 100.0, "SOME TEXT", ... 阅读全文
posted @ 2014-12-25 10:09 tx天翔 阅读(526) 评论(0) 推荐(0) 编辑
IOS - xib(Interface Builder,view) - can't change view size(view不能改变大小问题)
摘要:很多时候,我们自定义tableview、collectionview的cell,也有时候我们要自定义窗口xib,但创建xib后,其height、width不可修改。这时问题就来了,怎么才能使我们的自定义xib宽高可修改:项目中创建xib,单独的view时,方法:默认Simulated metric中... 阅读全文
posted @ 2014-12-12 10:15 tx天翔 阅读(3011) 评论(0) 推荐(0) 编辑
IOS - Ask for Application Badge permission ios8
摘要:UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBa... 阅读全文
posted @ 2014-12-06 19:54 tx天翔 阅读(220) 评论(0) 推荐(0) 编辑
IOS - 零碎
摘要:---恢复内容开始---1、模拟器目录:ProjectNameApk、documents、library(cache、preference、cookies)、temp2、Edit-Refactor(重构)-Convert to Objective-C ARC...3、Product-Profile(... 阅读全文
posted @ 2014-11-30 22:34 tx天翔 阅读(213) 评论(0) 推荐(0) 编辑
IOS - 网络指示器
摘要:#pragma mark Activity methods- (void)openActivity{ // 添加网络指示器 activityIV = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivit... 阅读全文
posted @ 2014-11-12 13:13 tx天翔 阅读(1373) 评论(0) 推荐(0) 编辑
IOS - CoreData 增删改查
摘要:#pragma mark - Core Data Methods- (void)insertObjectWithFileName:(NSString *)fileName{ /** SQL新增记录的过程 1. 拼接一个INSERT的SQL语句 2. 执行SQL */ // 1. 实例化并... 阅读全文
posted @ 2014-11-09 16:18 tx天翔 阅读(10954) 评论(0) 推荐(0) 编辑
IOS - plist使用
摘要://1 可读取,不可写入工程下的plist文件;// NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"OfficialDoc" ofType:@"plist"]; //2 Document 沙盒中的文件(没有文件可自... 阅读全文
posted @ 2014-11-09 11:45 tx天翔 阅读(222) 评论(0) 推荐(0) 编辑
IOS - JSON数据解析 小3种方法
摘要:[manager GET:serverURL parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { // 3 解析返回的JSON数据 // 3.1// NSDictionar... 阅读全文
posted @ 2014-11-09 00:33 tx天翔 阅读(246) 评论(0) 推荐(0) 编辑
IOS - 退出程序
摘要:- (void)exitApplication { OAAppDelegate *app = [UIApplication sharedApplication].delegate; UIWindow *window = app.window; [UIView animateWithDurati... 阅读全文
posted @ 2014-11-08 09:52 tx天翔 阅读(168) 评论(0) 推荐(0) 编辑
IOS - PDF合并
摘要:#pragma mark - Merge PDF- (void)mergePDF{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString... 阅读全文
posted @ 2014-11-08 09:50 tx天翔 阅读(1689) 评论(0) 推荐(0) 编辑
IOS - DatePicker的使用
摘要:UIDatePicker *picker = [[UIDatePicker alloc] init]; picker.datePickerMode = UIDatePickerModeDate; picker.locale = [[NSLocale alloc] initWithLocaleId... 阅读全文
posted @ 2014-09-15 16:16 tx天翔 阅读(3929) 评论(0) 推荐(0) 编辑
IOS - [UIDevice currentDevice] name/model/localizedMode/systemName/systemVersion...../userInterfaceIdiom
摘要:+ (UIDevice *)currentDevice;@property(nonatomic,readonly,retain) NSString *name; // e.g. "My iPhone"@property(nonatomic,readonly,retain) NSStri... 阅读全文
posted @ 2014-09-12 15:13 tx天翔 阅读(1528) 评论(0) 推荐(0) 编辑
IOS - autoresizingMask
摘要:提醒:当frame设定死,慎用autoresizingMask;否则该frame变形的难以想象。 阅读全文
posted @ 2014-09-05 11:22 tx天翔 阅读(121) 评论(0) 推荐(0) 编辑
IOS - No provisioning profiles with a valid signing identity 一种解决方法
摘要:1、删除原有“钥匙串访问”中疑是过期的的证书;2、在Member Center中Certificate中删除疑是有问题的Certificate,重新添加新的Certificate;3、在“钥匙串访问” - 证书处理 - 从证书颁发机构请求证书,生成新的CertificateSigningReques... 阅读全文
posted @ 2014-07-10 15:12 tx天翔 阅读(4857) 评论(0) 推荐(1) 编辑
Objective-C对象初始化
摘要:1、分配内存2、初始化Java or C++ 直接调用构造函数 阅读全文
posted @ 2013-04-28 13:19 tx天翔 阅读(103) 评论(0) 推荐(0) 编辑
Objective-C中的null
摘要:1、用nil表示空对象2、与NULL的区别: nil是个对象,可以调用方法,不会crash NULL是个值 阅读全文
posted @ 2013-04-28 13:16 tx天翔 阅读(157) 评论(0) 推荐(0) 编辑
IOS-UITableViewStyle设置Group、Plain问题
摘要:1、当创建UIViewController添加UITableView时,self.tableView =[[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];2、当创建UITableViewController时,需要改变UITableViewStyle时,使用self.tableView.style = UITableViewStyleGrouped;会出现错误查UITableViewController的SDK文档,发现:Table views can have one of two style 阅读全文
posted @ 2013-03-02 22:56 tx天翔 阅读(12337) 评论(0) 推荐(1) 编辑
IOS-UITableView手动添加时,Header Section的背景设置
摘要:方法如下:-(UIView*) tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section {UIView*headerView =[[[UIView alloc] initWithFrame:CGRectMake(0,0, tableView.bounds.size.width,30)] autorelease];if(section == integerRepresentingYourSectionOfInterest)[headerView setBackgroundColor:[UIColor 阅读全文
posted @ 2013-03-02 15:15 tx天翔 阅读(1955) 评论(0) 推荐(0) 编辑

1 2 3 4 下一页