[Solved] Get substring from string variable and save to NSMutableArray [closed]

NSString *str = @”M||100|??|L||150|??|S||50″; NSString *stringWithoutBars = [str stringByReplacingOccurrencesOfString:@”||” withString:@” “]; NSMutableArray *array = [[NSMutableArray alloc]initWithArray:[stringWithoutBars componentsSeparatedByString:@”|??|”]]; solved Get substring from string variable and save to NSMutableArray [closed]

[Solved] What is the best way to convert an array with NSStrings to NSDecimalNumber?

A very simple Category on NSArray will allow you to use map as seen in other languages @interface NSArray (Functional) -(NSArray *)map:(id (^) (id element))mapBlock; @end @implementation NSArray (Functional) -(NSArray *)map:(id (^)(id))mapBlock { NSMutableArray *array = [@[] mutableCopy]; for (id element in self) { [array addObject:mapBlock(element)]; } return [array copy]; } @end Now you can … Read more

[Solved] To convert a particular format to NSDate [closed]

Use this code to get the Current Date NSDateFormatter *dateFor=[[NSDateFormatter alloc]init]; NSString *currentDateString = @”2014-01-08T21:21:22.737+05:30″; [dateFor setDateFormat:@”yyyy-MM-dd’T’HH:mm:ss.SSSZZZZ”]; NSDate *currentDate = [dateFor dateFromString:currentDateString]; NSLog(@”CurrentDate:%@”, currentDate); 5 solved To convert a particular format to NSDate [closed]