iphone - Problem with int in Objective C -


singelton.categoryid = (int)[categories.categoriesid objectatindex:indexpath.row]; nslog(@"%d", singelton.categoryid); 

singelton.categoryid type int.
when try print number random, if nslog(@"%@", singelton.categoryid); printed value right.
need print %d.

can me?

use intvalue method integer representation of nsstring/nsnumber. try,

singelton.categoryid = [[categories.categoriesid objectatindex:indexpath.row] intvalue]; 

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -