-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
huangyibiao
authored and
huangyibiao
committed
Feb 18, 2016
1 parent
79a1317
commit 8704275
Showing
12 changed files
with
193 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+5.49 KB
(110%)
RuntimeDemo.xcworkspace/xcuserdata/huangyibiao.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
@interface HYBCat : NSObject | ||
|
||
|
||
|
||
+ (void)test; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ - (void)getAllMemberVariables { | |
} | ||
|
||
free(ivars); | ||
|
||
} | ||
|
||
+ (void)test { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// HYBTestEntry.h | ||
// RuntimeDemo | ||
// | ||
// Created by huangyibiao on 16/1/14. | ||
// Copyright © 2016年 huangyibiao. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface HYBTestEntry : NSObject | ||
|
||
+ (void)test; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// HYBTestEntry.m | ||
// RuntimeDemo | ||
// | ||
// Created by huangyibiao on 16/1/14. | ||
// Copyright © 2016年 huangyibiao. All rights reserved. | ||
// | ||
|
||
#import "HYBTestEntry.h" | ||
|
||
@implementation HYBTestEntry | ||
|
||
|
||
+ (void)test { | ||
NSDictionary *originDict = @{@"k1": @"v1", | ||
@"k2": @"v2", | ||
@"k3": @"v3", | ||
@"k4": @"v4", | ||
@"k5": @"v5", | ||
@"k6": @"v6", | ||
@"k7": @"v7", | ||
@"k8": @"v8", | ||
@"k9": @"v9"}; | ||
NSDictionary *paramters = @{@"kk1": @"", | ||
@"kk2": @"vv2"}; | ||
|
||
NSDictionary *resutDict = @{@"k1": @"v1", | ||
@"k2": @"v2", | ||
@"k3": @"v3", | ||
@"k4": @"v4", | ||
@"k5": @"v5", | ||
@"k6": @"v6", | ||
@"k7": @"v7", | ||
@"k8": @"v8", | ||
@"k9": @"v9", | ||
@"kk1": @"", | ||
@"kk2":@"vv2"}; | ||
|
||
for (NSUInteger i = 0; i < 1000000; ++i) { | ||
NSMutableDictionary *allParams = [[NSMutableDictionary alloc] initWithDictionary:paramters]; | ||
[allParams addEntriesFromDictionary:originDict]; | ||
|
||
// 判断是否相等 | ||
if (resutDict.count != allParams.count) { | ||
NSLog(@"merge but it is not equal"); | ||
continue; | ||
} | ||
|
||
for (NSString *key in resutDict.allKeys) { | ||
NSString *value1 = [resutDict objectForKey:key]; | ||
NSString *value2 = [allParams objectForKey:key]; | ||
|
||
if (![value1 isEqualToString:value2]) { | ||
NSLog(@"merge but it is not equal"); | ||
continue; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
|
||
@interface NSArray (Swizzling) | ||
|
||
|
||
@property (nonatomic, weak) id delegate; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters