Tag: objective c

Objective-C zip library which will zip and unzip, with password protection?

Is there a zip libary which will zip and unzip, with password protection ?

How do I set an NSCalendarUnitMinute repeatInterval on iOS 10 UserNotifications?

In UILocalNotification we use NSCalendarUnitMinute like repetition ….. but I can’t find in iOS 10 UserNotification doc … How can I use NSCalendarUnitMinute like repetition in iOS 10 UserNotification? here is the code which will schedule local notification at 8:30 pm and will repeat after every one minute. UILocalNotification* localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate […]

How to catch all iOS Push Notifications with different user actions including tap on app icon

As per the Apple guide: “As a result of the presented notification, the user taps the action button of the alert or taps (or clicks) the application icon. If the action button is tapped (on a device running iOS), the system launches the application and the application calls its delegate’s application:didFinishLaunchingWithOptions: method (if implemented); it […]

scale Image in an UIButton to AspectFit?

I want to add an image to a UIButton, and also want to scale my image to fit with the UIButton (make image smaller). Please show me how to do it. This is what I have tried, but it does’t work: Adding image to button and using setContentMode: [self.itemImageButton setImage:stretchImage forState:UIControlStateNormal]; [self.itemImageButton setContentMode:UIViewContentModeScaleAspectFit]; Making a […]

Modal segue, navigation bar disappears

I’m using Xcode 4.6.1 to code on Objective-C. I want to know how can I keep the navigation bar shown when I create a modal segue between 2 View controllers, because I’m doing the segue in the storyboard and when I run the application the navigation bar of the second view controller disappears, and I […]

Expand UILabel inside UITableView with “more” button like Instagram

I’ve got a project (that has been written by other people) where there’s a feed with content and text displayed inside a table view. Each post corresponds to one section in table view, and each section has its own rows corresponding to elements like content, text, like button etc. I need to display a short […]

Handling Push Notifications when App is Terminated

When my App is not running and receives a Push Notification, if I click on that notification, the App is launched – but then it doesn’t prompt the user with the Alert-View I set up, asking them whether they want to view the Notification’s contents or not. It just launches, and sits there. The Push […]

Asynchronous NSURLConnection with NSOperation

I want to do NSURLConnection in background mode,because it response is having much data.Forums are telling to use Apple’s finite length coding to use in didEnterBackground. but I want to avoid it.instead of it I use following code through NSOperation with NSInvocation as, but it is not working.connectToServer is having NSURLConnection operation.any help please?didReceiveData,didReceiveResponse delegate […]

Done button event MPMoviePlayerController

On my iPhone i’m playing video/audio files in fullscreen mode. When the video/audio file reached its end then the following method is triggered: – (void) movieFinishedCallback:(NSNotification*) aNotification { MPMoviePlayerController *player = [aNotification object]; [player stop]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [player autorelease]; [moviePlayer.view removeFromSuperview]; NSLog(@”stopped?”); } That works fine! But the problem is when i […]

Using a BOOL property

Apple recommends to declare a BOOL property this way: @property (nonatomic, assign, getter=isWorking) BOOL working; As I’m using Objective-C 2.0 properties and dot notation, I access this property using self.working. I know that I could also use [self isWorking] — but I don’t have to. So, as I’m using dot notation everywhere, why should I […]