Home Tutorial Iphone Examples NSString in objective c

 
 

Share on Google+Share on Google+
NSString in objective c
Posted on: September 8, 2009 at 12:00 AM
Advertisement
In this series of Iphone application development tutorials, we are going to introduce you with some of the iphone basic classes and objects...that are used in objective C. The NSString is one of them.

NSString in objective c

In this series of Iphone application development tutorials, we going to introduce you with some of the iphone basic classes and objects...that are used in objective C. NSString is one of them.

Brief Introduction to iPhone NSString Class: 

NSString is a class which inherits from NSObject(Objective c) and represent the set of character or character strings in frameworks. The purpose of using NSString is declaring the programmatic interface for an objects(that manages immutable strings). The objects later ..can be used anywhere in the same class like c or c++ programming languages. 

Note: Immutable string are those strings that can be defined at the time of creating it, which remains unchanged. 

NSString and NSMutableString are two different classes. We'll explain it later with the help of example. But before that lets find out the structure of NSString class.
As i said above, NSString inherits from the NSObject which is declared in NSPathUtilities.h, NSString.h & NSURL.h. length and characterAtIndex are two types of primitive methods that are defined in it. Using these two methods, you can easily find out the actual length of string and also you can get the particular character from the Array Index.
Now lets take some example to see how to use NSString and NSMutableString in programming.
List of NSString/NSMutableString Examples:

Advertisement

Related Tags for NSString in objective c:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 8, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com