How to detect whether custom keyboard is activated from the keyboard’s container app?

Here is a method I have used in one of my projects. I think it is what you asked for, hope it helps you. – (BOOL)isCustomKeyboardEnabled { NSString *bundleID = @”com.company.app.customkeyboard”; // Replace this string with your custom keyboard’s bundle ID NSArray *keyboards = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] objectForKey:@”AppleKeyboards”]; // Array of all active keyboards for … Read more

UITableView with two custom cells (multiple identifiers)

* I’ve renamed some of your NIB/Class names for a better understanding. * First, you should register each cells’ NIB: – (void)viewDidLoad{ [super viewDidLoad]; static NSString *CellIdentifier1 = @”ContentCell”; static NSString *CellIdentifier2 = @”SpaceCell”; UINib *nib = [UINib nibWithNibName:@”CellViewNIBName” bundle:nil]; [self.tableView registerNib:nib forCellReuseIdentifier:CellIdentifier1]; nib = [UINib nibWithNibName:@”CellSpaceNIBName” bundle:nil]; [self.tableView registerNib:nib forCellReuseIdentifier:CellIdentifier2]; self.contentView.hidden = YES; [self … Read more

how to intercept Button click inside UIWebview on IOS?

You can do the following: In your HTML <a class=”yourButton” href=”https://stackoverflow.com/questions/10992339/inapp://capture”>Button Text</a> In your UIWebViewDelegate – (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([request.URL.scheme isEqualToString:@”inapp”]) { if ([request.URL.host isEqualToString:@”capture”]) { // do capture action } return NO; } return YES; } I added “capture” to your button’s URL so that you could distinguish between several … Read more

+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name ‘Account”

– (NSManagedObjectContext *)managedObjectContext { if (managedObjectContext != nil) return managedObjectContext; NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { managedObjectContext = [[NSManagedObjectContext alloc] init]; [managedObjectContext setPersistentStoreCoordinator:coordinator]; } return managedObjectContext; } You haven’t provided a lazy loading implementation of persistentStoreCoordinator so coordinator will always be nil so you will always be returning nil from this … Read more

Generating iOS and Android icons in Cordova / PhoneGap

I wrote a script that auto generates icons for cordova using ImageMagick: https://github.com/AlexDisler/cordova-icon To use it, create an “icon.png” file and place it in the root folder of your project, then run: cordova-icon and it will generate all the required icons for the platforms your project has. You can also configure it as a hook … Read more

iOS: How can i receive HTTP 401 instead of -1012 NSURLErrorUserCancelledAuthentication

Yes. Stop using the synchronous API. If you use the asynchronous delegate-based API then you have a lot more control over the connection. With this API, except in cases where an error is encountered before the HTTP header is received, you will always receive -connection:didReceiveResponse:, which gives you access to the HTTP header fields (encapsulated … Read more

iOS 6 – viewDidUnload migrate to didReceiveMemoryWarning?

The short answer is that, in many cases, you don’t need to change anything. And, you most certainly do not want to simply migrate all of the contents of viewDidUnload to didReceiveMemoryWarning. Generally, most of us do the setting of IBOutlet references to nil in viewDidUnload (largely because Interface Builder would put that there for … Read more

How to display an image using URL?

The error is most likely that imageURL is nil. Are you assigning it a value elsewhere in the code, or is it actually @IBOutlet in the real code? If you do not assign a value to it, it will be nil – but its type of UIImageView! means it is an “implicitly unwrapped optional” which … Read more

tech