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

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -