iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Animate progress with filling the color of the border width of a UIImageView layer

I have am UIImageView and I have made it to be circle with a width layer like in this image : User can update the image and upload new one, I have a progress call back while image is uploaded. What I want is to animate the border with color while the image is uploaded, […]

executeFetchRequest:error: freezes app

I don’t know what it is but it happens when is fetching elements, well that’s what I asume because the app just freezes, I pause the debugging and the debugger stops at a return [__context executeFetchRequest:request error:&error]; Any help about this will be very appreciated.

Can I block network access for a specific moment?

Writing an iOS app, I neet to give the user the option to block the network access for this app only. Is it possible doing that in code? Meaning every call, made by whatever part of the code (and that’s including static libraries) should be blocked for that particular moment.

UIPopoverPresentationController is showing full screen modal on iPhone

On iPad UIPopoverPresentationController working fine but on iPhone it is always showing full window modal popup. i am using following code: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@”Main” bundle:nil]; MySecondViewController *contentVC = [storyboard instantiateViewControllerWithIdentifier:@”Pop”]; contentVC.modalPresentationStyle = UINavigationControllerOperationPop; // 13 UIPopoverPresentationController *popPC = contentVC.popoverPresentationController; // 14 contentVC.popoverPresentationController.sourceRect =CGRectMake(100, 130, 280, 230); self.navigationController.preferredContentSize = CGSizeMake(200, self.parentViewController.childViewControllers.lastObject.preferredContentSize.height-100); //self.showPop.frame; // 15 […]

Always getting the same height using sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:

The CGSize returned by sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: contains always the same height. Why is that, and is there a way around this? I want to align a string vertically and it may not be truncated, unless it can’t fit on a single line using the minimum font size. So I try to use this method to get […]

how to use UItableViewCell reuseIdentifier

I want to use UITableviewCell reuse,I have a custom UITableViewCell and using ARC,my UITableViewCell is different . my code is: – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { PostCount *post=[listArr objectAtIndex:indexPath.row]; static NSString *CellIdentifier = @”TimeLineViewCell”; TimeLineViewCell *cell = (TimeLineViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell==nil){ cell = [[TimeLineViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@”CellIdentifier11″]; } cell.tag=indexPath.row+1000; cell.lab_time.text=[ModelClass intervalSinceNow:post.when btime:0]; cell.delegate=self; [cell setViewStyle:post]; […]

In Objective-C, can I declare @property on a c-array of floats?

thing.h @interface Thing : NSObject { float stuff[30]; } @property float stuff; @end thing.m @implementation Thing @synthesize stuff; @end I get error: type of property ‘stuff’ does not match type of ivar ‘stuff’ I don’t want to use an NSArray because I’d have to make the floats into NSNumbers (right?) and that’s a pain to […]

Producing an NSDate with NSDateFormatter Yielding nil NSDate Value

I am trying to produce a date from a string with the following: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@”MMMM dd, yyyy HH:mm:ss”]; NSLog(@”ENDINGDATE: %@”, [closure objectForKey:@”ENDINGDATE”]); NSDate *tempDate = [dateFormatter dateFromString:[closure objectForKey:@”ENDINGDATE”]]; The ENDINGDATE NSLog produces the following: ENDINGDATE: April, 21 2011 20:00:00 Everything seems to be fine, so I am stumped as […]

Dynamic generation of data members

I have made one application which can parse the given xml file independent of its tags . It is working well and good for at list single level of xml file .I want to assign the xml values on the object.As xml can be different the class also must be generic one and the data […]

How to validate the empty string in Objective C?

I want to validate the string value after getting in the below parser delegate method I have tried like [string length]>0 ,(string !=NULL) in if condition still blank string is printed in the NSlog.So what is the efficient method to validate the sting.I have used the below code. – (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if […]