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

MFMailComposeViewController throws an error only in iOS 9

I can’t get MFMailComposeViewController to open without throwing a fatal error in iOS 9 Simulator. The same code (Objective C) works flawlessly in iOS 8.x and lower but today I installed Xcode 7 beta 5 and when I run the app on iOS 9 Simulator, I get a dialog box titled “MailCompositionService quit unexpectedly” and […]

How To Dynamically change the contentSize of UIPopoverController?

I have a UIViewController that contains a UITableView. This UIViewController is being displayed in a UIPopoverController. Now, the things is that the number of items in the tableView is not constant, and I want the size of the popover (that is – the popoverContentSize), to adjust according to the number of items in the tableView […]

Error Domain=NSCocoaErrorDomain Code=3840 “The operation couldn’t be completed using AFNetworking

I am using AFNetworking library to post data on server using POST method. Following is my code – (void) callLoginAPI:(NSDictionary *)dictProfile{ // 1 NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:[dictProfile valueForKey:@”name”], @”username”, [dictProfile valueForKey:@”first_name”],@”first_name”, [dictProfile valueForKey:@”last_name”],@”last_name”, [dictProfile valueForKey:@”email”],@”email”, [dictProfile valueForKey:@”birthday”],@”dob”, [dictProfile valueForKey:@”gender”],@”gender”, [[dictProfile valueForKey:@”location”] valueForKey:@”name”],@”location”, [dictProfile valueForKey:@”timezone”],@”timezone”, @””,@”language”, [NSString stringWithFormat:@”http://graph.facebook.com/%@/picture?type=large”,[dictProfile valueForKey:@”id”]],@”profile_pic_url”, @””,@”cover_pic_url”,nil]; AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; […]

Disabling mobile Safari's focus event (zoom)

When clicking an input field on an iOS device, it will zoom in on that element. Can i disable this focus event?

Sending multipart POST from iOS and reading parameters in PHP $_POST?

I’m trying to send a multi-line post from an iPhone/iPad to a php service, the problem is that for some reason, the POST Content-Type seems to be application/x-www-form-urlenconded, ( I found out this using Wireshark ) This is actually a snippet of the Wireshark POST packet capture: **Content-Type: application/x-www-form-urlencoded\r\n** Content-Length: 324\r\n [Content length: 324] Connection: […]

Xcode 5 says tests failed but shows green checkmarks

I have written a few unit tests in the new XCTest framework of Xcode 5. The tests seem to pass successfully most of the time, but I’ve come across a strange behaviour where if I run the tests enough times consecutively, eventually I’ll get a ‘test failed’ message and the console will show Program ended […]

Converting NSString into uint8_t

I am working on data encryption sample code provided by Apple in the “Certificate, Key and Trust Programming guide”. The sample code for encrypting/Decrypting data considers an uint8_t. However the real world application would be doing this on an NSString object. I have been trying to convert NSString object to uint8_t but everytime I get […]

iOS get physical screen size programmatically?

Is this possible? I want the number of inches, not the number of pixels. I know it is approximately 160 ppi. But not exactly.

How to access User Defined Runtime Attribute from the 'sender' object?

I have a UIButton in a Storyboard scene. The button has a User-Defined-RunTime-Attribute ‘type'(String) configured. When pressed the button calls -(IBAction)pressedButton:(id)sender Will I be able to access the User-Defined-RunTime-Attribute from ‘sender’?

Programmatically get path to Application Support folder

I’m trying to get an NSString for the user’s Application Support folder. I know I can do NSString *path = @”~/Library/Application Support”; but this doesn’t seem very elegant. I’ve played around with using NSSearchPathForDirectoriesInDomains but it seems to be quite long-winded and creates several unnecessary objects (at least, my implementation of it does). Is there […]