Tag: ios

iOS start Background Thread

I have a small sqlitedb in my iOS device. When a user presses a button, I fetch the data from sqlite & show it to user. This fetching part I want to do it in a background thread (to not block the UI main thread). I do this like so – [self performSelectorInBackground:@selector(getResultSetFromDB:) withObject:docids]; After […]

How to cache content in UIWebView for faster loading later on?

I notice that the iphone safari caches content so that your page load for later is much faster much like a desktop browser. So take mobile gmail web page for example, the first load is quite slow (5-10 secondS). But if I close the tab and reopen the page again, it’s very quick (1 second). […]

Changing back button in iOS 7 disables swipe to navigate back

I have an iOS 7 app where I am setting a custom back button like this: UIImage *backButtonImage = [UIImage imageNamed:@”back-button”]; UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; [backButton setImage:backButtonImage forState:UIControlStateNormal]; backButton.frame = CGRectMake(0, 0, 20, 20); [backButton addTarget:self action:@selector(popViewController) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *backBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton]; viewController.navigationItem.leftBarButtonItem = backBarButtonItem; But this disables the iOS 7 “swipe […]

iOS background audio not playing

I have an app that uses CoreBluetooth background modes. When a certain event happens I need to play an alarm sound. Everything works fine in the foreground and all bluetooth functionality works fine in the background. I also have it working where it schedules UILocalNotification‘s in the background to sound the alarm, however I don’t […]

A html5 web app for mobile safari to upload images from the Photos.app?

Is it possible to write a HTML5 web application designed for the iOS devices (iPad, iPhone, iPod Touch) which can allow the user to upload an image from the filesystem? Imagine uploading a new photo to your twitter avatar via a web app.

Static properties in Swift

I’m trying to convert the following Objective-C code to Swift. In my Objective-C code, there’s a static variable and its accessed from a class method. @implementation SomeClass static NSMutableArray *_items; + (void)someMethod { [_items removeAll]; } @end Since you can’t access types declared like this private var items = [AnyObject]() from class functions in Swift, […]

Xcode 6 iPhone Simulator Application Support location

In Xcode 6, I have an app I’m using Core Data in, but there is no folder in Application Support for the iOS 8 iPhone Simulator. Where are my files and Core Data sqlite database being stored?

change app name in App Store

I have app called “X”. It’s already approved in the app store. Now I want it to be called “X Pro” for some reasons. What should I edit in plist or ITC to change this name? I guess I should change bundle_name or bundle_display_name, but will it change app name in the App Store or […]

afnetworking 3.0 Migration: how to POST with headers and HTTP Body

I am trying to make a POST request which has HTTPHeader Fields and a HTTP body to the youtube API. Previously in version 2.0 of AFNetworking, I used to do it this way which worked: NSDictionary *parameters = @{@”snippet”: @{@”textOriginal”:self.commentToPost.text,@”parentId”:self.commentReplyingTo.commentId}}; NSString *url = [NSString stringWithFormat:@”https://www.googleapis.com/youtube/v3/comments?part=snippet&access_token=%@”,[[LoginSingleton sharedInstance] getaccesstoken]]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; [request setHTTPMethod:@”POST”]; […]

How to load a xib file in a UIView

I have been searching everywhere and nothing so far has worked for me. Basically I want to have a .xib file called rootView.xib and inside it I want to have a UIView (lets call it containerView) that takes up only half of the screen (so there would be the regular view and a new view). […]