How to write a BOOL predicate in Core Data?

From Predicate Programming Guide: You specify and test for equality of Boolean values as illustrated in the following examples: NSPredicate *newPredicate = [NSPredicate predicateWithFormat:@”anAttribute == %@”, [NSNumber numberWithBool:aBool]]; NSPredicate *testForTrue = [NSPredicate predicateWithFormat:@”anAttribute == YES”]; You can also check out the Predicate Format String Syntax.

detect ipad/iphone webview via javascript

This uses a combination of window.navigator.userAgent and window.navigator.standalone. It can distinguish between all four states relating to an iOS web app: safari (browser), standalone (fullscreen), uiwebview, and not iOS. Demo: http://jsfiddle.net/ThinkingStiff/6qrbn/ var standalone = window.navigator.standalone, userAgent = window.navigator.userAgent.toLowerCase(), safari = /safari/.test( userAgent ), ios = /iphone|ipod|ipad/.test( userAgent ); if( ios ) { if ( !standalone … Read more

What are the sizes used for the iOS application splash screen?

2018 Update – Please don’t use this info ! I’m leaving the below post for reference purposes. Please read Apple’s documentation Human Interface Guidelines – Launch Screens for details on launch screens and recommendations. Thanks Drekka July 2012 – As this reply is rather old, but stills seems popular. I’ve written a blog post based … Read more

iOS 7 TableView like in Settings App on iPad

I’ve gone ahead and further customized the willDisplayCell to get a better simulation of the cell styles in the settings app. Objective-C – (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(tintColor)]) { if (tableView == self.tableView) { CGFloat cornerRadius = 5.f; cell.backgroundColor = UIColor.clearColor; CAShapeLayer *layer = [[CAShapeLayer alloc] init]; CGMutablePathRef pathRef = … Read more

iphone/ipad: How exactly use NSAttributedString?

Starting from the iOS 6.0 you can do it like that: NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@”Hello. That is a test attributed string.”]; [str addAttribute:NSBackgroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(3,5)]; [str addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(10,7)]; [str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@”HelveticaNeue-Bold” size:20.0] range:NSMakeRange(20, 10)]; label.attributedText = str;

How to build a framework or library for other developers, the secure way? [closed]

Yes, it is possible to build frameworks so the user of the framework can’t see the source code. Check out these articles (I’ve successfully used the first one to create frameworks in the past — the later articles are updates to the original): http://www.drobnik.com/touch/2010/04/making-your-own-iphone-frameworks/ http://www.drobnik.com/touch/2010/05/making-your-own-iphone-frameworks-in-xcode/ http://www.drobnik.com/touch/2010/10/embedding-binary-resources/ To use the framework, your users would just drag … Read more

Is there a UIView resize event?

As Uli commented below, the proper way to do it is override layoutSubviews and layout the imageViews there. If, for some reason, you can’t subclass and override layoutSubviews, observing bounds should work, even when being kind of dirty. Even worse, there is a risk with observing – Apple does not guarantee KVO works on UIKit … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)