iOS资料(已读)

大部分人缺乏一种主动发掘信息的意识。读着别人写好的文字,思考着别人提出的问题,做着别人交代的事情。

https://bitbucket.org/dcutting/verijson

nsurlsession管理并发请求数目:

首先,尝试方法:设置NSURLSessionConfiguration对HTTPMaximumConnectionsPerHost属性,发现问题:如果我入队列5个任务,前三个在完成了,后两个任务会超时对待。新的方法:设置nsurlsession的delegateQueue的最大并发数,发现无效, 无效2,所以又去寻找新的方法 方法是使用nsoperartion包装nsurlsession,虽然nsurlsession有自己的队列,但是你不能对他的并发数做更改,改了也会被忽略。
最后,使用nsoperation包装nsurlsession的,见代码

property.

    • (id)initWithNibName:(NSString *bundle:(NSBundle *)nibBundleOrNil
    • (id)initWithCoder:(NSCoder *)aDecoder
    • (void)awakeFromNib {
      执行顺序:1, 2, 3

uiviewcontroller拥有以上三个方法,uiview没有第一个方法

  1. 当从storyboard中加载vc时,initwithcode和awakfromnib被调用,如果从代码创建vc, 只有initwithnibname:bundle被调用
  2. 当从storyboard中加载v时,initwithcode和awakfromnib被调用,如果从代码创建v,initwithframe被调用
  3. 当从storyboard中加载vc或v的时候,initwithcoder方法中,iboutlet连接的属性是nil,awakfromnib中的属性才是有值,
小技巧
重命名.gif

linux command

xdg-open . # 在file manager中打开当前路径

Linux command

// MLAMUtils, CocoaLumberjack, MagicalRecord, SDWebImage, SVPullToRefresh, SVProgressHUD, TTTAttributedLabel,
// KeyboardAvoiding, FXKeychain, JSONValidation, TQStarRatingView, MLAMModel,RNCryptor
Target_Name="RNCryptor"

# 在build/Release-iphoneos/${Target_Name}.framework下创建真机framework
xcodebuild -configuration Release -target "${Target_Name}" -sdk iphoneos clean build

# 在build/Release-iphonesimulator/${Target_Name}.framework下创建模拟器framework
xcodebuild -configuration Release -target "${Target_Name}" -sdk iphonesimulator clean build

Device_Dir=build/Release-iphoneos/${Target_Name}.framework
Simulator_Dir=build/Release-iphonesimulator/${Target_Name}.framework
Device_Simulator_Dir=../MLAppMaker/Framework/${Target_Name}.framework

# 将真机的framework里的内容全部复制到合并的framework文件夹内,主要是一些头文件,真机的编译的代码最终会被真机与模拟器合并后的代码覆盖
cp -R "${Device_Dir}/" "${Device_Simulator_Dir}"


# 合并模拟器和真机的代码
lipo -create "${Device_Dir}/${Target_Name}" "${Simulator_Dir}/${Target_Name}" -output "${Device_Simulator_Dir}/${Target_Name}"

# 移除build目录
#rm -r build

open $Device_Simulator_Dir/..

Mach-o static-library
arm7s
http://www.cocoachina.com/ios/20150906/13323.html
http://stackoverflow.com/questions/26024100/dyld-library-not-loaded-rpath-libswiftcore-dylib

navigationcontroller执行push或pop的时候执行navigationcontroller的代理方法:

- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                  animationControllerForOperation:(UINavigationControllerOperation)operation
                                               fromViewController:(UIViewController *)fromVC
                                                 toViewController:(UIViewController *)toVC {

提供一个实现了UIViewControllerAnimatedTransitioning协议的转场对象动画子,动画子实现了协议中的方法:

- (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)transitionContext;
- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext;

在方法中有一个UIViewControllerContextTransitioning的参数,参数对象可以获取转场的画布,源控制器,目的控制器。

在交互驱动转场回退过程中,同样执行navigationcontroller的代理方法:

- (id <UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController
                          interactionControllerForAnimationController:(id <UIViewControllerAnimatedTransitioning>) animationController NS_AVAILABLE_IOS(7_0);

方法需要返回一个实现了UIViewControllerInteractiveTransitioning协议的对象,通常这个对象是UIPercentDrivenInteractiveTransition对象

以上是navigationcontroller的转场,下面是模态的转场。
模态转场从A控制器到B控制器

 a.transitioningDelegate = self;
 a.modalPresentationStyle = UIModalPresentationCustom;
 a.modalPresentationCapturesStatusBarAppearance = YES

transitioningdelegate表示协议UIViewControllerTransitioningDelegate,协议需要实现4个方法:
表示present和dismiss转场

 - (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source;
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed;

表示交互驱动转场

- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id <UIViewControllerAnimatedTransitioning>)animator;
- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id <UIViewControllerAnimatedTransitioning>)animator;

自定义模态的一个案例:

- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext
{
    UIView *fromView = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey].view;
    fromView.tintAdjustmentMode = UIViewTintAdjustmentModeDimmed;
    fromView.userInteractionEnabled = NO;

    UIView *dimmingView = [[UIView alloc] initWithFrame:fromView.bounds];
    dimmingView.backgroundColor = [UIColor customGrayColor];
    dimmingView.layer.opacity = 0.0;

    UIView *toView = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey].view;
    toView.frame = CGRectMake(0,
                              0,
                              CGRectGetWidth(transitionContext.containerView.bounds) - 104.f,
                              CGRectGetHeight(transitionContext.containerView.bounds) - 288.f);
    toView.center = CGPointMake(transitionContext.containerView.center.x, -transitionContext.containerView.center.y);

    [transitionContext.containerView addSubview:dimmingView];
    [transitionContext.containerView addSubview:toView];

    POPSpringAnimation *positionAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionY];
    positionAnimation.toValue = @(transitionContext.containerView.center.y);
    positionAnimation.springBounciness = 10;
    [positionAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
        [transitionContext completeTransition:YES];
    }];

    POPSpringAnimation *scaleAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerScaleXY];
    scaleAnimation.springBounciness = 20;
    scaleAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(1.2, 1.4)];

    POPBasicAnimation *opacityAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerOpacity];
    opacityAnimation.toValue = @(0.2);

    [toView.layer pop_addAnimation:positionAnimation forKey:@"positionAnimation"];
    [toView.layer pop_addAnimation:scaleAnimation forKey:@"scaleAnimation"];
    [dimmingView.layer pop_addAnimation:opacityAnimation forKey:@"opacityAnimation"];
}

