objective c - Getting app version is crash -


i having code app version , save nsdictionary :

    nsstring *version=[nsstring stringwithformat:@"%@",[[nsbundle mainbundle] objectforinfodictionarykey:@"cfbundleversion"]];      nslog(@"version%@",version); //prints right thing     nsmutabledictionary *dic;     [dic setvalue:version forkey:@"version"]; //crash      [dic setvalue:errors forkey:@"errors"]; //work 

the error on crash :

setvalue:forundefinedkey:]: class not key value coding-compliant key version 

can identify error ?

thanks lot .

i had allocate dictionary :

nsmutabledictionary *dic=[[nsmutabledictionary alloc]init]; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -