Silent push notifications only delivered if device is charging and/or app is foreground

I have implemented silent push notifications but I have noticed some strange behaviour. The silent push notifications are handled via: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler The silent push messages only seem to be received if the device is charging (ie cable connected) and/or if my app is foreground. If I disconnect the device … Read more

Swift nested class properties

Does swift not have nested classes?? For example, I can’t seem to access the property test of the master class from the nested class. class master{ var test = 2; class nested{ init(){ let example = test; //this doesn’t work } } } Answer Swift’s nested classes are not like Java’s nested classes. Well, they’re … Read more

Why doesn’t UITableViewCell background color work (set in interface builder)?

Why doesn’t UITableViewCell background color work (set in interface builder)? I note from some searching that the follow code set in your custom subclass of UITableViewController does work (see below): – (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor = [UIColor redColor]; } But I would still like to just understand why interface builder has … Read more

How to overwrite a file with NSFileManager when copying?

I’m using this method to copy a file: [fileManager copyItemAtPath:sourcePath toPath:targetPath error:&error]; I want to overwrite a file when it exists already. The default behavior of this method is to throw an exception/error “File Exists.” when the file exists. There’s no option to specify that it should overwrite. So what would be the safest way … Read more

Cannot assign a value of type ViewController to a value of type UITextFieldDelegate?

Here’s the error when I wrote the line self.MessageTextField.delegate = self: /ChatApp/ViewController.swift:27:42: Cannot assign a value of type ‘ViewController’ to a value of type ‘UITextFieldDelegate?’ Here’s my Swift code (ViewerController.swift): // // ViewController.swift // ChatApp // // Created by David Chen on 15/4/12. // Copyright (c) 2015年 cwsoft. All rights reserved. // import UIKit import … Read more

How to get bundle ID?

I am working on getting the facebook API working for iOS, and the FB registration page requires the Bundle ID of the project. How can I get this information? I read something about getting it at run time, but is there a way to get Xcode to tell me this information, or is it held … Read more

Application loader stuck at the stage of “Verifying assets with the iTunes Store”

I was about to upload an app to iTunes connect, but the application loader has been stuck at the stage of “Verifying assets with the iTunes Store” and pending for almost an hour. Network is fine and I have never seen this before.Has anybody encountered this kind of issue? what is the solution?thanks in advance. … Read more