Tag: cocoa touch

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 […]

Animating an image view to slide upwards

I am attempting to make an image view (logo below) slide upwards by 100 pixels. I am using this code, but nothing happens at all: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:3]; logo.center = CGPointMake(logo.center.x, logo.center.y – 100); [UIView commitAnimations]; This code is in the viewDidLoad method. Specifically, the logo.center = … is not functioning. Other things […]

App crashed in iOS 6 when user changes Contacts access permissions

I have an app that uses the Address Book. When running in iOS 6 it runs this code when the user does something that requires Address Book access. if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { if (granted) { showContactChooser(); } }); CFRelease(addressBookRef); } else if (ABAddressBookGetAuthorizationStatus() […]

iCloud basics and code sample

As a beginner, I’m struggling with iCloud. There are some samples, but they are usually quite detailed (on the developer forum there is one for iCloud and CoreData which is massive). The apple docs are OK, but I still can’t see the big picture. So please bear with me, some of these questions are quite […]

How do I draw a shadow under a UIView?

I’m trying to draw a shadow under the bottom edge of a UIView in Cocoa Touch. I understand that I should use CGContextSetShadow() to draw the shadow, but the Quartz 2D programming guide is a little vague: Save the graphics state. Call the function CGContextSetShadow, passing the appropriate values. Perform all the drawing to which […]

RootViewController Switch Transition Animation

Is there any way to have a Transition/animation effect while replacing an existing viewcontroller as rootviewcontroller with a new one in the appDelegate?

convert UIImage to NSData

I am using this code in my app which will help me to send a image. However, I have an image view with an image. I have no file in appbundle but have the image in my side. How can I change the below code ? Can anyone tell me how can I convert myimage […]

Supporting Open In… menu item in my app for iOS Mail And Safari

I need to have my app open documents from the Safari and Mail apps with that “Open In…” thing in the UIDocumentInteractionController class. How do I accomplish this?