I am developing an application, in which I am getting the values from the URL, for example, take it as (demo.png), here what I am doing is, i am separating the string with <componentsSeparatedByString:@"." > and saving that in the array (Index 0 : demo & Index 1: png ). And, it works fine. Now, what i getting struck here, when the value from the URL doesn't contain ".png, .jpeg" then error message is coming. How can i check whether there is a value in ObjectAtIndex:1 is null. What i did for this was,
Coding :
if ([array45 objectAtIndex:1] == NSNULL NULL) {
NSLog(@"object at index %i has no data", i);
}
Error message:
[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
Help me with your valuable solutions.