我的应用程序有问题。
render()
{
console.log( this.state.ext);
var tmp = this.state.ext;
tmp = tmp.toString();
console.log(tmp);
if (this.state.ext != ""){
return(
<View style={styles.container}>
<Image source={require('../../img/mob.png')} style= {styles.mob_logo}/>
<WebView
source={{uri: {tmp}}} style={{marginTop: 20}}
/>
</View>
)
}
我得到 JSON 值
{
tmp = "React Native New Date string"";
}
NSDictionary 类型无法转换为 NSString。
最佳答案
您可以使用 yourDictionary["tmp"] 或 yourDIctionary.Description 将其转换为字符串
关于javascript - Json值NSDictionary转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41612012/