This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script for managing build and version numbers using git and agvtool. | |
# Change log: | |
# v1.0 18-Jul-11 First public release. | |
# v1.1 29-Sep-12 Launch git, agvtool via xcrun. | |
version() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7531" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> | |
<dependencies> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/> | |
</dependencies> | |
<customFonts key="customFonts"> | |
<mutableArray key="FreightSansPro-Book.otf"> | |
<string>FreightSansProBook-Regular</string> | |
</mutableArray> | |
</customFonts> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://ronnqvi.st/array-intersections-and-differences | |
NSPredicate *intersectPredicate = | |
[NSPredicate predicateWithFormat:@"SELF IN %@", otherArray]; | |
NSArray *intersect = | |
[firstArray filteredArrayUsingPredicate:intersectPredicate]; | |
NSPredicate *relativeComplementPredicate = // a minus b | |
[NSPredicate predicateWithFormat:@"NOT SELF IN %@", otherArray]; | |
NSArray *relativeComplement = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.tableView.estimatedRowHeight = 44.0; | |
self.tableView.rowHeight = UITableViewAutomaticDimension; | |
// | |
cell.textLabel.numberOfLines = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[self addChildViewController:vc]; | |
// [vc willMoveToParentViewController:self] called automatically | |
[self.view addSubview:vc.view]; // or something like this. | |
[vc didMoveToParentViewController:self]; | |
// For removing view controllers: | |
[vc willMoveToParentViewController:nil]; | |
[vc.view removeFromSuperview]; // or something like this | |
[vc removeFromParentViewController]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSLocale *locale = [NSLocale currentLocale]; | |
// [locale localeIdentifier] fr_FR (i'm in france) | |
NSLog(@"current locale: %@", locale.localeIdentifier); | |
NSArray* preferredLanguages = [NSLocale preferredLanguages]; | |
NSLog(@"preferredLanguages: %@", preferredLanguages); | |
// en,fr ( the interface is in english ) | |
NSString* code = [locale objectForKey:NSLocaleCurrencyCode]; |
NewerOlder