Take the 2-minute tour ×

I am reading a text file into an NSArray as below:

Hi.This is the first line.
--blank line--
Hey, this is the second line.
--blank line--

This NSArray reads every line including a blank line just like the above, but I find this 0xdb8844 in the second element of the NSArray. I think it represents a blank line in hexadecimal or UTF-8. Can any one tell me how to decode this?

Thank you for your time.

share|improve this question
Every object in Objective-C is a pointer. An NSArray stores pointers to its elements, not the objects themselves. You're looking at the pointer, i.e. the memory address of the object, not the object itself. You need to print the NSString object with NSLog or output it in some other way in order to see its value. –  PartiallyFinite Jun 15 '13 at 5:40
add comment

1 Answer

That is the memory address of the element stored in the array.

If you want to see what is stored there, add the following line after you read in the text file:

 NSLog(@"Array element 1: '%@'.", [array objectAtIndex:1]);

It probably is the blank line, based on what you have here, and will print the following log statement which indicates that it is indeed the blank line:

Array element 1: ''.
share|improve this answer
Thank you. I'll do that. –  boochan224 Jun 16 '13 at 5:33
add comment

Your Answer


