Why NSString Objective C

Ads
 

Why NSString Objective C

Why we use the NSString class in Objective C and how to define and initialize the NSString Class?

View Answers

January 30, 2012 at 6:35 PM

Why NSString Objective C

NSStrings is a class that deals with strings in objective c programming language. You can define the NSString class as given below..

NSString *mString;

and to initialize the NSString object, we use @"?." notation.

mString = @"hello world";

You can also compare a string using the "isEqualToString". for example

comparing strings in objective c

if([statusString isEqualToString:@"mString"]){
    //doSomething;
}

You can also use the separate line tag "\n" to separate the strings. For example..

NSString *mString = @"This is line 1\n"
               "This is line 2";

In the last see the code to append the strings in NSString class method.

[NSString stringWithFormat:@"%@%@%@", str1, str2, str3];

Ads









Related Tutorials/Questions & Answers:
Why NSString Objective C
Why NSString Objective C  Why we use the NSString class in Objective C and how to define and initialize the NSString Class?   Why NSString Objective C NSStrings is a class that deals with strings in objective c
comparing dates objective c
comparing dates objective c  Comparing two different dates in Objective C.   if( [date isEqualToDate:otherDate] ) NSLog(@"%@ is equal to %@",date,otherDate);   Objective C NSString Date Example
Advertisements
copy string to string objective c
copy string to string objective c  How to copy a value of NSString to another string in Objective C? I have to different views and i am will to show the NSString value in both of them. Thanks
convert char to string objective c
convert char to string objective c  Converting char to string in objective c   NSString *s = [[NSString alloc] initWithBytes:arr + 2 length:3 encoding:NSUTF8StringEncoding
objective c is kind of
objective c is kind of  Hi, Provide me code of objective c is kind of method in objective c. I have to find if a view is kind of UIButton. Thanks... is: [myObject isKindOfClass:[NSString class]] Thanks
objective c
objective c  how to minimize the uiview in widow effect in iphone sdk
validate email objective c
validate email objective c  how can i validate email text field in objective c? is there any method that support multiple email address separated by coma.   - (BOOL)validateEmailWithString:(NSString*)email
objective c subclassing tutorial
objective c subclassing tutorial  objective c subclassing tutorial
Catagories in Objective C
Catagories in Objective C  catagories in objective c   Categories in Objective C
global variable in objective c
global variable in objective c  Declaring global variable in objective c
logical operators in objective c
logical operators in objective c  logical operators in objective c
Struct in objective c example
Struct in objective c example  I am looking for a struct example in Objective C. Thanks
how to read files of directory objective c
how to read files of directory objective c  how to read files of directory in objective c?   [[NSFileManager defaultManager... objective c, you need to first get the path and load then load that content
objective c boolean example
objective c boolean example  Hi, Can anyone tell me how to use boolean variable in Objective c? Thanks
Objective C Message Passing
Objective C Message Passing  What exactly a message passing means in Objective C? and how can i pass a message to a method
@Protocols in Objective C
@Protocols in Objective C  Understanding @Protocols in Objective-C   @protocol in objective c @protocol is the keyword type in Objective C. Which is used to declare a formal protocol. You can find more Objective c
objective c if string equals
objective c if string equals   Checking if a string is equal to ' " '   In objective c, isEqualToString is a keyword that allows you to check if the string is equal to or not. if ([text isEqualToString
Parsing string in objective c
Parsing string in objective c  Hi, How can i parse a string in Objective c?? Thanks.   Parsing string in objective c This example will also help you to separate the strings separated by one component
Objective C Unichar example
Objective C Unichar example  A simple example of writing unichar in Objective C. Thanks.   An example that returns the value to every new line in the application. -(BOOL)NewLine:(unichar)c { if(c == '\n') return
objective c in iphone
objective c in iphone  how to minimize the uiview iin window effect in iphone..... rly me soon
retain count in Objective C
retain count in Objective C  what is the retain count in Objective C?   retainCount in Objective c retainCount: retain count method is used... of retainCount method here Objective C Memory Management Tutorial
Select string from array in objective c
Select string from array in objective c  Hi, I wanted to select a string from the database table in objective c. But somehow it is not working..can-you suggest anything regarding the fetch query in objective c? Thanks.  
Objective C resize UIImage
Objective C resize UIImage  i just want to resize the image on the touch detection. That means if a user double clicks on the UIImage it must resize the image
Declaring Method in Objective C
: (NSString *) yourId; - (void) getId: (NSString *) yourId; Objective C method...Declaring Method in Objective C In Objective C we can declare two types...: + (void) printData; - (void) printData; The forgoing Objective C methods
objective c define float
objective c define float  Hi, How to define float variable in objective c? Thanks   Hi, Here is the example of defining float variable. float i; i=10; Thanks   Hi, Here is another example: // File
Objective C
and "Why Objective C?" is used as programming language to develop... Objective C       Objective C is a programming language, which is sleeted by Apple for developing
what is class methods in objective c
what is class methods in objective c  What is class methods in objective c? Explain the class method of objective c with the help of an example
what is class methods in objective c
what is class methods in objective c  What is class methods in objective c? Explain the class method of objective c with the help of an example
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
objective c pass by value
objective c pass by value   How to pass value by reference in objective c?   - (void)parentFunction { int i = 0; [self modifyValueOfPassedArgument:i]; //i == 0 still! } - (void)modifyValueOfPassedArgument

Ads