自定义UIStoryboardSegue子类覆盖perform方法,关联wind和unwind动作

override func perform() {
    // Assign the source and destination views to local variables.
    var firstVCView = self.sourceViewController.view as UIView!
    var secondVCView = self.destinationViewController.view as UIView!
 
    // Get the screen width and height.
    let screenWidth = UIScreen.mainScreen().bounds.size.width
    let screenHeight = UIScreen.mainScreen().bounds.size.height
 
    // Specify the initial position of the destination view.
    secondVCView.frame = CGRectMake(0.0, screenHeight, screenWidth, screenHeight)
 
    // Access the app's key window and insert the destination view above the current (source) one.
    let window = UIApplication.sharedApplication().keyWindow
    window?.insertSubview(secondVCView, aboveSubview: firstVCView)
 
    // Animate the transition.
    UIView.animateWithDuration(0.4, animations: { () -> Void in
        firstVCView.frame = CGRectOffset(firstVCView.frame, 0.0, -screenHeight)
        secondVCView.frame = CGRectOffset(secondVCView.frame, 0.0, -screenHeight)
 
        }) { (Finished) -> Void in
            self.sourceViewController.presentViewController(self.destinationViewController as UIViewController,
                animated: false,
                completion: nil)
    }
 
}

override func perform() {
    // Assign the source and destination views to local variables.
    var secondVCView = self.sourceViewController.view as UIView!
    var firstVCView = self.destinationViewController.view as UIView!
 
    let screenHeight = UIScreen.mainScreen().bounds.size.height
 
    let window = UIApplication.sharedApplication().keyWindow
    window?.insertSubview(firstVCView, aboveSubview: secondVCView)
 
    // Animate the transition.
    UIView.animateWithDuration(0.4, animations: { () -> Void in
        firstVCView.frame = CGRectOffset(firstVCView.frame, 0.0, screenHeight)
        secondVCView.frame = CGRectOffset(secondVCView.frame, 0.0, screenHeight)
 
        }) { (Finished) -> Void in
 
            self.sourceViewController.dismissViewControllerAnimated(false, completion: nil)
    }
}

第二种实现自定义segue的做法是自定义一个navigationcontroller,覆盖如下方法:

