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

iPhone upload multipart file using AFNetworking

In my iOS app I want to upload file with the java API using NSMutableURLRequest for multipart file. here is the form which shows parameter. <form action=”API_URL” encType=’multipart/form-data’ method=post> <input type=file name=”files”> <input type=submit value=”Upload Attempt Files”> EDIT form2 <form action=’URL’ method=”post” encType=’multipart/form-data’> <input name=”key1″ value=’123′> <input name=”key2″ value=’asdf’> <input name=”key3″ value=’qwerty’> <input name=”key4″ value=’aaa’> […]

Remove or uninstall library previously added : cocoapods

I added an external framework via cocoapods into my iOS application. How can i remove that library from the project?

UIPageViewController, how do I correctly jump to a specific page without messing up the order specified by the data source?

I’ve found a few questions about how to make a UIPageViewController jump to a specific page, but I’ve noticed an added problem with jumping that none of the answers seem to acknowledge. Without going into the details of my iOS app (which is similar to a paged calendar), here is what I’m experiencing. I declare […]

Call JavaScript function from native code in WKWebView

Using a WKWebView in iOS 8, how can I run a JavaScript function from the native side or otherwise communicate from the native side to JavaScript? There doesn’t appear to be a method akin to UIWebView’s stringByEvaluatingJavaScriptFromString:. (I can use – addScriptMessageHandler:name: on the configuration.userContentController object to allow communication from JS to native, but I’m […]

Rotating a CGImage

I have a UIImage that I’m getting from a UIImagePickerController. When I receive the image from the – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info method I put it straight into a UIImageView for preview and give the user the option to either save or discard the image. When the user selects the save option the application get […]

How to use NSCache

Can someone give an example on how to use NSCache to cache a string? Or anyone has a link to a good explanation? I can’t seem to find any..

Wrong color in Interface Builder

The problem: I set a color in Interface Builder, setting the channels RGB, then I do a screenshot of the working window, open it in Photoshop and check color by color picker, which I have set in Interface Builder. The result – the RGB values ​​are different from the ones I set. Video: http://www.youtube.com/watch?v=ASLfnYHPbqM Most […]

Detect permission of camera in iOS

I am developing a very simple video app. I use the official control: UIImagePickerController. Here is the problem. When presenting the UIImagePickerController for the first time, the iOS will ask for the permission. The user can click yes or no. If the user clicks no, the control is not dismissed. Instead, if the user keeps […]

Custom dealloc and ARC (Objective-C)

In my little iPad app I have a “switch language” function that uses an observer. Every view controller registers itself with my observer during its viewDidLoad:. – (void)viewDidLoad { [super viewDidLoad]; [observer registerObject:self]; } When the user hits the “change language” button, the new language is stored in my model and the observer is notified […]

In which situations do we need to write the __autoreleasing ownership qualifier under ARC?

I’m trying to complete the puzzle. __strong is the default for all Objective-C retainable object pointers like NSObject, NSString, etc.. It’s a strong reference. ARC balances it with a -release at the end of the scope. __unsafe_unretained equals the old way. It’s used for a weak pointer without retaining the retainable object. __weak is like […]