Several questions about development experience and development experience

Source: Internet
Author: User
Tags file type file

Several questions about development experience and development experience

 

------------------------------- I am a handsome title bar [with eggs at the end ]-----------------------------------------------------

First of all, in terms of the UI, the question about internationalization in the application: Set the switch between Chinese and English. This is basically the creation of a New File type 1, File-> New-> flie-> Resource-> Strings File, create a New Strings File type File, note that the file name must be Localizable, because Xcode searches for international content based on the Localizable file, 2. Click the created file and click Localize in the control panel on the Right of Xcode .. to enable internationalization. 3. Add the corresponding language for Loacalization under the Info tab of the PROJECT. 4. After adding the language, the corresponding language file will appear in Localizable, so that you can directly compile the characters involved in the software in the file. For example: "OK" = "OK"; [Note: Do not forget the semicolon at the end] 5. The above is the configuration, and the following is used: Use the characters in it, you only need to use NSLocalizedString (..,..) you can, for example:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"WARING", nil) message:NSLocalizedString(@"NetworkConnectError", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"CANCEL", nil) otherButtonTitles:NSLocalizedString(@"OK", nil), nil];[alert show];

 

In this way, the application is configured internationally.

 

-------------------------------------- I am a gorgeous split line ------------------------------------------------------------------

Program debugging: Generally, resumable debugging is widely used, and printing and Output Using NSLog is not a minority. After all, this is more convenient. However, the program involves a large number of output statements, which causes potential risks to the application. Therefore, we can use this printing method, better control of debugging methods to minimize the impact of debugging on the program.
1.#ifdef DEBUG2.#define DMLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])3.#else4.#define DMLog(...) do { } while (0)
In this way, if you use DMLog, it can only be printed during debug build. _ PRETTY_FUNCTION _ can also help print the name of the function where the log is located.

 

----------------------------------------------- Or me, I am still a gorgeous split line ----------------------------------------------------

Generally, when an application is hosted on a dandelion package and uploaded, it selects the Save for Enterprise Deployment packaging method and then exports [Export]. Remember, the app for uploading dandelion cannot drag the package directly into iTunes and then drag it out to obtain the ipa package. In other words, the package is used to launch the Apple Store instead of for testing, dandelion is a test platform and cannot be installed on the uploaded package.

 

 

----------------------------------------------- Low-key and elegant split line ----------------------------------------------------------

In OC, lazy loading is widely used. In Swift2.0, you must use keywords to declare the Code:
    lazy var applicationDocumentsDirectory: NSURL = {        // The directory the application uses to store the Core Data store file. This code uses a directory named "lalala.ServiceShop" in the application's documents Application Support directory.        let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)        return urls[urls.count-1]    }()
On the main page of switching views
                let app = UIApplication.sharedApplication().delegate as! AppDelegate                app.createTabBarView()

 

----------------------------------------------------

The implementation principle of the drop-down menu is to set a tableView, which can be a transparent view at the bottom. An imageview is added on the top, and the background image can be set to the class with sharp corners. Then, a tableview is added, tablecell can also be customized.
About 3DTouch [Click the icon and jump to the interface], it mainly involves page Jump, And I mainly use the notification method for interface jump, register the notification in the "parent class" in the Root View of the program, and switch and call the interface in the corresponding interface. [Note: Pay attention to the delay during interface switching, because sometimes the redirection fails to achieve the target when the interface is not created yet.] For the https problem of network requests, the default setting for Xcode7 is https, so it is in info. configure the following in the plist file:
<key>NSAppTransportSecurity</key>    <dict>        <key>NSAllowsArbitraryLoads</key>        <true/>    </dict>

 

------------------- I'm coming again ------------------------------- the ** error message "Certificate identity 'iPhone Developer: xxxx ho (2J123456HA)' appears more than once in the keychain. the codesign tool requires there only be one. "At this time, your inner heart is rejected. This problem occurs when the last step is reached. It is estimated that all dead hearts will exist, but slowly, the reason is that the keychain access has an expired 'iphone Distribution: xxxx', but it is not displayed in the key chain/login, but in the key chain/system, and it is hidden, so you need to go to the key chain-> display expired certificates, and then put the key chain under the login and System All expired certificates of are deleted.

In addition, when searching for answers, I saw a post that may fail to delete the expired certificate, but it is displayed in the keychain that the deletion was successful. The solution to this problem is to restart the keychain and delete it, repeat this process until the deletion is successful.

Sometimes the expired and redundant certificates cannot be found in the keychain, but we can see the redundant certificates in the code signing of building setting of xcode target, this proves that our keychain is not clear and clean.

To sum up, the steps to solve this problem are: 1. Clear unnecessary certificates in the keychain. 2. Refresh the provisioning profile in xcode.

----------------------- Am I an egg? [Oh, NO] ------------------------- about how to view the crash information after the application crashes, we generally receive some crash stories.
// 2: Basic Information Date/Time: OS Version: Report Version: // 3: Exception Type: Exception Codes: Highlighted Thread: // 4: Thread backtracking Thread 0 name: dispatch queue: com. apple. main-threadThread 0: Thread 1: // 5: Thread status Thread 0 crashed with ARM Thread State (32-bit): // 6: Binary Image Binary Images:
(1) process information is related to the crash process. Incident Identifier is the unique Identifier of the crash report. The CrashReporter Key is the unique Key value corresponding to the device ID. The Hardware Model identifies the device type.
Process is the application name. (2) Basic information This section provides some basic information, including the date and time when the crash occurred (3) In this section, you can see the exception type thrown when the crash occurs. We can also see the Exception Code and the thread that throws the exception (4) thread backtracking this part provides the Backtracking logs for all threads in the application. Rollback is a list of all active frames when a flash is triggered. Address of the method for calling the binary library name
(5) The thread status is the value in the flashback register. Generally, this part of information is not required, because the information in the Backtracking part is sufficient for you to find out the problem. (6) This Part of the binary image lists the binary files that have been loaded during crash. By viewing the content, you can obtain the complete error information and locate the error. ------------------- Eggs to hello ----------------------- with a software Daquan Web site: http://www.sdifenzhou.com/category/black-apple/apple-software/page/6/

Reprinted please link: http://www.cnblogs.com/windsSunShine/p/5869465.html

[Personal opinion, don't like it]

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.