Pregunta

How do I get an NSDictionary from a Python dictionary (so that I can call description on it) ?

¿Fue útil?

Solución

>>> d = NSDictionary.dictionaryWithDictionary_({"foo": "bar"})
>>> type(d)
<objective-c class __NSDictionaryI at 0x7fff7ae34688>
>>> d.description()
u'{\n    foo = bar;\n}'
>>> d
{
    foo = bar;
}
>>> 
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top