Tag:xcode

  • IOS Development – Record solutions to problems encountered in the development process and summary of experience – 1

    Time:2019-8-24

    Statement: The following contents are taken from the author’s daily notes from the initial stage to the present. It is unavoidable that there are some misunderstanding deviations in the introduction. Welcome to point out that Long-term update of this article (second address: portal) 1. BadggeVaule bubble tip, self. navigationController. tabBarItem. badgeValue 2. Git terminal command […]

  • IOS Development-View Gesture Click Response

    Time:2019-8-23

    Implementing view gesture click response In UIViewController, add the protocol UIGesture Recognizer Delegate, and then add the following code to the. m file: UITapGestureRecognizer* singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; [self.view addGestureRecognizer:singleTap];  // This can be added to any control, such as if you just want to respond to WebView, and I’m filling the entire […]

  • IOS Development – Judging whether an array is space-time or not, the difference between the two commonly used ways of writing

    Time:2019-8-22

    Some developers, when judging whether an array is empty, write as follows: if (array != nil) Or if (array.count != 0) In fact, strictly speaking, both of them are inadequately considered and unstable, and ignore a more common situation. First of all, the difference between them. array == nil This situation refers to the fact […]

  • IOS Development – Error Reporting: clang: error: linker command failed…

    Time:2019-8-21

    clang: error: linker command failed with exit code 1 (use -v to see invocation) IOS development must be a mistake, now summarized as follows, generally these three aspects of the problem, if not which you really troubled. 1. Reference error, put*H is. M. Check all your references. 2. Then you refer to third-party libraries. You […]

  • IOS Development-Several Use Methods of Strings

    Time:2019-8-20

    Stitching strings // Stitching strings NSString* string1, string2; // Existing strings need to be connected to string1 and string2 // Method 1. String = [NSString initWithFormat:@”%@,%@”, string1, string2]; // Method 2. string = [string1 stringByAppendingString: string2]; // Method 3. string = [string string string ByAppendingFormat:@”%@,%@”, string 1, string 2]; substr // Intercept strings NSString*string [email protected]”sdfsfsfsAdfsdf”; […]

  • IOS development – how many words can be input remaining + label on textView camouflaged as placeHolder

    Time:2019-8-19

    // How many words are left to enter + label on textView masquerades as placeHolder -(void)textViewDidChange:(UITextView *)textView{ NSInteger inputLength = 40 – self.textView.text.length; NSString * remainder = [NSString string WithFormat:@ “Remaining input%@word,@ (inputLength)]; NSMutableAttributedString * attString = [[NSMutableAttributedString alloc] initWithString:remainder]; [attString addAttributes:@{NSForegroundColorAttributeName:[UIColor redColor], NSFontAttributeName:MyFont(14)} range:[remainder rangeOfString:[NSString stringWithFormat:@”%@”, @(inputLength)]]]; self.changeLabel.attributedText = attString; } -(IBAction)touchOther:(UIControl *)sender { […]

  • IOS Development – How to Slim ViewController

    Time:2019-8-18

    How to slim down ViewController? Separate the DataSource of UITableView into another class. The logic of data acquisition and transformation is separated into another class. Separate the logic of the assembly control into another class. In fact, MVC has only three layers, but it does not limit you to only three layers. Therefore, we can […]

  • IOS Development-Implementing Calling in App

    Time:2019-8-17

    The implementation code is as follows: // Call -(void)call{ UIAlertView * alertView = [[UIAlertView alloc] init]; AlertView. title = @ “Are you sure you want to call customer service? “; alertView.message = @”4000-198-716”; alertView.delegate = self; [alertView addButton WithTitle:@ “OK”]; [alertView addButton WithTitle:@ “Cancel”]; [alertView show]; } -(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex == 0) { […]

  • Xcode 7 Making Dynamic Framework

    Time:2019-8-16

    Dynamic Framework 1. Create a new project. Select iOS-Framework & Library on the left and Cocoa Touch Framework on the left. 2. Now you can create the classes and methods you need to encapsulate. 3. Select Build Phases in the project target, and then select the Headers option under Build Phases. Without this option, you […]

  • IOS Development Sharing Solution to the Question Mark on the Right Side of the Reference Folder in Xcode

    Time:2019-8-15

    Today, when I opened the project, I found that many of the files in it had a “? “,”A”is behind some files, and sometimes you see”M”behind some files. What do these mean? First, it’s about version libraries.A stands for add, m for modify, and? For unrecognized. Usually, if you use a version controller like GIT […]

  • IOS development – how to use tabBarController

    Time:2019-8-14

    Because it is not very difficult, go directly to the code, look at the basic understanding of the train of thought. 1. Create a tabBarViewController M file #import “SSTabBarViewController.h” #import “constant.h” @interface SSTabBarViewController () @end @implementation SSTabBarViewController -(instancetype)init { self = [super init]; if (self) { UINavigationController * newNavigationController = [WPUtil getViewControllerWithIdentifier:@”new” storyboardName:@”New”]; UINavigationController * […]

  • IOS Development – Setting the Color and Font Properties of Navigation Bar

    Time:2019-8-13

    The code is as follows: #define kColorBarTint [UIColor colorWithRed:56/255.0 green:170/255.0 blue:27/255.0 alpha:1.0] #import “SSMyViewController.h” @interface SSMyViewController () @end @implementation SSMyViewController -(void)viewDidLoad { [super viewDidLoad]; // Set Navigation Bar Background Color & Title Color [self.navigationController.navigationBar setBarTintColor:kColorBarTint]; [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:22],NSForegroundColorAttributeName:[UIColor whiteColor]}]; [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]]; } -(void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end