Change textField placeholder font color and size

self.textField.placeholder = @"username is in here!" ; [self.textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"]; [self.textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];

(set using attributedString) NSString *string = @” Brave New World “; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];

[attributedStringaddAttribute:NSForegroundColorAttributeName value:[UIColor redColor]range:NSMakeRange(0, [string length])];

[attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16]range:NSMakeRange(0, [string length])]; self.textField.attributedPlaceholder = attributedString; – (BOOL)textFieldShouldReturn:(UITextField *)textField {Return [textField resignFirstResponder]; } 2, click on background View to close keyboard [self. View endEditing:YES]; [[UIApplication sharedApplication] keyWindow endEditing:YES] [[UIApplication sharedApplication] endEditing:YES]

# # # thread updates UILabel text [self. Label1 performSelectorOnMainThread: @ the selector (setText:) withObject:textDisplaywaitUntilDone:YES];

NSFileManager = [NSFileManager defaultManager]; NSDictionary *fattributes =[fmattributesOfFileSystemForPath:NSHomeDirectory() error:nil]; NSLog (@ % lldG “capacity”, [[fattributes objectForKey: NSFileSystemSize] longLongValue] / 1000000000); NSLog (@ “available” % lldG, [[fattributes objectForKey: NSFileSystemFreeSize] longLongValue # # # for a UIView transparency, [self.testView setBackgroundColor:[UIColor colorWithRed:0.0 green:1.0 Alpha blue: 1.0, 0.5]];

Simply add Status bar is INITIALLY Hidden to info.plist and set this to YES

If your project uses non-ARC mode, add the -fobjc-arc tag to the ARC mode code files.

If your project uses ARC mode, add the -fno-objc-arc tag to non-ARC code files.

To add labels: Open: your target -> Build Phases -> Compile Sources. Double-click the corresponding *.m file in the popup window, enter the label mentioned above -fobjc-arc / -fno-objc-arc and click Done to save

If you have A property in UIViewController A that has A property property UIViewController B, After instantiation, add vbC. view to the main UIViewController A.view, If done on viewB – (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion NS_AVAILABLE_IOS(5_0); The operation will appear, “Presenting view controllers on detached view controllers is discouraged” problem.

BVC has been present in AVC, so it will be wrong to try again. Can use [self view. Window. RootViewController presentViewController: imagePickeranimated: YES completion: ^ { NSLog(@”Finished”); }];

NSArray *array = @[@”test1″, @”test2″]; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:array applicationActivities:nil];

[self presentViewController:activityVC animated:YES completion:^{ NSLog(@"Air"); }];

BOOL hasBccCode = YES; if ( nil == bccCodeStr || [bccCodeStr isKindOfClass:[NSNull class]] || [bccCodeStr isEqualToString:@””]) { hasBccCode = NO; }

The default configuration of the simulator does not have “small Earth” and can only be entered in English. The method of adding Chinese is as follows: Select Settings– >General–>Keyboard–>International KeyBoards–>Add New Keyboard–>Chinese Simplified(PinYin) That is, we generally use the simplified Chinese pinyin input method, after good configuration, and then input text, click the pop-up keyboard “small earth” can be input Chinese.

If not, long press “Small Earth” to select Chinese.

The size of text must be greater than 0 and less than 10K

Image must be less than 64K

The URL must be greater than 0K

[[SDImageCache sharedImageCache] clearMemory];

NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (NSHTTPCookie *cookie in [storage cookies]) { [storage deleteCookie:cookie]; }

NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration]; [config.URLCache removeAllCachedResponses]; [[NSURLCache sharedURLCache] removeAllCachedResponses];

/ / clean up hard drive [[SDImageCache sharedImageCache] clearDiskOnCompletion: ^ {[MBProgressHUD hideAllHUDsForView: self. The view animated:YES]; [self.tableView reloadData]; }];

###JSON ‘ ‘convert to nil for AFNetworking use AFJSONResponseSerializer *response = [[AFJSONResponseSerializer alloc] init]; response.removesKeysWithNullValues = YES; _sharedClient.responseSerializer = response;

+ (BOOL)validatePwd:(NSString *)param {NSString *pwdRegex = @”^[a-za-z0-9]+$”; NSPredicate *pwdPredicate = [NSPredicate predicateWithFormat:@”SELF MATCHES %@”,pwdRegex]; return [pwdPredicate evaluateWithObject:param]; }

#pragma mark – check amount + (BOOL)checkPrice:(NSString *)price {/* 1. You can enter two decimal places 2. (1.) This should be avoided. 3. The first is 0, the second cannot be 0 / / / ^ (\ [1-9] d | 0) (. \ d? [1-9])? / / @ $amount “^ (0? [1-9]\d*|0)(\.\d? [1-9])? $”; 01 nsstrings * pattern = @ “^ (1-9] [\ \ d * | 0) (\ \. \ \ d? [1-9])? $”; NSPredicate *pred = [NSPredicate predicateWithFormat:@”SELF MATCHES %@”, pattern]; BOOL isMatch = [pred evaluateWithObject:price]; return isMatch; }