We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
按照demo中的写法,在js中的以下代码 require('JPObject').request(block("NSString *, BOOL", function(ctn, succ) { if (succ) log(ctn) //output: I'm content })) 中的succ是false,没有能够打印出I'm content
The text was updated successfully, but these errors were encountered:
在genCallbackBlock中
void (^block)(void) = ^(void){}; uint8_t *p = (uint8_t *)((__bridge void *)block); p += sizeof(void *) + sizeof(int32_t) *2; void(**invoke)(void) = (void (**)(void))p; p += sizeof(void *) + sizeof(uintptr_t) * 2; const char **signature = (const char **)p;
这里的signature应该是指向了下一个oc对象了 当前的内存状态如下 其中100CE07F8是block指向的地址,经过上面的运算后signature会指向0x0000000100ce0820,这个值是对应下一个block的__flags,值和上一个block一样都是1342177280,最终生成的类型会修改这里的内存,没看懂为什么这样做
Sorry, something went wrong.
这里正确的写法是
p += sizeof(void *) + sizeof(int32_t) *2; void(**invoke)(void) = (void (**)(void))p; p += sizeof(void*); void *p2 = *(void **)p; p = p2; p += sizeof(uintptr_t) * 2; const char **signature = (const char **)p;
能够获取block当前的签名
No branches or pull requests
按照demo中的写法,在js中的以下代码
require('JPObject').request(block("NSString *, BOOL", function(ctn, succ) {
if (succ) log(ctn) //output: I'm content
}))
中的succ是false,没有能够打印出I'm content
The text was updated successfully, but these errors were encountered: