objective-c


ios - UIWebView delegate method shouldStartLoadWithRequest: equivalent in WKWebView?

I've been looking for a good explanation myself, but haven't found one. I've used the following in my app and everything seems to work ( Edit: updated based on ccoroom's comment): UIWebViewDelegate... Read More


objective c - How dangerous is it to compare floating point values?

First of all, floating point values are not "random" in their behavior. Exact comparison can and does make sense in plenty of real-world usages. But if you're going to use floating point you need to... Read More


ios - UIButton title text color

use Objective-C [headingButton setTitleColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:113/255.0 alpha:1.0] forState:UIControlStateNormal]; Swift headingButton.setTitleColor(.black, for: .n... Read More


iphone - How to add to an NSDictionary

A mutable dictionary can be changed, i.e. you can add and remove objects. An immutable is fixed once it is created. create and add: NSMutableDictionary *dict = [[NSMutableDictionary alloc]initWithCap... Read More


objective c - Super slow lag/delay on initial keyboard animation of UITextField

Before you implement any exotic hacks to get around this problem, try this: stop the debug session, close the app from multitasking, unplug your device from the computer and run the app normally by t... Read More


ios - UILabel - auto-size label to fit text?

Please check out my gist where I have made a category for UILabel for something very similar, my category lets a UILabel stretch it's height to show all the content: https://gist.github.com/1005520 O... Read More


cocoa - Objective-C: Assertion vs. Exception vs. Error

An NSAssert will throw an exception when it fails. So NSAssert is there to be short and easy way to write and to check any assumptions you have made in your code. It is not (in my opinion) an alterna... Read More


objective c - How to define a preprocessor symbol in Xcode

Go to your Target or Project settings, click the Gear icon at the bottom left, and select "Add User-Defined Setting". The new setting name should be GCC_PREPROCESSOR_DEFINITIONS, and you can type you... Read More


iphone - Getting thread id of current method call

NSLog(@"%@", [NSThread currentThread]);... Read More


objective c - Xcode keeps asking for password to use the System Keychain

The problem was that my Developer Certificate on Keychain was under " System ", on the left hand panel, which is always locked, requiring my password to unlock! Then I moved the Developer Certificate... Read More