
Giovambattista Fazioli
CTO
Saidmade Srl
Just another question,
What is better:
NSInteger value;
or
unsigned int value;
In iPhone develop is better use the wrap object like NSInteger or NSString that int or char?

Jonathan Lehr
President
AboutObjects
NSInteger is a typedef for unsigned int, so there's really no difference. However it's conditionally compiled to be the same size on 32 and 64 bit platforms. Here's the actual declaration from NSObjCRuntime.h:
Code:
#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
NSString is an entirely different matter. NSString is a powerful class in the Foundation framework. It's definitely worth some time to read through the reference material to learn more about how to work with NSString and its subclass, NSMutableString.
I'd highly recommend reading at least the first few sections of
Strings Programming Guide for Cocoa, as well as skimming the API documentation for NSString and NSMutableString.
- Jonathan