Tag: cocoa touch

How to determine UIWebView height based on content, within a variable height UITableView?

I am trying to create a UITableView with variable height rows as explained in the answer to this question My problem is each cell contains a UIWebView with different (statically loaded) content I can’t figure out how to calculate the proper height based on the content. Is there a way to do this? I’ve tried […]

UIWebView iOS5 changing user-agent

How can I change the user-agent of UIWebView in iOS 5? What I have done so far: Using the delegate call back, intercept the NSURLRequest, create a new url request and set it’s user-agent as whatever I want, then download the data and reload the UIWebView with “loadData:MIMEType:….”. Problem: This causes infinite recursion, where I […]

Persisting Cookies In An iOS Application?

I am going to use NSHTTPCookieStorage in an iOS App to manage cookies that are retrieved from a url, and I understand that it will manage cookies during your application’s runtime. However, I was wondering if it’s possible to persist cookies after the application has closed. And then read those cookies again when the app […]

Blank space at top of UITextView in iOS 10

I have UITextView with some text in it. Everything was fine with iOS 6 but now with iOS 7 it leaves the blank space on top and then place the text below the middle of the textview. I didn’t set any contentOffSet. Please Help!

can't get correct value of keyboard height in iOS8

I was using this code to determine what is the size of the keyboard : – (void)keyboardWillChange:(NSNotification *)notification { NSDictionary* keyboardInfo = [notification userInfo]; NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey]; CGRect keyboardFrameBeginRect = [keyboardFrameBegin CGRectValue]; } I’m running this in the simulator. The problem is since iOS 8 this will not give the correct value, if […]

How to compare UIColors?

I’d like to check the color set for a background on a UIImageView. I’ve tried: if(myimage.backgroundColor == [UIColor greenColor]){ …} else{ …} but that doesn’t work, even when I know the color is green, it always falls into the else part. Also, is there a way to output the current color in the debug console. […]

Super slow lag/delay on initial keyboard animation of UITextField

Alright, this problem has been driving me nuts. It takes roughly 3-4 seconds for the keyboard to pop up after I touch my UITextField. This only occurs on the first time the keyboard pops up since the app launched, afterwards the animation starts instantly. At first I thought it was problem of loading too many […]

Clearing UIWebview cache

I have used UIWebview to load a web page using loadRequest: method, when I leave that scene I call [self.webView stopLoading]; and release the webView. In activity monitor on first launch i have seen that the real memory increased by 4MB, and on multiple launches/loading the real memory doesn’t increase. It is increasing only once. […]

iOS 7 custom back button

I want to use custom back button. in iOS 6 everything is perfect but iOS 7 is strange. [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[[UIImage imageNamed:@”back_button_normal”] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12.0, 0, 12.0)] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; first, it has no iOS 7 arrow and no background image. (Russian locale) then, if you press the button background image appears. Also i had background image […]

Show screen on first launch only in iOS

Tweetbot and Clear show’s on the first start of the app a small tutorial screen how the app works. The screen with the small tutorial only pops up on the first start up of the app (1 time) How and with what can i make a similar thing? Can anyone push me in the right […]