RE: casting an int to string
RE: casting an int to string
- Subject: RE: casting an int to string
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Wed, 22 May 2002 15:27:39 -0400
"Casting" from int to NSString doesn't seem possible, but what you really
seem to want is to insert a string representation of the integer into
another string. There is no "issue" with querying the tableView for the
number of rows or pushing the result into a string, at least none that I can
see. Just ask the tableView. You should be able to do:
NSString *message = [NSString stringWithFormat:@"There are %d
rows",[myTableView numberOfRows]];
Or perhaps
NSString *numOfRows = [NSString stringWithFormat:@"%d",[myTableView
numberOfRows]];
NSMutableString *message =[NSMutableString stringWithString:@"There are
rows."];
[message insertString:numOfRows atIndex:9];
Jonathan
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Ted Petrosky
>
Sent: Wednesday, May 22, 2002 3:18 PM
>
To: email@hidden
>
Subject: casting an int to string
>
>
>
Thanks for all the recommendation that I got....
>
>
It seems that everyone is of the mind that I should use some varient of
>
>
@"the info %d here", int to get the integer in the string.
>
>
Of course the issue is that I am querying a tableView for its
>
number of Rows and
>
pushing this int into the string.
>
>
Interesting that when I first tried it, the compiler was
>
complaining that the
>
interger needed to be casted to string as I was trying to use the
>
insert at index
>
method.
>
>
I don't know if there is a solution to cast an integer to string.
>
>
Thanks again.
>
>
Ted
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.