iOS資料(已讀)

大部分人缺乏一種主動發(fā)掘信息的意識。讀著別人寫好的文字该肴,思考著別人提出的問題情竹,做著別人交代的事情。

https://bitbucket.org/dcutting/verijson

nsurlsession管理并發(fā)請求數目:

首先匀哄,嘗試方法:設置NSURLSessionConfiguration對HTTPMaximumConnectionsPerHost屬性吻氧,發(fā)現問題:如果我入隊列5個任務摊求,前三個在完成了,后兩個任務會超時對待。新的方法:設置nsurlsession的delegateQueue的最大并發(fā)數怕篷,發(fā)現無效, 無效2,所以又去尋找新的方法 方法是使用nsoperartion包裝nsurlsession,雖然nsurlsession有自己的隊列蜘矢,但是你不能對他的并發(fā)數做更改妈候,改了也會被忽略。
最后立哑,使用nsoperation包裝nsurlsession的,見代碼

property.

    • (id)initWithNibName:(NSString *bundle:(NSBundle *)nibBundleOrNil
    • (id)initWithCoder:(NSCoder *)aDecoder
    • (void)awakeFromNib {
      執(zhí)行順序:1夜惭, 2, 3

uiviewcontroller擁有以上三個方法铛绰,uiview沒有第一個方法

  1. 當從storyboard中加載vc時诈茧,initwithcode和awakfromnib被調用,如果從代碼創(chuàng)建vc捂掰, 只有initwithnibname:bundle被調用
  2. 當從storyboard中加載v時敢会,initwithcode和awakfromnib被調用,如果從代碼創(chuàng)建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下創(chuàng)建真機framework
xcodebuild -configuration Release -target "${Target_Name}" -sdk iphoneos clean build

# 在build/Release-iphonesimulator/${Target_Name}.framework下創(chuàng)建模擬器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執(zhí)行push或pop的時候執(zhí)行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的參數旅敷,參數對象可以獲取轉場的畫布生棍,源控制器,目的控制器媳谁。

在交互驅動轉場回退過程中涂滴,同樣執(zhí)行navigationcontroller的代理方法:

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

方法需要返回一個實現了UIViewControllerInteractiveTransitioning協議的對象,通常這個對象是UIPercentDrivenInteractiveTransition對象

以上是navigationcontroller的轉場晴音,下面是模態(tài)的轉場柔纵。
模態(tài)轉場從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;

自定義模態(tài)的一個案例:

- (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:

對于可續(xù)訂的內購商品,如果用戶購買了一個一年的商品椒振,該商品含有一個月的試用期限昭伸,那么當用戶購買后,會產生一條發(fā)票記錄澎迎,如下:
{
"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分鐘的區(qū)間庐杨,也就是對應實際時間一個月,如果一個月內用戶沒有取消訂閱嗡善,那么5分鐘后辑莫,會產生一條新的關于一年訂閱的發(fā)票信息。如果用戶在一個月內取消了罩引,則不會繼續(xù)產生一年的發(fā)票信息。

![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優(yōu)化調試建議:
1.只提取10個或者可見區(qū)域內需要的對象
2.盡可能不要將所有對象都提取出來
3.使用fetch batch size為20
4.將BLOB數據放在一個單獨的實體中
5.使用預提取 prefetch: [fetchRequest setRelationshipKeyPathsForPrefetching:@[@“subItems”]];
6.單獨為在實體上創(chuàng)建一個緩存縮略圖
7.當本地數據和遠程傳回的JSON數據進行同步時候枝笨,
壞的做法:每次取出JSON字典中的一個元素袁铐,查詢本地數據是否存在,如果沒有插入横浑,有的話就取出更新剔桨。本地數據較多時,查詢的時間就非常大徙融。
好的做法:在執(zhí)行動作之前洒缀,先將本地數據和JSON字典中的元素ID號排序,然后通過ID號按序枚舉,如果本地存在树绩,則更新萨脑,無則插入
8.成批的導入數據,而不是一股腦的全部灌入內存
9.將對象轉為fault狀態(tài)饺饭,通過在調用[context refreshObject:object mergeChanges:YES];將當前不需要的對象移除內存渤早。
10.配置提取請求返回字典:[request setResutlType:NSDictionaryResultType];
11.只提取需要的屬性字段,通過調用[request setPropertiesToFetch:@[@“magnitude”]];
12.使用NSExpression執(zhí)行計算
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開發(fā)中用過哪些設計模式:
1.創(chuàng)建類型的:單例和抽象工廠
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.優(yōu)化Core Data

1.高級調試使用LLDB
po [self view];
p self.subviews.count
expr username= @“username”
expr password = @“password”

2.修復內存問題

  1. 節(jié)能最佳實踐
    4.設計代碼為性能 designing code for performance
    5.最佳實踐core animation

UIButton的層次結構:
UIButton—>UIControl—>UIView—>UIResponder—>NSObject


靜態(tài)分析器:

  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實現分析:
當我們?yōu)橐粋€類的某個屬性添加observer時候筐钟,框架自動創(chuàng)建這個類的一個子類,并且修改這個類的isa指向這個新的子類赋朦。
由于在ios中函數調用都是轉化為isa查表形式篓冲,所以這次查得時新的子類的表,
也就是說對類的函數調用被子類給攔截了宠哄,在攔截的實現中就可以通知observer了壹将。

修改類的isa被稱為isa-swizzling技術。isa-swizzling就是類型混合指針機制毛嫉。KVC主要通過isa-swizzling诽俯,來實現其內部查找定位的。

給圖層提供內容有三種方法承粤,一種是直接賦值contents暴区,一種是調用它的代理方法,代理方法有兩個辛臊,一個是displayLayer仙粱,一個是drawLayer:inContext。如果兩個代理方法都實現了彻舰,只會調用displayLayer方法伐割。

圖層的繪圖方法:
? 如果你的代理實現了displayLayer:方法候味,實現方法負責創(chuàng)建位圖并賦值給contents屬性。
? 如果你的代理實現的是drawLayer:inContext:方法隔心,Core Animation創(chuàng)建一個位圖白群,創(chuàng)建一個用于繪制位圖的上下文,并調用代理方法填充該位圖济炎。你的代理方法所要做的是將內容畫在圖形上下文上川抡。

代理對象必須實現displayLayer:或者drawLayer:inContext方法之一。如果代理對象把這兩個方法都實現了须尚,圖層只調用displayLayer:方法崖堤。

UIGraphicsBeginImageContextWithOptions(size,NO,0)
UIGraphicsGetCurrentContext
CGContextSetLineWidth
CGContextSetLineCap

視圖的繪圖方法:在- (void) drawRect: (CGRect) rect方法中,直接調用UIGraphicsGetCurrentContext耐床,進行繪圖
也可以在任意的一個實例方法中密幔,創(chuàng)建圖片上下文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的對象皆串,同時將對象(內存)的管理權交給我們淹办,后續(xù)需要使用CFRelease或者相關方法來釋放對象;
__bridge_transfer(也可以使用CFBridgingRelease)將Core Foundation的對象轉換為Objective-C的對象恶复,同時將對象(內存)的管理權交給ARC怜森。

優(yōu)化建議:http://xiaojiayi.com/blog/2013/03/06/iose680a7e883bde4bc98e58c96efbc88wwdce7ac94e8aeb0efbc89/ 多看幾遍

  1. 使用arc
    2.盡可能設置不透明opacity為YES
    3.不要卡到主線程,CPU密集型操作放在后臺執(zhí)行谤牡,模板如下使用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.重用耗時創(chuàng)建的對象流纹,比如NSDateFormmtter。
    10.在代碼繪制圖片時违诗,不要將圖片上下文設的過大,1000*1000的圖片上下文會占據7MB內存疮蹦。
    列出幾個instruments诸迟,你所使用的經歷。
    app的五個狀態(tài):未啟動,閑置阵苇,活動壁公,后臺,掛起

動態(tài)運行時:
調用一個沒有實現的方法:首先會調用:绅项,如果沒有返回YES紊册,則運行時會再發(fā)送一遍動態(tài)方法解析消息。如果返回resolveInstanceMethod也沒有做方法重定向快耿,就會觸發(fā)轉發(fā)調用消息:(void)forwardInvocation:(NSInvocation *)anInvocation囊陡;。通常將不能處理的消息轉發(fā)給其他對象掀亥。

@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

*/

消息轉發(fā):
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是否了解:
當觸擊視圖上的某一區(qū)域遏片,在UIResponder的hitTest:withEvent:實現方法內:
1.首先調用self.pointInside:withEvent方法
2.如果返回NO,hitTest:withEvent:將直接返回nil撮竿,方法結束吮便。
3.如果返回YES,則會依次對其所擁有的子視圖集合發(fā)送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的點擊區(qū)域续扔?
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)];

【走向平庸的四個特征】一攻臀、沒目標,只混日子纱昧。沒方向刨啸,不規(guī)劃人生,瞎折騰识脆。浪費時間二设联、不獨立自主善已,,不學習不吸收信息离例,沒主見换团,被動的活著。三宫蛆、沒責任心艘包,沒風險意識,不敢承擔風險耀盗、四想虎、沒有投資理財意識。

留下性命來為你做錯的事袍冷,來向這個世界償還磷醋,因為凡此種種,全是你欠她的胡诗,人生從來不容易邓线,但是再不容易也要熬下去。

我知道煌恢,你雖然現在已經把東西翻譯好了骇陈,但是后面幾章的質量也是隨便糊弄出來的。現在一章一章的貼上去瑰抵。一方面是為了進行糾正你雌。
你心里還是沒底,我到底學到了什么二汛,為什么會這么想婿崭,因為你沒有真正去練手。繼續(xù)看

時間抓起來就是黃金肴颊,抓不起來就是流水氓栈。對讀書來說,尤其是如此婿着。早晨早十分鐘起床授瘦,可以擠這十分鐘讀書;晚上少看一點電視竟宋,翻幾頁書應該可以做到提完;節(jié)假日休息時,推掉一兩個應酬丘侠,就有了整塊時間徒欣。有時候,說一個“不”字蜗字,就贏得了讀一本書的時間帚称。閱讀像爬山览徒,不怕慢迷雪,只怕站。謹記梧奢,分享担神!

這是DCCF.ME為你準備的電影周刊楼吃。
閑暇時光有我陪伴,DCCF.ME本周好看的電影推薦:

讓這些電影治愈你
1妄讯、缺乏學習動力:《幸福終點站》孩锡、《風雨哈佛路》
2、對愛失望:《偷天情緣》亥贸、《初戀50次》
3躬窜、自卑失落:《阿甘正傳》、《肖申克的救贖》
4炕置、失敗或絕望:《鐵權男人》荣挨、《迫在眉梢》、《伊麗莎白鎮(zhèn)》
5朴摊、厭倦生活:《在世界的轉角遇見愛》默垄、《搏擊俱樂部》

最費腦力的14部電影
《盜夢空間》、《記憶裂痕》甚纲、《生死停留》口锭、《死亡幻覺》、《禁閉島》介杆、《穆赫蘭道》鹃操、《蝴蝶效應》、《恐怖游輪》春哨、《傷城》荆隘、《盜走達芬奇》、《88分鐘》悲靴、《萬能鑰匙》臭胜、《決勝21點》、《沉默的羔羊》

結局最意外的20部電影
《搏擊俱樂部》癞尚、《迷霧》耸三、《心理游戲》、《第六感》浇揩、《蝴蝶效應》仪壮、《電鋸驚魂》、 《賽末點》胳徽、《 穆赫蘭道》积锅、《非常嫌疑犯》爽彤、《魔術師》、《小島驚魂》缚陷、《萬能鑰匙》适篙、《火柴人》、《七宗罪》箫爷、《魔鬼代言人》嚷节、《孤兒》、《八面埋伏 》虎锚、《香水》硫痰、《偷拐搶騙》

走進12星座女孩內心世界的電影
《情人》白羊
《綠蔭下》金牛
《初戀50次》雙子
《黑暗中的舞者》巨蟹
《辦公室的故事》獅子
《傲慢與偏見》處女
《西西里的美麗傳說》天秤
《布達佩斯之戀》天蝎
《艷舞女郎》射手
《楊朵兒》摩羯
《羅丹的情人》水瓶
《天使艾米麗》雙魚

16部講天才的電影
《美麗心靈》、《雨人》窜护、《波拉克》效斑、《暗物質》、《天才瑞普利》柱徙、《貓鼠游戲》缓屠、《香水》、《一級恐懼》坐搔、《心靈捕手》藏研、《莫扎特傳》、《證據》概行、《海上鋼琴師》蠢挡、《電鋸驚魂》、《沉默的羔羊》凳忙、《非常嫌疑犯》业踏、《尋找弗羅斯特》

推薦給女人的十部電影
1、《亂世佳人》(堅強)
2涧卵、《母女情深》(親情)
3勤家、《簡愛》(尊嚴)
4、《蒂凡尼的早餐》(虛榮)
5柳恐、《白領麗人》(才華)
6伐脖、《鋼琴課》(溝通)
7、《漂亮女人》(浪漫)
8乐设、《紫色》(苦難)
9讼庇、《末路狂花》(女權)
10、《女人那話兒》(性愛)

推薦給男人的十部影片
1近尚、《阿甘正傳》(執(zhí)著)
2蠕啄、《東方不敗》(才華)
3、《美國往事》(人生)
4、《羅馬假日》(愛情)
5歼跟、《勇敢的心》(勇氣)
6和媳、《辛德勒的名單》(責任)
7、《肖申克的救贖》(信念)
8哈街、《E.T》(童心)
9留瞳、《現代啟示錄》(痛苦)
10、《第七封印》(哲思)

推薦給心理愛好者的10部經典電影
《致命ID》多重人格障礙叹卷;
《歌西卡》犯罪心理學撼港;
《美國精神病》雙重人格;
《鋼琴教師》性心理變態(tài)骤竹;
《美麗心靈》偏執(zhí)性精神分裂;
《記憶碎片》失憶癥往毡;
《藍絲絨》心理扭曲蒙揣;
《雨人》自閉癥;
《本能》性與暴力开瞭;
《沉默的羔羊》變態(tài)心理懒震。

最值得欣賞的英式發(fā)音電影
《如果能再愛一次》、《成長教育》嗤详、《穿越時空愛上你》个扰、《生死朗讀》、《猜火車》葱色、《哈利波特》《女王》递宅、《真愛至上》、《戀愛假期》苍狰、《諾丁山》办龄、《真愛之吻》、《傲慢與偏見》淋昭、《莎翁情史》俐填、《成為簡奧斯汀》、《福爾摩斯》翔忽、《霧都孤兒》英融、《兵臨城下》、《英國病人》

因為名字爛而被錯過的好電影
《三傻大鬧寶萊塢》歇式、《刺激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包含日志系統(tǒng):

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

    NSLog (frmt, ##VA_ARGS)

  5. 參考的企業(yè)級日志系統(tǒng);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簽名實現峦耘,這樣當系統(tǒng)調用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妨马,以防止死循環(huán)調用挺举。
    查找resolveClassMethod方法,然后如果沒有此方法烘跺,則將此方法簽名前面加上MR_前綴湘纵,然后生成方法,將原始沒有前綴的方法綁定有MR_的實現滤淳。添加到當前的類中梧喷。
    因為用戶調用的時候,需要自動完成,所以在MagicalRecordShorthand.h中添加了大量的方法預定義铺敌,實際的方法并沒有實現汇歹,而是通過在運行時動態(tài)添加。
    在CoreData+MagicalRecord.h中有代碼:

    ifdef MR_SHORTHAND

    import “MagicalRecordShorthand.h”

    endif

  11. NSPersistentStoreCoordinator:獲取默認的協作器與設置默認的協作器适刀,設置默認協作器時也需要設置默認store秤朗。
    創(chuàng)建指定路徑下的文件夾。
    // 負責添加store笔喉,只在出現因為model的版本不匹配才進行刪除store取视,并重建處理。其過程主要刪除之前的.sqlite/.wal/.shm文件常挚。
    // 刪除作谭、重建的通知:將要刪除store、已經刪除store/失敗刪除store奄毡,將要重建store折欠, 已經重建store/失敗重建store
    NSPersistentStoreCoordinator.h/m文件主要負責創(chuàng)建協調器,根據store名吼过,以及配置是否一些自動遷移選項锐秦。
    15.NSManagedObjectStore,主要是獲取store的位置盗忱,以及設置store酱床。從文檔目錄和NSApplicationSupportDirectory目錄搜索指定的sqlite

  12. NSManagedObjectContext+MagicalObserving.h/m主要完成對給定上下文的變更通知觀察,并執(zhí)行合并
    17.NSManagedObjectContext (MagicalRecord):使用給定的協作器初始化默認的上下文趟佃,包含兩個上下文:根上下文和默認上下文扇谣,根上下文負責保存并合并到默認上下文
    18.在MagicalRecord+MagicalSaves中:
    關鍵性方法:- (void) MR_saveWithOptions:(MRSaveContextOptions)mask
    completion:(MRSaveCompletionHandler)completion;
    方法參數保存選項mask有4個選項:無選項0,繼續(xù)保存父上下文闲昭、同步執(zhí)行保存罐寨、同步執(zhí)行保存除了在根上下文上。如果選擇繼續(xù)保存父上下文序矩,則會遞歸調用 [[self parentContext] MR_saveWithOptions:mask completion:completion];如果同步執(zhí)行保存鸯绿,[self performBlockAndWait:saveBlock];否則調用[self performBlock:saveBlock];。如果設置的是保存除根上下文贮泞,則當[[self class] MR_rootSavingContext]為真時楞慈,執(zhí)行performBlock:方法。
    performBlockAndWait的block會在調用該方法的線程上執(zhí)行啃擦,并且該方法支持內嵌
    performBlock放入隊列囊蓝,在一個不確定的時間不確定的線程上被執(zhí)行,在入隊列之后會立即返回令蛉,perfromBlockAndWait會在一個不確定的時間聚霜,一個完全相同的線程上被執(zhí)行狡恬,方法會在代碼被完全執(zhí)行完之后被返回。
    當調用performBlockAndWait,block會在調用此方法的線程上執(zhí)行蝎宇。
    19.NSManagedObjectContext+MagicalObserving弟劲,

  • (void) MR_observeContext:(NSManagedObjectContext *)otherContext;
    觀察otherContext,如果otherContext發(fā)出了了NSManagedObjectContextDidSaveNotification姥芥,則執(zhí)行合并兔乞。
  1. NSManagedObject+MagicalRecord.h/m
    主要是獲取、按條件獲取凉唐、獲取首個對象庸追,獲取指定上下文中的首個對象,創(chuàng)建實體實例台囱、刪除實體淡溯、按給定的屬性列表排序

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];

/創(chuàng)建NSManagedObject/
NSEntityDescription * doctorEntityDescription = [NSEntityDescription entityForName:@“Doctor” inManagedObjectContext:context];
NSManagedObject newDoctor = [[NSManagedObject alloc] initWithEntity:doctorEntityDescription insertIntoManagedObjectContext:context];
/
創(chuàng)建NSManagedObject*/
NSManagedObject *newPatient = [NSEntityDescription insertNewObjectForEntityForName:@“Patient” inManagedObjectContext:context];
[newPatient setValue:@“John” forKey:@“firstName”];
[newPatient setValue:@“Doe” forKey:@“l(fā)astName”];
[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的區(qū)別咱娶,代碼2在NSManagedObject中設置了一個類方法,直接生成NSFetchedResultsController
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@“Patient”];
    [request setBatchSize:20];
    NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@“l(fā)astName” ascending:YES];
    [request setSortDescriptors:@[sortDescriptor]];
    [sortDescriptor release];

NSFetchedResultsController *newController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
managedObjectContext:context
sectionNameKeyPath:@“doctor.fullName”
cacheName:@“patientsCache”];
與下列代碼的區(qū)別:

  • (NSFetchedResultsController *) MR_fetchController:(NSFetchRequest *)request
    delegate:(id<NSFetchedResultsControllerDelegate>)delegate
    useFileCache:(BOOL)useFileCache
    groupedBy:(NSString *)groupKeyPath
    inContext:(NSManagedObjectContext *)context;
    閱讀該類代碼强品,可以發(fā)現膘侮,NSManagedObject+MagicalRecord.h/m和NSManagedObject+MagicalRequest.h/m都是為NSManagedObject+MagicalRequest.h/m服務的澄暮。
    // 查找第一個项鬼,沒有就創(chuàng)建一個
  • (instancetype) MR_findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue

