This file contains hidden or 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
debugLog:function (message) { | |
if (Constants.DEBUG){ | |
if(console){ | |
// 获取调用函数的人 并插在第一个 | |
let callee = arguments.callee.caller.toString(); | |
var mainArguments = Array.prototype.slice.call(arguments); | |
mainArguments.unshift(callee); | |
console.log.apply(console, mainArguments); | |
} |
This file contains hidden or 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
// file location | |
// node_module/react-native/local-cli/server/runServer.js | |
function runServer(args, config, readyCallback) { | |
var wsProxy = null; | |
const packagerServer = getPackagerServer(args, config); | |
const app = connect() | |
.use(loadRawBodyMiddleware) | |
.use(connect.compress()) | |
.use(getDevToolsMiddleware(args, () => wsProxy && wsProxy.isChromeConnected())) | |
.use(openStackFrameInEditorMiddleware) |
This file contains hidden or 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
// file location: | |
// node_modules/react-native/local-cli/server/util/debuggerWorker.js | |
var messageHandlers = { | |
'executeApplicationScript': function(message, sendReply) { | |
for (var key in message.inject) { | |
self[key] = JSON.parse(message.inject[key]); | |
} | |
importScripts(message.url); | |
sendReply(); | |
} |
This file contains hidden or 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
// file location | |
// node_module/react-native/Libraries/WebSocket | |
- (void)executeApplicationScript:(NSData *)script sourceURL:(NSURL *)URL onComplete:(RCTJavaScriptCompleteBlock)onComplete | |
{ | |
NSDictionary<NSString *, id> *message = @{ | |
@"method": @"executeApplicationScript", | |
@"url": RCTNullIfNil(URL.absoluteString), | |
@"inject": _injectedObjects, | |
}; | |
[self sendMessage:message waitForReply:^(NSError *error, NSDictionary<NSString *, id> *reply) { |
This file contains hidden or 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
// file location | |
// node_module/react-native/local-cli/server/util/debugger.html | |
function connectToDebuggerProxy() { | |
var ws = new DebuggerWebSocket('ws://' + window.location.host + '/debugger-proxy'); | |
ws.onopen = function() { | |
if (sessionID) { | |
setStatus('Debugger session #' + sessionID + ' active.'); | |
ws.send(JSON.stringify({replyID: parseInt(sessionID, 10)})); |
This file contains hidden or 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 hidden or 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
$(SRCROOT)/projectComponents/RNShare/RNShare | |
http://lucifer1988.github.io/blog/2015/11/05/ioskai-fa-bei-wang-lu-1/ | |
1.library和framework的比较 | |
library也就是我们常用的.a文件,而framework就是.framework文件,当然还有.dylib这样的文件。 | |
静态库和动态库的区别 | |
静态库:链接时完整地拷贝至可执行文件夹中,被多次使用时会有多份冗余拷贝。 |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
-(void)gcdTest1 | |
{ | |
dispatch_queue_t concurrentDispatchQueue=dispatch_queue_create("com.test.queue", DISPATCH_QUEUE_CONCURRENT); | |
dispatch_async(concurrentDispatchQueue, ^{ | |
NSLog(@"1"); | |
}); | |
dispatch_async(concurrentDispatchQueue, ^{ | |
sleep(2); | |
NSLog(@"2"); |
This file contains hidden or 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
// in Person.h ----------------- | |
@class Person; | |
@protocol PersonJSExports <JSExport> | |
@property (nonatomic, copy) NSString *firstName; | |
@property (nonatomic, copy) NSString *lastName; | |
@property NSInteger ageToday; | |
- (NSString *)getFullName; |