iOS开发小记(十一)
2016-03-08 11:05
330 查看
ATS
http://www.baidu.com 需要配置ATShttps://www.baidu.com 不需要
Specifically, with ATS enabled, HTTP connections must use HTTPS (RFC 2818). Attempts to connect using insecure HTTP fail. Furthermore, HTTPS requests must use best practices for secure communications
宏定义
NS_ASSUME_NONNULL_BEGINNS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_BEGIN和NS_ASSUME_NONNULL_END。在这两个宏之间的代码,所有简单指针对象都被假定为nonnull,因此我们只需要去指定那些nullable的指针。
面对对象
封装、继承、多态父类指向子类的指针,会因子类的不同而不同。
多态-重写、重载。OC不支持重载。
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellWithIdentifier];
cell指针就有多态
setter和getter
重写一个NSString类型的,retain方式声明name属性的setter和getter方法-(void)settetName:(NSString *)name{ if(_name){ [_name release]; } _name = [name retain]; } -(NSString *)getterName{ return [[_name retain]autorelease]; }
类别和延展
类别是把类的实现方法分散到不同的文件中 也可以给类扩展新方法延展是给类添加私有方法 只为自己类所见 所使用
运行时机制
class_addProperty 与 class_addIvar/// An opaque type that represents a method in a class definition.
typedef struct objc_method *Method;
类定义的方法类型
/// An opaque type that represents an instance variable.
typedef struct objc_ivar *Ivar;
实例对象的变量
/// An opaque type that represents a category.
typedef struct objc_category *Category;
类别
/// An opaque type that represents an Objective-C declared property.
typedef struct objc_property *objc_property_t;
类声明的变量
APP架构
网络层 - 数据层 - 逻辑业务层 - 显示层盈盈的例子:
json - oc类 - 按照业务组合数据 - MVVM架构绑定显示
透明的导航栏
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];NSURL
fileURLWithPath和URLWithPath
+ (id)URLWithString:(NSString *)URLString Parameters URLString The string with which to initialize the NSURL object. Must be a URL that conforms to RFC 2396. This method parses URLString according to RFCs 1738 and 1808. (To create NSURL objects for file system paths, usefileURLWithPath:isDirectory: instead.) + (id)fileURLWithPath:(NSString *)path Parameters path The path that the NSURL object will represent. path should be a valid system path. If path begins with a tilde, it must first be expanded with stringByExpandingTildeInPath. If path is a relative path, it is treated as being relative to the current working directory. Passing nil for this parameter produces an exception.
相关文章推荐
- iOS海哥开发笔记 (海哥原创,CoreAnimation核心动画介绍)
- textField:shouldChangeCharactersInRange:replacementString: 限制字数,替换字符串
- 关于苹果PUSH(APNS)机制
- iOS应用崩溃日志分析
- Missing IOS Distribution signing identity ....
- ios客户端websocket的helloworld
- iOS安全–不同平台的崩溃收集
- iOS平台集成HTML5+SDK
- iOS海哥开发笔记 (海哥原创,CALayer简介 以及基本使用)
- ios 获取当前设备信息、内存
- iOS应用性能调优的一些建议和技巧
- ios 渐进淡出
- iOS开发--成员变量与属性
- iOS 探讨之 WWDCRA 无效 or "此证书的签发者无效"
- iOS 边框显示不完全
- ios富文本的简单使用 AttributedString
- 归并排序算法 iOS
- iOS 原生扫描二维码
- iOS8 【xcode6中添加pch全局引用文件】
- iOS海哥开发笔记 (海哥原创,绘图Quartz-2d的简单使用 二)