Hi i have a table and want to display how many items are in the table in a label.text so convert the row count into a text string
问问题
151 次
1 回答
1
You need to count the model ( array or dictionary count) and form a string:
NSString *rowCountString=[NSString stringWithFormat:@"%d",[yourArray count]]; //or dictionary
//if this is for osx 64 bit use %ld instead of %d
then show the string in the label.
yourLabel.text = rowCountString; //UILabel ios
[yourLabel setStringValue:rowCountString];//NSTextField as label osx
于 2013-03-30T14:07:52.933 回答