if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR

endif

  1. NSManagedObject+MagicalRequests.h/m
    負責生成各式各樣的request對象,類似于生成模板化的sql佣赖。
    // 創(chuàng)建獲取所有實體實例的request
    // 創(chuàng)建獲取滿足特定條件的request
    // 創(chuàng)建所有滿足特定屬性的屬性值和給定的相同的所有對象的request
    // 創(chuàng)建獲取滿足條件的第一個對象的request
    // 創(chuàng)建獲取滿足指定屬性的屬性值和給定相同的的request第一個對象的request
    // 創(chuàng)建一個擁有特定謂詞以及排序方式的返回所有對象的request

  2. NSManagedObject+MagicalAggregation.h/,m

為了不每次稱體重的時候糾結
為了遇見 最好的她
為了健康
如果你每次運動只有十五分鐘困曙,則燒掉的是糖類,燒不掉脂肪谦去;運動半小時后慷丽,才會開始燃燒較多的脂肪。每次運動的時間越久鳄哭,燒掉的脂肪越多要糊,這是因為連續(xù)性運動的主要能源是脂肪而不是糖類。相反的妆丘,瞬時爆發(fā)性運動的能源是糖類而不是脂肪锄俄,故這類運動對減肥沒什么幫助
所以每次掐表

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 新建編輯區(qū)域
    7:command+control+J 跳轉到定義
    8: command+shift+j 在項目導航器中選中當前正在被編輯的文件:
    9:command+option+J是執(zhí)行文件過濾
    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執(zhí)行代碼格式化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繼續(xù)執(zhí)行斷點
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
  • 序言:七十年代末扇单,一起剝皮案震驚了整個濱河市商模,隨后出現的幾起案子,更是在濱河造成了極大的恐慌蜘澜,老刑警劉巖施流,帶你破解...
    沈念sama閱讀 216,402評論 6 499
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現場離奇詭異兼都,居然都是意外死亡嫂沉,警方通過查閱死者的電腦和手機,發(fā)現死者居然都...
    沈念sama閱讀 92,377評論 3 392
  • 文/潘曉璐 我一進店門扮碧,熙熙樓的掌柜王于貴愁眉苦臉地迎上來趟章,“玉大人,你說我怎么就攤上這事慎王◎就粒” “怎么了?”我有些...
    開封第一講書人閱讀 162,483評論 0 353
  • 文/不壞的土叔 我叫張陵赖淤,是天一觀的道長蜀漆。 經常有香客問我,道長咱旱,這世上最難降的妖魔是什么确丢? 我笑而不...
    開封第一講書人閱讀 58,165評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮吐限,結果婚禮上鲜侥,老公的妹妹穿的比我還像新娘。我一直安慰自己诸典,他們只是感情好描函,可當我...
    茶點故事閱讀 67,176評論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著狐粱,像睡著了一般舀寓。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上肌蜻,一...
    開封第一講書人閱讀 51,146評論 1 297
  • 那天互墓,我揣著相機與錄音,去河邊找鬼宋欺。 笑死轰豆,一個胖子當著我的面吹牛胰伍,可吹牛的內容都是我干的。 我是一名探鬼主播酸休,決...
    沈念sama閱讀 40,032評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼骂租,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了斑司?” 一聲冷哼從身側響起渗饮,我...
    開封第一講書人閱讀 38,896評論 0 274
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎宿刮,沒想到半個月后互站,有當地人在樹林里發(fā)現了一具尸體,經...
    沈念sama閱讀 45,311評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡僵缺,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,536評論 2 332
  • 正文 我和宋清朗相戀三年胡桃,在試婚紗的時候發(fā)現自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片磕潮。...
    茶點故事閱讀 39,696評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡翠胰,死狀恐怖,靈堂內的尸體忽然破棺而出自脯,到底是詐尸還是另有隱情之景,我是刑警寧澤,帶...
    沈念sama閱讀 35,413評論 5 343
  • 正文 年R本政府宣布膏潮,位于F島的核電站锻狗,受9級特大地震影響,放射性物質發(fā)生泄漏焕参。R本人自食惡果不足惜轻纪,卻給世界環(huán)境...
    茶點故事閱讀 41,008評論 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望叠纷。 院中可真熱鬧桐磁,春花似錦、人聲如沸讲岁。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽缓艳。三九已至,卻和暖如春看峻,著一層夾襖步出監(jiān)牢的瞬間阶淘,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,815評論 1 269
  • 我被黑心中介騙來泰國打工互妓, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留坤塞,地道東北人。 一個月前我還...
    沈念sama閱讀 47,698評論 2 368
  • 正文 我出身青樓宛瞄,卻偏偏與公主長得像浮禾,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子份汗,可洞房花燭夜當晚...
    茶點故事閱讀 44,592評論 2 353

推薦閱讀更多精彩內容

  • Spring Cloud為開發(fā)人員提供了快速構建分布式系統(tǒng)中一些常見模式的工具(例如配置管理盈电,服務發(fā)現,斷路器,智...
    卡卡羅2017閱讀 134,651評論 18 139
  • 轉至元數據結尾創(chuàng)建: 董瀟偉旁钧,最新修改于: 十二月 23, 2016 轉至元數據起始第一章:isa和Class一....
    40c0490e5268閱讀 1,709評論 0 9
  • 就這樣一步一步過了這么多年吸重。突然感覺好多事情都不記得了,不記得去年這個時候吃的什么飯彤委,不記得去年這個時候自己在干...
    度暖閱讀 287評論 0 1
  • 1. 這邊的蚊子很是猖狂鞭铆,一點兒都不怕人,明目張膽的就開始吸人血了焦影。山倒照樣是美的车遂,雨過之后青翠的很,烏云也很有氣...
    岸西ONE閱讀 372評論 0 0
  • 一天見了一個小女孩給媽媽說斯辰,她長大也要打耳洞舶担,戴耳環(huán)好漂亮,我聽到后笑了彬呻。 我小時候也想過打耳洞衣陶,但是我有一個超級...
    快樂的嫣紅閱讀 602評論 6 4