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

IOS: copy a file in documents folder

In my project I have two file .txt (in Resources folder), how can I copy them inside documents folder?

How to delete all cookies of UIWebView?

In my application, I have a UIWebview that loads linkedin auth page for login. When user logs in, cookies saves into the application. My app has a logout button that is not related to linkedin login. So when user clicks on this button, he logs off from the app. I want that this log off […]

How can I autoplay media in iOS >= 4.2.1 Mobile Safari?

I cannot seem to get audio media to play in Mobile Safari on iOS 4.2.1 in any situation other than the handler of a click event performed by the user. Even then, if is called in any asynchronous fashion (ajax, setTimeout, etc) it doesn’t work. I’ve tried calling player.load() before I’ve tried triggering […]

iOS: Change Device Volume

Is there a way to change the volume of the device? I’ve seen several apps do it. I have a desktop version of the iOS app and the device will be able to be controlled to some extent over the network. One of the things I want to allow the user to do is change […]

App “does not contain the correct beta entitlement”

I submitted an application for review and I notice that the build that I submitted has an issue associated with it saying that Build 168 does not contain the correct beta entitlement. I wasn’t able to find information on this error anywhere. What does it mean and will it inhibit the review process? My app […]

Parsing HTML into NSAttributedText – how to set font?

I am trying to get a snippet of text that is formatted in html to display nicely on an iPhone in a UITableViewCell. So far I have this: NSError* error; NSString* source = @”<strong>Nice</strong> try, Phil”; NSMutableAttributedString* str = [[NSMutableAttributedString alloc] initWithData:[source dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: [NSNumber numberWithInt:NSUTF8StringEncoding]} documentAttributes:nil error:&error]; This kind of works. I […]

Calling sleep(5); and updating text field not working

I’m trying to sleep a method (see below), but rather than the textLabel changing from the value of myTextLabelString, waiting 5 seconds, changing to “sleep 5 worked”, waiting 5 seconds and finally changing to “sleep 5 worked second time round”…. it just goes from the value of myTextLabelString, waits 10 seconds, and then changes to […]

UITableView with fixed section headers

Greets, I’m reading that the default behaviour of UITableView is to pin section header rows to the top of the table as you scroll through the sections until the next section pushes the previos section row out of view. I have a UITableView inside a UIViewController and this does not seem to be the case. […]

Difference between viewDidLoad and viewDidAppear

This question already has an answer here: Difference between viewDidAppear, viewDidLoad in iPhone/iOS? 1 answer

iOS: How to share text and image on social networks?

Please, can you tell me if I’m doing mistakes? NSString *sharedMsg=[NSString stringWithFormat:@”Hello world”]; UIImage* sharedImg=[UIImage imageNamed:@”image”]; NSArray* sharedObjects=[NSArray arrayWithObjects:sharedMsg, sharedImg, nil]; UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:sharedObjects applicationActivities:nil]; activityViewController.popoverPresentationController.sourceView = self.view; [self presentViewController:activityViewController animated:YES completion:nil]; At runtime when I select the icon of Facebook the text is missing, the image is correctly displayed. My xcode […]