Skip to content
New issue

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

NSMutableDictionary赋值野指针闪退 #128

Open
ZHDeveloper opened this issue Jul 25, 2022 · 3 comments
Open

NSMutableDictionary赋值野指针闪退 #128

ZHDeveloper opened this issue Jul 25, 2022 · 3 comments

Comments

@ZHDeveloper
Copy link

Describe the bug
A clear and concise description of what the bug is.

NSMutableDictionary赋值野指针闪退

To Reproduce
Steps to reproduce the behavior:

NSMutableDictionary *dict = [NSMutableDictionary dictionary];

__unsafe_unretained UIView *testObj = [[UIView alloc] init];
NSLog(@"testObj 指针指向的地址:%p 指针本身的地址:%p", testObj, &testObj);

dict[@"8888"] = testObj;

截屏2022-07-25 下午4 01 07

Please complete the following information

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]
@jezzmemo
Copy link
Owner

正常使用API也有这种问题吧,这种问题不是JJException的范畴

@ZHDeveloper
Copy link
Author

这种闪退能避免吗?

@jezzmemo
Copy link
Owner

OC技术上是可行的,大概原理,先要定位是哪里野指针了,然后将野指针的对象dealloc置换,不让它真正释放,到Swift就很难了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants