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

'-[NSTaggedPointerString tgrm_objectForKeyCheck:class:]: unrecognized selector sent to instance 0xa000000005f32303' #44

Open
jxbaoweiyj opened this issue Jan 11, 2018 · 4 comments

Comments

@jxbaoweiyj
Copy link

jxbaoweiyj commented Jan 11, 2018

使用你们的demo代码,放到我自己的工程里,用的mock的json文件,直接崩在了TangramDefaultLayoutFactory里面的
NSString *layoutClassName = [[TangramDefaultLayoutFactory sharedInstance].layoutTypeMap tgrm_objectForKeyCheck:type class:[NSString class]];
这句话这里,错误原因是'-[NSTaggedPointerString tgrm_objectForKeyCheck:class:]: unrecognized selector sent to instance 0xa000000005f32303'
json文件已经加载进来了,请问这个怎么解决啊?

@HarrisonXi
Copy link
Contributor

可以提供简单的工程方便调试么

@jxbaoweiyj
Copy link
Author

我在 NSString *layoutMapString = [dict tgrm_objectForKeyCheck:@"layoutMap" class:[NSString class]];
NSString *layoutMapPath = [[NSBundle mainBundle] pathForResource:layoutMapString ofType:@"plist"];
这一步的时候,你们的layoutMapString是nil,但是获取到了一个正确的layoutMapPath
而我的工程里,还有其他的plist,导致我这边的layoutMapPath变成了我自己工程里的pllist,随之就出现问题了,我看你们的TangramHelperMapping.plist里,为什么有的dict里的key有layoutMap,有的又没有?

@jxbaoweiyj
Copy link
Author

我在你们的demo里随意拖进去一个plist,然后你们的demo也崩了。。恳请你们能解决一下这个问题,我目前的解决办法只能是判断如果layoutMapString是nil,我就
if (!layoutMapString) {
layoutMapString=@"TangramHelperCustomMapping";
}
这样写了,暂时这么解决了。。

@HarrisonXi
Copy link
Contributor

好的,感谢你提供的信息

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