Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Ok I think I got it, but if I init a string with something I have to use alloc like this?
Code:
 NSString * string = [[NSString alloc] initWithFormat:@"'%@' has %d characters.",textViewString,[textViewString length] ];

So I can't do like this?
Code:
NSString * string = [NSString initWithFormat:@"'%@' has %d characters.",textViewString,[textViewString length] ];

Thanks for answering my questions! When I clear things I advance in my book again.
initWithFormat: is a - method, so you call it on an instance. There is a corresponding stringWithFormat: method that is a + method, called on the class. You'd pass this to NSString like your second example, and you'd get a pointer to an autoreleased Object back.

And you're welcome.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.