2017年6月15日
摘要: - (void)viewDidLoad { [super viewDidLoad]; // 如果要设置请求体 NSURLSession *session = [NSURLSession sharedSession]; NSMutableURLRequest *request = [NSMutable 阅读全文
posted @ 2017-06-15 23:37 1018475062 阅读(247) 评论(0) 推荐(0)
摘要: #import "ViewController.h" @interface ViewController ()<NSURLConnectionDataDelegate> @property (nonatomic, assign) CFRunLoopRef runLoop;// 保持同一个线程 C语言 阅读全文
posted @ 2017-06-15 22:26 1018475062 阅读(325) 评论(0) 推荐(0)
摘要: #import "ViewController.h" @interface ViewController ()<NSURLConnectionDataDelegate> @property (nonatomic, strong) NSOutputStream *stream; // 全局,每次下载的 阅读全文
posted @ 2017-06-15 21:33 1018475062 阅读(166) 评论(0) 推荐(0)
摘要: NSDictionary *result = value[@"data"]; if (![result isKindOfClass:[NSDictionary class]]) { NSLog(@"data 不是字典"); if ([result isKindOfClass:[NSString cl 阅读全文
posted @ 2017-06-15 18:01 1018475062 阅读(965) 评论(0) 推荐(0)
摘要: x_button = x_space + line * (x_space + buttonWidth); y_button = y_space + row * (y_margin + buttonHeight); NSString *title = dicArray[i][@"title"]; NS 阅读全文
posted @ 2017-06-15 16:48 1018475062 阅读(117) 评论(0) 推荐(0)
摘要: #define PUSH(controller) [self.navigationController pushViewController:controller animated:YES] #define HHPOP [self.navigationController popViewContro 阅读全文
posted @ 2017-06-15 14:09 1018475062 阅读(201) 评论(0) 推荐(0)
摘要: #define ROUNDCORNER(VIEW,ANGLE) VIEW.layer.masksToBounds=YES ; { if (ANGLE ==0) {// 为0则默认为高的一半 VIEW.layer.cornerRadius=VIEW.frame.size.width/2; } else 阅读全文
posted @ 2017-06-15 14:08 1018475062 阅读(110) 评论(0) 推荐(0)
摘要: // 懒加载 UICollectionView - (UICollectionView *)myCollectionView { if (!_myCollectionView) { UICollectionViewFlowLayout *flowLayout = [[UICollectionView 阅读全文
posted @ 2017-06-15 11:42 1018475062 阅读(1201) 评论(0) 推荐(0)
摘要: #import "NSArray+Operation.h" @implementation NSArray (Operation) // 数组的平均数 -(float)averageValueOfElements{ NSNumber * value = [self valueForKeyPath:@ 阅读全文
posted @ 2017-06-15 11:28 1018475062 阅读(154) 评论(0) 推荐(0)
摘要: 在Foundation框架中,NSObject根类大家都比较熟悉,但是对NSProxy则比较陌生,平时用的比较少。今天初步的介绍下对NSProxy的认识。 NSProxy是Foundation框架中另外一基类。对比NSObject来看 相同的地方: 都遵守<NSObject>基协议,会实现协议中的必 阅读全文
posted @ 2017-06-15 09:11 1018475062 阅读(222) 评论(0) 推荐(0)