I have this code that is crashing with error *** Terminating app due to uncaught exception \'NSRangeException\', reason: \'*** -[NSArray objectAtIndex:]: index 0 beyond bounds for empty array\'
So I have an NSString, lets say it: NSString *mainString = @\"My Name is Andrew (I like computers)\";
I have to match the number of occurrences of n special characters in a string. I thought to create an array with all these chars (they are 20+) and create a function to match each of them.
I want to validate email text for which I am using RegexKitLite.h. I am doing things as follows : NSString *strEmail = [txtEmail text];
I am accepting an NSString of random size from a UITextField and passing it over to a method that I am creating that will capture only the last 4 characters entered in the string.
I have a NSSting resultcontent that contains html data which is dynamic and length of html data is always different according to user input.
I am currently using the below code to take the substring NSString *s1 = [stringName substringWithRange: NSMakeRange(0, 2)];
im using kumulos to have access to a database. this is the code i am talking about : NSString *location = [[theResults objectAtIndex:0] objectForKey:@\"location\"];
I have strange NSRange behavior on my device (iPhone iOS 4.3). This code has a different behavior on device and simulator.
range.location should be 0. Am i right ? NSRange range; range = [@\"beer\" rangeOfString:@\"beer an开发者_运维百科d vodka\"];