[Solved] Converting a NSString to NSDate

check your date format [dateFormatter setDateFormat:@”yyyy-MM-dd’T’HH:mm:ss.SSS’Z'”]; change into [dateFormatter setDateFormat:@”yyyy-MM-dd’T’HH:mm:ssZ”]; Swift check your date format dateFormatter.dateFormat = “yyyy-MM-dd’T’HH:mm:ss.SSS’Z'” change into dateFormatter.dateFormat = “yyyy-MM-dd’T’HH:mm:ssZ” 1 solved Converting a NSString to NSDate

[Solved] Implicit conversion of ‘NSInteger’ (aka ‘int’) to ‘NSIndexSet *’ is disallowed with ARC

What is that line supposed to do, objectsAtIndexes: will return a array of objects match all the NSIndexPath object wintin the NSIndexSet that is passed as the parameter. Try objectAtIndex: which will return the object at the index given. Cell.textLabel.text = [array objectAtIndex:indexPath.row]; 4 solved Implicit conversion of ‘NSInteger’ (aka ‘int’) to ‘NSIndexSet *’ is … Read more

[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] Xcode: Page-based application [closed]

Where to start learning about UIPageViewController: View Controller Catalog for iOS: “Page View Controllers” The last 15 minutes of WWDC 2011 Videos: Implementing UIViewController ContainmentTechtopia: An Example iOS 5 iPhone UIPageViewController Application solved Xcode: Page-based application [closed]

[Solved] presenting a view controller

Try doing this: HomeViewController *homeView = [[HomeViewController alloc]init]; [self presentViewController:homeView animated:YES completion:nil]; Also note that black is the default colour of the window. If you don’t have any view controller named HomeViewController, and you present it, by default it will be visible as black colour to the user. To Avoid this, you need to set … Read more

[Solved] Program crashing after trying to read a NSString

The problem is probably that that _guideDescription string already is deallocated when you try to access it in -saveIntoExisted. You are now doing _guideDescription = [[NSString alloc] initWithString:[[notification userInfo] valueForKey:@”selected”]]; and that works, but I would recommend: [_guideDescription retain]; That makes sure the system doesn’t deallocate the string. solved Program crashing after trying to read … Read more

[Solved] Long touch (touch and wait) on the cells in tableView

1) Add a UILongPressGestureRecognizer to you cell – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@”MyIdentifier”]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@”MyIdentifier”]; cell.selectionStyle = UITableViewCellSelectionStyleNone; //add longPressGestureRecognizer to your cell UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; //how long the press is for in seconds lpgr.minimumPressDuration = … Read more

[Solved] Using NSDateFormatter in objective-C [duplicate]

First, your date format is wrong — the second line should be [dateFormatter setDateFormat:@”yyyy-MM-dd’T’HH:mm:ss.000Z”]; — that is, you need the ss. after the mm: but before the 000Z. This will give you the correct NSDate. Next, you need to create a new date formatter with the format @”dd.M.yyyy” (or @”d.M.yyyy” if you want to remove … Read more

[Solved] How to draw a circle and move it / drag it on touch in IOS? [closed]

Well you could create a custom UIView and overwrite it’s drawRect method to draw the circle. The drawRect method would then look like this: – (void)drawRect:(CGRect)rect { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(ctx, [[UIColor redColor] CGColor]); CGContextFillEllipseInRect(ctx, self.bounds); } Don’t forget to set the views background color to the clear color. To handle the movement, add … Read more

[Solved] How to add UILabel from a loop? [closed]

You should actually create the label and place it on your view. UILabel *display = [[UILabel alloc] init]; display.text = [chars objectAtIndex:i]; display.frame = CGRectMake(x, y, 14, 22); display.textColor = [UIColor whiteColor]; [self.view addSubView:display]; solved How to add UILabel from a loop? [closed]