- (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier {
    return [UIStoryboardSegue segueWithIdentifier:identifier source:fromViewController destination:toViewController performHandler:^{
        UIView *fromView = fromViewController.view;
        UIView *toView = toViewController.view;
        UIView *containerView = fromView.superview;
        NSTimeInterval duration = 1.0;
        CGRect initialFrame = fromView.frame;
        CGRect offscreenRect = initialFrame;
        offscreenRect.origin.x -= CGRectGetWidth(initialFrame);
        toView.frame = offscreenRect;
        [containerView addSubview:toView];
        // Animate the view onscreen
        [UIView animateWithDuration:duration
                              delay:0
             usingSpringWithDamping:0.5
              initialSpringVelocity:4.0
                            options:0
                         animations: ^{
                             toView.frame = initialFrame;
                         } completion: ^(BOOL finished) {
                    [toView removeFromSuperview];
                    [toViewController.navigationController popToViewController:toViewController animated:NO];
                }];
    }];
}

获取unwind的数据,通过在源控制器中加入一个自定义的方法,记住方法的返回值需要是IBAction,参数必须是UIStoryboardSegue类型

@implementation OneViewController
-(IBAction)prepareForUnwind:(UIStoryboardSegue *)segue {
    if ([segue.identifier isEqualToString:@"unwindToViewController1"]) {
        ThreeViewController *threeVC = (ThreeViewController *)segue.sourceViewController;
        NSLog(@"Violets are %@", threeVC.violetsAreColor);
    }
}
@end
emacs
GCD

http://www.olinone.com/?p=250

Autolayout

https://github.com/smileyborg/UIView-AutoLayout/wiki/Tips-and-Tricks
http://nshint.io/blog/2015/08/17/autolayout-breakpoints/

UIAnimation

http://nshint.io/blog/2015/06/23/toggle-slow-animations/

疑难杂症

UIViewController

git

kSecAttrSynchronizable使用:

javascript core:

NSURLSession:

IAP Auto-renewable Subscriptions:

对于可续订的内购商品,如果用户购买了一个一年的商品,该商品含有一个月的试用期限,那么当用户购买后,会产生一条发票记录,如下:
{
"expires_date" = "2015-08-04 09:08:48 Etc/GMT";
"expires_date_ms" = 1438679328000;
"expires_date_pst" = "2015-08-04 02:08:48 America/Los_Angeles";
"is_trial_period" = false;
"original_purchase_date" = "2015-08-04 09:03:48 Etc/GMT";
"original_purchase_date_ms" = 1438679028000;
"original_purchase_date_pst" = "2015-08-04 02:03:48 America/Los_Angeles";
"original_transaction_id" = 1000000166210549;
"product_id" = "com.bsn.mercurypro.yearft";
"purchase_date" = "2015-08-04 09:03:48 Etc/GMT";
"purchase_date_ms" = 1438679028000;
"purchase_date_pst" = "2015-08-04 02:03:48 America/Los_Angeles";
quantity = 1;
"transaction_id" = 1000000166210549;
"web_order_line_item_id" = 1000000030247637;
}
该记录包含了5分钟的区间,也就是对应实际时间一个月,如果一个月内用户没有取消订阅,那么5分钟后,会产生一条新的关于一年订阅的发票信息。如果用户在一个月内取消了,则不会继续产生一年的发票信息。

![R7F53}8U]DLE@`%EX97FEGT副本.jpg](http://upload-images.jianshu.io/upload_images/276552-3fc29d06075f7add.jpg?imageMogr2/auto-orient/strip|imageView2/2/w/1240)

NSNotification

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 20.0px; font: 13.0px Helvetica; color: #323333}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 20.0px; font: 13.0px Helvetica; color: #323333; min-height: 16.0px}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 20.0px; font: 13.0px 'Heiti SC Light'; color: #323333}span.s1 {font: 13.0px 'Heiti SC Light'}span.s2 {font: 13.0px Helvetica}span.Apple-tab-span {white-space:pre}

一.看coredata视频 11:30之前

Core Data优化调试建议:
1.只提取10个或者可见区域内需要的对象
2.尽可能不要将所有对象都提取出来
3.使用fetch batch size为20
4.将BLOB数据放在一个单独的实体中
5.使用预提取 prefetch: [fetchRequest setRelationshipKeyPathsForPrefetching:@[@“subItems”]];
6.单独为在实体上创建一个缓存缩略图
7.当本地数据和远程传回的JSON数据进行同步时候,
坏的做法:每次取出JSON字典中的一个元素,查询本地数据是否存在,如果没有插入,有的话就取出更新。本地数据较多时,查询的时间就非常大。
好的做法:在执行动作之前,先将本地数据和JSON字典中的元素ID号排序,然后通过ID号按序枚举,如果本地存在,则更新,无则插入
8.成批的导入数据,而不是一股脑的全部灌入内存
9.将对象转为fault状态,通过在调用[context refreshObject:object mergeChanges:YES];将当前不需要的对象移除内存。
10.配置提取请求返回字典:[request setResutlType:NSDictionaryResultType];
11.只提取需要的属性字段,通过调用[request setPropertiesToFetch:@[@“magnitude”]];
12.使用NSExpression执行计算
13.NSPredicate表达式依次升高:Beginswith,EndWith,Equality,Contains,Matches,[cd]会更加耗时。

二.自动布局看完:12点到4点

  1. 应对屏幕不同尺寸和不同方向的变化
  2. 某些语言的拼写顺序额并不是从左到右,像德语和阿拉伯语
  3. 根据内容的尺寸控制控件的大小

constraint = [NSLayoutConstraint constraintWithItem:button1 attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0f
constant:-20.0f];
[self.view addConstraint:constraint];

A= B*m + C;

3.设计模式:晚上
iOS开发中用过哪些设计模式:
1.创建类型的:单例和抽象工厂
2.结构化类型的:MVC,装饰着,适配器,外观以及组合
3.行为类型:观察者,备忘录,责任链和命令

  1. 今天回去的两件事情:设计模式和autolayout,常用的那些设计模式,都用在什么场景。自动布局用过吗?怎么用的?iOS 7中自动布局的变化

  2. cocoachina的版主大大总结的面试题以及cocoachian中的面试题分享的

  3. iOS引入了那些新功能,列举8个点:
    UIKit 物理引擎
    集成javascript到本地app
    后台下载NSURLSession
    自定义视图控制器过渡
    新的地图
    新的自动布局
    新的单元测试框架
    AirDrop

2013 WWDC问题:
http://adcdownload.apple.com//videos/wwdc_2012__hd/session_407__adopting_storyboards_in_your_app.mov
http://adcdownload.apple.com//videos/wwdc_2012__hd/session_214__core_data_best_practices.mov
http://adcdownload.apple.com//videos/wwdc_2012__hd/session_415__debugging_with_lldb.mov
http://adcdownload.apple.com//videos/wwdc_2012__hd/session_211__building_concurrent_user_interfaces_on_ios.mov

void insertSort(int *array, int length) {
for (int i = 1; i < length; i++) {
int j = i;
int temp = array[i];
while (j > 0 && temp < a[j - 1]) {
a[j] = a[j - 1];
j—
}
a[j] = temp;
}
}

看过哪些WWDC视频:
1.优化Core Data

1.高级调试使用LLDB
po [self view];
p self.subviews.count
expr username= @“username”
expr password = @“password”

2.修复内存问题

  1. 节能最佳实践
    4.设计代码为性能 designing code for performance
    5.最佳实践core animation

UIButton的层次结构:
UIButton—>UIControl—>UIView—>UIResponder—>NSObject


静态分析器:

  1. 内存泄露
  2. 僵尸变量
    3.未使用的变量

LLDB:http://my.oschina.net/notting/blog/115294

列举6个常用的Instruments 模板,并说明用处:
Allocations
Leaks
Zoombies
Core Animation
Core Data
Time Profiler
Automation
Time Profiler 时间评测器
反转调用树 invert call tree

KVC实现分析:
当我们为一个类的某个属性添加observer时候,框架自动创建这个类的一个子类,并且修改这个类的isa指向这个新的子类。
由于在ios中函数调用都是转化为isa查表形式,所以这次查得时新的子类的表,
也就是说对类的函数调用被子类给拦截了,在拦截的实现中就可以通知observer了。

修改类的isa被称为isa-swizzling技术。isa-swizzling就是类型混合指针机制。KVC主要通过isa-swizzling,来实现其内部查找定位的。

给图层提供内容有三种方法,一种是直接赋值contents,一种是调用它的代理方法,代理方法有两个,一个是displayLayer,一个是drawLayer:inContext。如果两个代理方法都实现了,只会调用displayLayer方法。

图层的绘图方法:
Ø 如果你的代理实现了displayLayer:方法,实现方法负责创建位图并赋值给contents属性。
Ø 如果你的代理实现的是drawLayer:inContext:方法,Core Animation创建一个位图,创建一个用于绘制位图的上下文,并调用代理方法填充该位图。你的代理方法所要做的是将内容画在图形上下文上。

代理对象必须实现displayLayer:或者drawLayer:inContext方法之一。如果代理对象把这两个方法都实现了,图层只调用displayLayer:方法。

UIGraphicsBeginImageContextWithOptions(size,NO,0)
UIGraphicsGetCurrentContext
CGContextSetLineWidth
CGContextSetLineCap

视图的绘图方法:在- (void) drawRect: (CGRect) rect方法中,直接调用UIGraphicsGetCurrentContext,进行绘图
也可以在任意的一个实例方法中,创建图片上下文UIGraphicsCreateImageContext

路径:UIBizerPath:
UIBezierPath* aPath = [UIBezierPath bezierPath];
[aPath moveToPoint:CGPointMake(100.0, 0.0)];
[aPath addQuadCurveToPoint:CGPointMake(120, 100) controlPoint:CGPointMake(70, 0)];

  • (UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect
  • (UIBezierPath *)bezierPathWithRect:(CGRect)rect

干净内存:框架,可运行的app,内存映射文件
脏内存:堆分配,解压图片,数据库缓存。

ARC:
__bridge只做类型转换,但是不修改对象(内存)管理权;
__bridge_retained(也可以使用CFBridgingRetain)将Objective-C的对象转换为Core Foundation的对象,同时将对象(内存)的管理权交给我们,后续需要使用CFRelease或者相关方法来释放对象;
__bridge_transfer(也可以使用CFBridgingRelease)将Core Foundation的对象转换为Objective-C的对象,同时将对象(内存)的管理权交给ARC。

优化建议:http://xiaojiayi.com/blog/2013/03/06/iose680a7e883bde4bc98e58c96efbc88wwdce7ac94e8aeb0efbc89/ 多看几遍

  1. 使用arc
    2.尽可能设置不透明opacity为YES
    3.不要卡到主线程,CPU密集型操作放在后台执行,模板如下使用GCD:
    dispatch_async(dispatch_get_global_queue(0,0), ^{
    // connect network get something
    dispatch_async(dispatch_get_main_queue(), ^{
    // update UI
    });
    );
  2. 开启GZIP
  3. 对于需要变化的内容,可以考虑使用代码绘制。图片显示之前使用预渲染解压缩图片。
  4. 重用耗时的对象,比如NSDateFormattter
  5. 对设置阴影的情况,设置阴影路径:view.layer.shadowPath = [[UIBezierPath bezierPathWithRect:view.bounds] CGPath];
    8.缓存图片,使用NSURLProtocol或者使用一些第三方的工具类库 SDWebImage
    9.重用耗时创建的对象,比如NSDateFormmtter。
    10.在代码绘制图片时,不要将图片上下文设的过大,1000*1000的图片上下文会占据7MB内存。
    列出几个instruments,你所使用的经历。
    app的五个状态:未启动,闲置,活动,后台,挂起

动态运行时:
调用一个没有实现的方法:首先会调用:,如果没有返回YES,则运行时会再发送一遍动态方法解析消息。如果返回resolveInstanceMethod也没有做方法重定向,就会触发转发调用消息:(void)forwardInvocation:(NSInvocation *)anInvocation;。通常将不能处理的消息转发给其他对象。

@endcode类型编码
@interface Lender : NSObject

@property (nonatomic, copy) NSString *name;

@property (nonatomic, assign) struct LOCATION location;

@property (nonatomic, retain) NSArray *colors;

@property (nonatomic, assign) NSInteger count;

@property (nonatomic, assign) BOOL success;

@property (nonatomic, assign, getter = isSquare) BOOL square;

@property (nonatomic, assign, readonly) NSTimeInterval time;

@property (nonatomic, strong) KivaFeed *kivaFeed;

@property (nonatomic, weak) NSArray<FirstProtocol, SecondProtocol> *lenders;

T@“NSString”,C,N,V_name

T{LOCATION=ff},N,V_locaiton

T@“NSArray”,&,N,V_colors

This is a good day,N,V_count

Tc,N,V_success

Tc,N,GisSquare,V_square

Td,R,N,V_time

T@“KivaFeed”,&,N,V_kivaFeed

T@“NSArray<FirstProtocol><SecondProtocol>”,W,N,V_lenders

*/

消息转发:
class_addMethod([self class], sel, imp, “v@:”);

objc_getAssociatedObject(self.class, &kMapperObjectKey)
objc_setAssociatedObject(
self.class,
&kMapperObjectKey,
mapper,
OBJC_ASSOCIATION_RETAIN // This is atomic
);

    unsigned int propertyCount;
    objc_property_t *properties = class_copyPropertyList(class, &propertyCount);

[self method1];
[self method2];
// 获得方法method,就是用class_getInstantceMeth
Method method1 = class_getInstanceMethod(self.class, @selector(method1));
Method method2 = class_getInstanceMethod(self.class, @selector(method2));
// 获得方法的实现,就是用method_getImplementation
IMP imp1 = method_getImplementation(method1);
IMP imp2 = method_getImplementation(method2);

method_exchangeImplementations(method1, method2);

[self method1];
[self method2];

Method method 1 = class_get_InstanceMethod(self.class, @selector(method1{);
IMP imp = method_getImepletation(method);

Method imageNameMethod = class_getClassMethod(UIImage.class, @selector(imageNamed:));
Method customMethod = class_getClassMethod(self.class, @selector(loadImageFromCurrentFolder:));
method_exchangeImplementations(imageNameMethod, customMethod);

获得属性列表:
objc_property_t *properties = class_copyPropertyList(class, &propertyCount);
const char *propertyName = property_getName(property);
const char *attrs = property_getAttributes(property);

设计模式

自动布局
iOS 7的新特性
iOS面试题
响应链
图层和视图的关系
block内存管理和block的实现
view的层次结构
autorelease 的作用域

__weak, __block实现
block什么时候在栈中,什么时候在堆中

hittest是否了解:
当触击视图上的某一区域,在UIResponder的hitTest:withEvent:实现方法内:
1.首先调用self.pointInside:withEvent方法
2.如果返回NO,hitTest:withEvent:将直接返回nil,方法结束。
3.如果返回YES,则会依次对其所拥有的子视图集合发送hitTest:withEvent:消息。在子视图方法hitTest:withEvent:内同样调用PointInSide方法,如果返回NO,则子视图的hitTest:withEvent:返回nil,如果子视图的PointInSide返回YES,则子视图方法hitTest:withEvent:内会接着调用其所拥有子视图的hitTest:withEvent:方法,以此递归调回下去。直到子视图已经没有子视图集合时,返回子视图本身self。
4.如果遇到一个子视图返回了一个非nil的对象,那么hitTest:withEvent:将会直接返回此对象,方法结束。

hitTest:withEvent:{
BOOL isPointInside = [self pointInside];
if (isPointInside) {
id hitView = nil;
for (UIView *subView in self.subViews) {
hitView = [subView hitTest:withEvent];
if (hitView) return hitView;
}
return self;
} else {
return nil;
}
}

如何扩大子view的点击区域?
UIButton *button = [UIButton buttonWithType: UIButtonTypeCustom];

// set the image size smaller than the size of button (for example 32 x 32)

[button setImage: [UIImage imageNamed: @"buttonIcon.png"] forState: UIControlStateNormal];
// just set the frame of the button (here 64 x 64)
[button setFrame: CGRectMake(xPositionOfMyButton, yPositionOfMyButton, 64, 64)];

【走向平庸的四个特征】一、没目标,只混日子。没方向,不规划人生,瞎折腾。浪费时间二、不独立自主,,不学习不吸收信息,没主见,被动的活着。三、没责任心,没风险意识,不敢承担风险、四、没有投资理财意识。

留下性命来为你做错的事,来向这个世界偿还,因为凡此种种,全是你欠她的,人生从来不容易,但是再不容易也要熬下去。

我知道,你虽然现在已经把东西翻译好了,但是后面几章的质量也是随便糊弄出来的。现在一章一章的贴上去。一方面是为了进行纠正。
你心里还是没底,我到底学到了什么,为什么会这么想,因为你没有真正去练手。继续看

时间抓起来就是黄金,抓不起来就是流水。对读书来说,尤其是如此。早晨早十分钟起床,可以挤这十分钟读书;晚上少看一点电视,翻几页书应该可以做到;节假日休息时,推掉一两个应酬,就有了整块时间。有时候,说一个“不”字,就赢得了读一本书的时间。阅读像爬山,不怕慢,只怕站。谨记,分享!

这是DCCF.ME为你准备的电影周刊。
闲暇时光有我陪伴,DCCF.ME本周好看的电影推荐:

让这些电影治愈你
1、缺乏学习动力:《幸福终点站》、《风雨哈佛路》
2、对爱失望:《偷天情缘》、《初恋50次》
3、自卑失落:《阿甘正传》、《肖申克的救赎》
4、失败或绝望:《铁权男人》、《迫在眉梢》、《伊丽莎白镇》
5、厌倦生活:《在世界的转角遇见爱》、《搏击俱乐部》

最费脑力的14部电影
《盗梦空间》、《记忆裂痕》、《生死停留》、《死亡幻觉》、《禁闭岛》、《穆赫兰道》、《蝴蝶效应》、《恐怖游轮》、《伤城》、《盗走达芬奇》、《88分钟》、《万能钥匙》、《决胜21点》、《沉默的羔羊》

结局最意外的20部电影
《搏击俱乐部》、《迷雾》、《心理游戏》、《第六感》、《蝴蝶效应》、《电锯惊魂》、 《赛末点》、《 穆赫兰道》、《非常嫌疑犯》、《魔术师》、《小岛惊魂》、《万能钥匙》、《火柴人》、《七宗罪》、《魔鬼代言人》、《孤儿》、《八面埋伏 》、《香水》、《偷拐抢骗》

走进12星座女孩内心世界的电影
《情人》白羊
《绿荫下》金牛
《初恋50次》双子
《黑暗中的舞者》巨蟹
《办公室的故事》狮子
《傲慢与偏见》处女
《西西里的美丽传说》天秤
《布达佩斯之恋》天蝎
《艳舞女郎》射手
《杨朵儿》摩羯
《罗丹的情人》水瓶
《天使艾米丽》双鱼

16部讲天才的电影
《美丽心灵》、《雨人》、《波拉克》、《暗物质》、《天才瑞普利》、《猫鼠游戏》、《香水》、《一级恐惧》、《心灵捕手》、《莫扎特传》、《证据》、《海上钢琴师》、《电锯惊魂》、《沉默的羔羊》、《非常嫌疑犯》、《寻找弗罗斯特》

推荐给女人的十部电影
1、《乱世佳人》(坚强)
2、《母女情深》(亲情)
3、《简爱》(尊严)
4、《蒂凡尼的早餐》(虚荣)
5、《白领丽人》(才华)
6、《钢琴课》(沟通)
7、《漂亮女人》(浪漫)
8、《紫色》(苦难)
9、《末路狂花》(女权)
10、《女人那话儿》(性爱)

推荐给男人的十部影片
1、《阿甘正传》(执着)
2、《东方不败》(才华)
3、《美国往事》(人生)
4、《罗马假日》(爱情)
5、《勇敢的心》(勇气)
6、《辛德勒的名单》(责任)
7、《肖申克的救赎》(信念)
8、《E.T》(童心)
9、《现代启示录》(痛苦)
10、《第七封印》(哲思)

推荐给心理爱好者的10部经典电影
《致命ID》多重人格障碍;
《歌西卡》犯罪心理学;
《美国精神病》双重人格;
《钢琴教师》性心理变态;
《美丽心灵》偏执性精神分裂;
《记忆碎片》失忆症;
《蓝丝绒》心理扭曲;
《雨人》自闭症;
《本能》性与暴力;
《沉默的羔羊》变态心理。

最值得欣赏的英式发音电影
《如果能再爱一次》、《成长教育》、《穿越时空爱上你》、《生死朗读》、《猜火车》、《哈利波特》《女王》、《真爱至上》、《恋爱假期》、《诺丁山》、《真爱之吻》、《傲慢与偏见》、《莎翁情史》、《成为简奥斯汀》、《福尔摩斯》、《雾都孤儿》、《兵临城下》、《英国病人》

因为名字烂而被错过的好电影
《三傻大闹宝莱坞》、《刺激1995》、《搏击俱乐部》、《机器人总动员》、《杀死比尔》、 《低俗小说》、《落水狗》、《午夜牛郎》、《洋葱电影》、《蝴蝶效应》、《诺丁山》、《两杆大烟枪》、《摇滚黑帮》、《十诫》

看一场电影。
在20岁的时候,遇见你。与你恋爱。
10年之后,你只能做我的爱人。
有些话,不说出来就能明白。
我们都需要一个爱人,可以安心的在身边入睡。
可以说话,或者相爱。
——DCCF.ME东长村夫

这段时间你需要做的不是胡思乱想学什么web,什么游戏。静下心来边学习iOS,边学习算法,英语就够了。多读书、管理类、经济类、投资类 设计模式+UML

出国,美好的生活,身边的朋友谈论着你不知道的趣事 英语口语,努力努力

https://github.com/xdream86/iOS7-Sampler
学习iOS 7的主要功能:

  1. 包括TextKit
  2. 自动布局
  3. 新的UIKit动力学
  4. iOS 7示例代码
  5. 透明视图 类似podcast
  6. Tintcolor
  7. 自动布局与动画
  8. 将某一个文件恢复到某一个版本

设置渐变色:https://gist.github.com/alanzeino/6619253

这几天一个是忙散项目,一个是要离职,心有点散。博客没写了,胡适鲁迅的书也不读了!当当的书也不买了。晚上回去也就上上网,也不看代码,不关注技术的东西了。希望去了那边,这些习惯带起来。不要瞎想,专注就好。

  1. 上班路上手机放在包里 不能拿在手里
  2. 看MagicalRecord代码
  3. 早上设计模式
    3.晚上衣服一定要洗好

MagicalRecord:
This method will save the child context to the parent context and then the parent context to the persistent store. The save to the parent context will be fast because it is performed within memory.

  1. @interface NSManagedObjectContext (MagicalRecordInternal),
    @interface MagicalRecord (Internal)

  2. NSString * const kMagica

  3. 将MagicalRecord类中特定功能通过MagicalRecod+Actoins/ErrorHandling/Setup/Options/ShorthandSupport/Logging/Options/Deprecated/ShorthandSupport移到单独文件中
    4.__weak static id errorHandlerTarget = nil;
    static SEL errorHandlerAction = nil;

  4. maigicalRecord包含日志系统:

    define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, …) \

    NSLog (frmt, ##VA_ARGS)

  5. 参考的企业级日志系统;CocoaLumberjack

  6. 在MagicalRecord+Options中一些对默认行为的配置,比如是否在model的版本与store的版本不匹配时候,自动删除本地的store,以及默认的日志级别

  7. MagicalRecord对NSManagedObjectModel, NSPersistentStore,NSPersistentStoreCoordinator,NSManagedObjectContext, NSManagedObject进行了增强补充。
    NSManagedObjectModel:设置默认的NSManagedObjectModel,主要是在特定的目录内查找.xcdatamodeld文件,然后生成NSManagedObjectModel。

    • (NSManagedObjectModel *) MR_newManagedObjectModelNamed:(NSString *)modelFileName NS_RETURNS_RETAINED;
  8. 从MyApp.app目录内查找Model.xcdatamodeld文件:
    NSString *path = [[NSBundle mainBundle] pathForResource:[modelName stringByDeletingPathExtension]
    ofType:[modelName pathExtension]
    inDirectory:bundleName];

  9. 在h文件中extern NSString * const kMagicalRecordDefaultStoreFileName;,
    在m文件中NSString * const kMagicalRecordDefaultStoreFileName = @“CoreDataStore.sqlite”;

  10. NSPersistentStore:设置:主要是获取store的URL,通过设置一个xx.sqlite,在目录中查找,返回URL,实现文件中包含了获取Document、Storage目录
    13:MagicalRecord+ShorthandSupport.m中
    13.1:在metaclass中添加类方法,在class中添加实例方法
    Class targetMetaClass = objc_getMetaClass([NSStringFromClass(targetClass) cStringUsingEncoding:NSUTF8StringEncoding]);

    BOOL methodWasAdded = class_addMethod(targetMetaClass, sourceSelector,
    method_getImplementation(targetClassMethod),
    method_getTypeEncoding(targetClassMethod));
    13.2: Class targetMetaClass = objc_getMetaClass([NSStringFromClass(targetClass) cStringUsingEncoding:NSUTF8StringEncoding]);
    // 这里的含义就是交叉调用,使用MR_resolveClassMethod覆盖默认的resolveClassMethod签名实现,这样当系统调用resolveClassMethod,会调用MR_resolveClassMethod
    // 然后将resolveClassMethod的默认实现使用MR_resolveClassMethod替换掉
    // 运行时会先调用resolveClassMethod,因为resolveClassMethod的实现已经被替换成了MR_resolveClassMethod,所以会调用MR_resolveClassMethod的代码,
    // 而在方法代码中,MR_resolveClassMethod会调用默认的resolveClassMethod实现。
    // 从目的上来看,是想将resolveClassMethod调用自定义的MR_resolveClassMethod方法代码。
    BOOL methodWasAdded = class_addMethod(targetMetaClass, sourceSelector,
    method_getImplementation(targetClassMethod),
    method_getTypeEncoding(targetClassMethod));// 这里使用添加代码的目的是为了在自定义的方法代码中,当出现调用
    // MR_resolveClassMethod的情况,自动调用默认的resolveClassMethod,以防止死循环调用。
    查找resolveClassMethod方法,然后如果没有此方法,则将此方法签名前面加上MR_前缀,然后生成方法,将原始没有前缀的方法绑定有MR_的实现。添加到当前的类中。
    因为用户调用的时候,需要自动完成,所以在MagicalRecordShorthand.h中添加了大量的方法预定义,实际的方法并没有实现,而是通过在运行时动态添加。
    在CoreData+MagicalRecord.h中有代码:

    ifdef MR_SHORTHAND

    import “MagicalRecordShorthand.h”

    endif

  11. NSPersistentStoreCoordinator:获取默认的协作器与设置默认的协作器,设置默认协作器时也需要设置默认store。
    创建指定路径下的文件夹。
    // 负责添加store,只在出现因为model的版本不匹配才进行删除store,并重建处理。其过程主要删除之前的.sqlite/.wal/.shm文件。
    // 删除、重建的通知:将要删除store、已经删除store/失败删除store,将要重建store, 已经重建store/失败重建store
    NSPersistentStoreCoordinator.h/m文件主要负责创建协调器,根据store名,以及配置是否一些自动迁移选项。
    15.NSManagedObjectStore,主要是获取store的位置,以及设置store。从文档目录和NSApplicationSupportDirectory目录搜索指定的sqlite

  12. NSManagedObjectContext+MagicalObserving.h/m主要完成对给定上下文的变更通知观察,并执行合并
    17.NSManagedObjectContext (MagicalRecord):使用给定的协作器初始化默认的上下文,包含两个上下文:根上下文和默认上下文,根上下文负责保存并合并到默认上下文
    18.在MagicalRecord+MagicalSaves中:
    关键性方法:- (void) MR_saveWithOptions:(MRSaveContextOptions)mask
    completion:(MRSaveCompletionHandler)completion;
    方法参数保存选项mask有4个选项:无选项0,继续保存父上下文、同步执行保存、同步执行保存除了在根上下文上。如果选择继续保存父上下文,则会递归调用 [[self parentContext] MR_saveWithOptions:mask completion:completion];如果同步执行保存,[self performBlockAndWait:saveBlock];否则调用[self performBlock:saveBlock];。如果设置的是保存除根上下文,则当[[self class] MR_rootSavingContext]为真时,执行performBlock:方法。
    performBlockAndWait的block会在调用该方法的线程上执行,并且该方法支持内嵌
    performBlock放入队列,在一个不确定的时间不确定的线程上被执行,在入队列之后会立即返回,perfromBlockAndWait会在一个不确定的时间,一个完全相同的线程上被执行,方法会在代码被完全执行完之后被返回。
    当调用performBlockAndWait,block会在调用此方法的线程上执行。
    19.NSManagedObjectContext+MagicalObserving,

  • (void) MR_observeContext:(NSManagedObjectContext *)otherContext;
    观察otherContext,如果otherContext发出了了NSManagedObjectContextDidSaveNotification,则执行合并。
  1. NSManagedObject+MagicalRecord.h/m
    主要是获取、按条件获取、获取首个对象,获取指定上下文中的首个对象,创建实体实例、删除实体、按给定的属性列表排序

pragma clang diagnostic push

pragma clang diagnostic ignored “-Wdeprecated-declarations”

return [self MR_executeFetchRequest:request inContext:[NSManagedObjectContext MR_contextForCurrentThread]];

pragma clang diagnostic pop

[NSEntityDescription entityForName:entityName inManagedObjectContext:context];
NSEntityDescription *description = [self MR_entityDescription];
// key:string of property name,value:NSAttributeDescription and/or NSRelationshipDescription.
NSDictionary *propDict = [description propertiesByName];

/创建NSManagedObject/
NSEntityDescription * doctorEntityDescription = [NSEntityDescription entityForName:@“Doctor” inManagedObjectContext:context];
NSManagedObject newDoctor = [[NSManagedObject alloc] initWithEntity:doctorEntityDescription insertIntoManagedObjectContext:context];
/
创建NSManagedObject*/
NSManagedObject *newPatient = [NSEntityDescription insertNewObjectForEntityForName:@“Patient” inManagedObjectContext:context];
[newPatient setValue:@“John” forKey:@“firstName”];
[newPatient setValue:@“Doe” forKey:@“lastName”];
[newPatient setValue:practiceDoctor forKey:@“doctor”];

NSError anyError = nil;
BOOL saveSuccessfully = [context save:&anyError];
if (!saveSuccessfully) {
/
do something with anyError */
}

NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread];
// Create a new Person in the current thread context
Person *person = [Person MR_createInContext:localContext];
person.firstname = firstname;
person.lastname = lastname;
person.age = age;

// Save the modification in the local context
// With MagicalRecords 2.0.8 or newer you should use the MR_saveNestedContexts
[localContext MR_save];
  1. NSManagedObject+MagicalFinder.h/m 主要是提取数据,以及生成NSFetchedResultsControlller
    考虑代码1和代码2的区别,代码2在NSManagedObject中设置了一个类方法,直接生成NSFetchedResultsController
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@“Patient”];
    [request setBatchSize:20];
    NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@“lastName” ascending:YES];
    [request setSortDescriptors:@[sortDescriptor]];
    [sortDescriptor release];

NSFetchedResultsController *newController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
managedObjectContext:context
sectionNameKeyPath:@“doctor.fullName”
cacheName:@“patientsCache”];
与下列代码的区别:

  • (NSFetchedResultsController *) MR_fetchController:(NSFetchRequest *)request
    delegate:(id<NSFetchedResultsControllerDelegate>)delegate
    useFileCache:(BOOL)useFileCache
    groupedBy:(NSString *)groupKeyPath
    inContext:(NSManagedObjectContext *)context;
    阅读该类代码,可以发现,NSManagedObject+MagicalRecord.h/m和NSManagedObject+MagicalRequest.h/m都是为NSManagedObject+MagicalRequest.h/m服务的。
    // 查找第一个,没有就创建一个
  • (instancetype) MR_findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue

if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR

endif

  1. NSManagedObject+MagicalRequests.h/m
    负责生成各式各样的request对象,类似于生成模板化的sql。
    // 创建获取所有实体实例的request
    // 创建获取满足特定条件的request
    // 创建所有满足特定属性的属性值和给定的相同的所有对象的request
    // 创建获取满足条件的第一个对象的request
    // 创建获取满足指定属性的属性值和给定相同的的request第一个对象的request
    // 创建一个拥有特定谓词以及排序方式的返回所有对象的request

  2. NSManagedObject+MagicalAggregation.h/,m

为了不每次称体重的时候纠结
为了遇见 最好的她
为了健康
如果你每次运动只有十五分钟,则烧掉的是糖类,烧不掉脂肪;运动半小时后,才会开始燃烧较多的脂肪。每次运动的时间越久,烧掉的脂肪越多,这是因为连续性运动的主要能源是脂肪而不是糖类。相反的,瞬时爆发性运动的能源是糖类而不是脂肪,故这类运动对减肥没什么帮助
所以每次掐表

control+cmd+j方法声明和方法实现之间跳转
折叠所有方法:command+alt+shift+<-
选中A,然后按住Alt,然后选中B则出现两个页面
Shift+Option+Command+回车 比较文件
键盘上左右侧都有:Shift+Command+Option,Option就是Alt,只有左侧有Control。
fn + Option +↑ 向上翻页
fn +Option+↓ 向下翻页
option+command+回车 显示右侧的辅助窗口
Command+Shift+{ 左侧标签
Command+Shift+} 右侧标签

  1. Command+Y显示历史
    1:command+数字 1-8
    2:展开折叠左侧界面:command+数字0
    3:展开折叠右侧界面:command+option+0
    4: 折叠调试窗口command+Shift+Y
    5:command+shift+2是organizer
    6 command+J 新建编辑区域
    7:command+control+J 跳转到定义
    8: command+shift+j 在项目导航器中选中当前正在被编辑的文件:
    9:command+option+J是执行文件过滤
    10:command+option+L是搜索代码块
    11: command+shift+字母0快速打开文件
    12:command+L定位到行
    13: command+option+数字1-6
    14:command+Control+E 快速编辑,在作用域中编辑
    15: 注销行command+/
    16: 添加断点command+
    16.1 禁用/开启所有断点 command+Y
    17: control+字母I执行代码格式化re-indent(缩排)
    18:control+数字1打开显示相关项目,可以浏览caller
    19:command+K清除控制台信息
    20:command+Shift+K 清理项目
    21 option+command+H 隐藏其他除xcode的窗口
    22 command+control+<- -> 前进后退
    23 command+control+上下键 .h/.m切换
    24 command+R,Command+B command+U command+.运行,构建,单元测试,停止
  2. option+左方向键收起菜单,右方向键展开菜单
  3. command+`(在键盘的左上第二排第一个)在同一个程序中切换窗口
  4. command+M最小化当前窗口
  5. 在keyboard中配置,app shortcuts->标题输入Zoom,快捷键输入control+Command+=最大化窗口
    29.control+command+f进入全屏
    30:control+command+f继续执行断点
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 156,265评论 4 359
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 66,274评论 1 288
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 106,087评论 0 237
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,479评论 0 203
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 51,782评论 3 285
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,218评论 1 207
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,594评论 2 309
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,316评论 0 194
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 33,955评论 1 237
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,274评论 2 240
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 31,803评论 1 255
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,177评论 2 250
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,732评论 3 229
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 25,953评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,687评论 0 192
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,263评论 2 267
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,189评论 2 258

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,083评论 18 139
  • 转至元数据结尾创建: 董潇伟,最新修改于: 十二月 23, 2016 转至元数据起始第一章:isa和Class一....
    40c0490e5268阅读 1,633评论 0 9
  • 就这样一步一步过了这么多年。突然感觉好多事情都不记得了,不记得去年这个时候吃的什么饭,不记得去年这个时候自己在干...
    度暖阅读 264评论 0 1
  • 1. 这边的蚊子很是猖狂,一点儿都不怕人,明目张胆的就开始吸人血了。山倒照样是美的,雨过之后青翠的很,乌云也很有气...
    岸西ONE阅读 346评论 0 0
  • 一天见了一个小女孩给妈妈说,她长大也要打耳洞,戴耳环好漂亮,我听到后笑了。 我小时候也想过打耳洞,但是我有一个超级...
    快乐的嫣红阅读 570评论 6 4