Target -> Build Settings -> Packaging -> Product Name.
This file contains hidden or 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
| #ifdef DEBUG | |
| #define DLog(format, ...) NSLog(format, ## __VA_ARGS__) | |
| #else | |
| #define DLog(format, ...) | |
| #endif |
This file contains hidden or 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
| #ifdef DEBUG | |
| # define DLog(fmt, ...) NSLog((@"[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); | |
| #else | |
| # define DLog(...); | |
| #endif |
This file contains hidden or 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
| [UIColor colorWithRed:0 green:0 blue:25/255.0 alpha:44/255.0].CGColor |
This file contains hidden or 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
| /* | |
| 1. When creating a date from a string using date formatter, hour format of NSDateFormatter.dateFormat should be 'h' or 'hh' in 12-hour, and 'H' or 'HH' in 24-hour. | |
| 2. When creating a date in 12-hour, the AM/PM format of NSDateFormatter.dateFormat should be 'a', just one 'a'. | |
| 3. NSDateFormatter, NSDateComponets, NSCalendar has a NSTimeZone property, which means their time a related a specific time zone. While NSDate does not a NSTimeZone property, which means its value is a absolute value calculating from 00:00:00 UTC on 1 January 2001 | |
| */ |
This file contains hidden or 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
| - (UITableView *)tableView{ | |
| if (!_tableView) { | |
| _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; | |
| _tableView.rowHeight = UITableViewAutomaticDimension; | |
| _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; | |
| _tableView.estimatedRowHeight = 44.f; | |
| _tableView.delegate = self; | |
| _tableView.dataSource = self; | |
| } | |
This file contains hidden or 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
| #pragma mark - Initializer | |
| - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ | |
| self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| if (self) { | |
| [self setupSubviews]; | |
| } | |
| return self; | |
| } |
This file contains hidden or 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.searchBar.scopeBarBackgroundImage = [[UIImage alloc] init]; | |
| self.searchBar.backgroundImage = [[UIImage alloc] init]; |
This file contains hidden or 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
| NSString *inputLanguage = [[UIApplication sharedApplication] textInputMode].primaryLanguage; |
This file contains hidden or 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
| Sometimes, we will get this error: | |
| > Error Domain=NSCocoaErrorDomain Code=3840 "Unable to convert data to string around character 28." UserInfo={NSDebugDescription=Unable to convert data to string around character 28.} | |
| The reason that causes this error is that the encoding(GBK for example) of the response data is not compatible with the default encoding(UTF-8) of iOS. | |
| To resolve this, we need to convert the encoding of response data to UTF-8. | |
| Here is the inline method of converting the encoding to UTF-8: | |
| ```objc |