Questions about iOS development (5) and questions about ios development

Source: Internet
Author: User

Questions about iOS development (5) and questions about ios development

42. Warning: Multiplebuild commands for output file

Target references resources with duplicate names

Find the current target, expand it, find the CopyBundle Resources column, find the resource with the duplicate name in it, and delete the unwanted one.

43. Signature error: Provisioningprofile can't be found

In Xcode, When you update your certificate and re-compile your program, the real machine debugging will always show Code Sign error: provisioning profile 'xxxx' can't be found will be annoying to you. The following describes the solution to solve this problem.

1. Close your project, find the project file XXXX. xcodeproj, right-click the file, and select "show package Contents ). A new Finder is opened. Note: In fact, XXXX. xcodeproj is a folder. The three files in a newly opened Finder are the files in the XXXX. xcodeproj folder.

2. Find project. pbxproj in the newly opened Finder and open it. Find the encoding information of your previous certificate here. The error message I reported earlier is:

CodeSign error: Provisioning profile '37d44e7f-0339-4277-9A82-C146A944CD46 ', so I found and deleted all rows that contain the limit by searching.

3. Save, restart your project, and then compile. OK.

44. After upgrading to Xcode 4.6, arc4random_uniform becomes unavailable.

After the project is upgraded to Xcode4.6, a compilation error occurs:

Useof undeclared identifier 'arc4random _ uniform'; did you mean 'arc4random _ stir '?

 

It seems that SDK 6.1 does not support 'arc4random _ uniform'. If it is changed to 'arc4random ', the problem is solved.

45. After Xcode4.6 is upgraded, a compilation error occurs: Undefinedsymbols for architecture x86_64: "_ OBJC_CLASS _ $ _ NSMutableOrderedSet"

In build settings, set "Implicitly link Objective-C Runtime Support" to NO to solve the problem.

46. After upgrading Xcode4.6, a warning is displayed: function 'sleep 'is invalid in C99

# Import <unistd. h>. After Xcode4.6 is upgraded, many header files are not automatically imported by default, such as stdlib. h and unistd. h.

47. Compilation error: autolayout on ios versions prior to 6.0

This problem occurs when the Target 4.6 app is compiled in Xcode 4.0 (for real-machine debugging, the device is 3GS and upgraded to iOS 6.1.3 ). Locate the. xib file that reported the error, and disable "UseAutolayout" (SEE) on the Document panel.

48. How do I set the text alignment of the TitleLabel button?

Set the contentHorizontalAlignment attribute:

EmailBtn. contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;

Or use contentEdgeInset to adjust the text margin (0 indicates not alignment ):

EmailBtn. contentEdgeInsets = UIEdgeInsetsMake (0, 10, 0, 0 );

Or they can be used together.

49. Error: errorDomain = UA_ASIHTTPRequestErrorDomain Code = 8 "Failed to move file from

Theerror happens after the file is downloaded; but before the file is successfullymoved from the tmp location to the Cache location

The error occurs when the file is downloaded to the temporary file, but it has not been moved to the files directory (you can use iExplorer to view the existence of the temporary file ).

Use [requestsetShouldAttemptPersistentConnection: NO]; to solve this problem.

50. Compilation error: "hasbeen modified since the precompiled header was built"

 

The file is modified when the pre-compiled header is used. Clean and re-compile.

51. Error cocould not change excutable permissions on the application

Two different applications cannot be installed with the same AppID on the iPhone. Generally, an error occurs when executing the Project --> Profile command in Xcode. Generally, a debug application will be installed on the iPhone during debugging on the real machine. After Project --> Profile is executed, the program will be re-installed on the iPhone. The AppID of the two programs is naturally the same, the above error occurs. Solution: First Delete the program on the iPhone, and then execute the Project --> Profile command.

52. Instruments error: Targetfaild to run, as shown in.


Click the lower left corner of Scheme in the menu bar and select "Edit Scheme... in the pop-up window, select "Profile xxx. app, and change its "BuildConfiguration" from "Release" to "Debug ".

53. view the object pointed to by the pointer

If you know the address, you can use the GDB command to print the object represented by this address, for example:

Po 0x1fba2e20

If the pointer is not an object, use:

P0x1fba2e20

54. skip install during Xcode Packaging

Summary: In your project, you need to set skipinstall to NO. In the project that introduces other static library files, set skip install to YES. Otherwise, your program cannot be released in Orgnizer.

-The primary App needs to be deployed, so do not set the Skip Install to YES. You only need to change the dependency project.

55. Error: Pushinga navigation controller is not supported

The SDK cannot push a NavigationController directly in a NavigationController. You can use this code instead:

[Self. navigationControllerpushViewController: nc. topViewController animated: YES];

56. Why is the rootViewController of the selected NavigationController always displayed when you click the button on the Tab bar?

You can specify a delegate attribute for TabBarController and implement the UITabBarControllerDelegate delegate in the delegate object:

# Pragma mark TabBarController Delegate

-(BOOL) tabBarController :( UITabBarController *) tabBarControllershouldSelectViewController :( UIViewController *) viewController {

UIViewController * tbSelectedController = tabBarController. selectedViewController;

If ([tbSelectedController isEqual: viewController]) {

Return NO;

}

Return YES;

}

57. Using setTitle cannot refresh the title text of NavigationBar

Sometimes the setTitle method of ViewController cannot refresh the title text of NavigationBar. It is very likely that you have customized titleView using similar code:

UILabel * label = [[UILabel alloc] init] autorelease];

Label. backgroundColor = [UIColor clearColor];

Label. text = self. title;

Label. font = [UIFont systemFontOfSize: 20];

......

[Self. navigationItem setTitleView: label];

In this case, you need to use the same code to re-customize the titleView to refresh the NavigationBar title. Alternatively, use the default TitleView instead of customizing it.

58. nested push animation can result in completed upted navigation bar ......

If you repeatedly (more than twice) pushViewController in the Code, the above information will appear. This is neither an error nor a lot of warnings, but the information output by the console, however, it may cause some potential problems, such as the stack error of NavigationController (for example, a user may have to press backButton twice to return to the upper-level view ). The following information is often output:

Unbalancedcallto begin/end appearance transitions <FirstViewController: 0x2a2c00>

The so-called continuous multiple times means that at least one push is directly called by code without user interaction. For example, when a user clicks a TableViewCell, A ViewController is displayed, and the code is used to Push another ViewController in the viewDidLoad method or the viewWillAppear method of the ViewController. This second push is not triggered by the user action but by the Code, which causes the above problems.

The solution is to set the animated parameter to NO during the second push.

59. The real machine can be executed, but the simulator cannot.

Sometimes, when the simulator cannot be debugged, the program exits as soon as it is run, and the simulator seems to be "stuck", only a black window appears, and pressing the Home key does not work. But the program can run on the real machine. The cause of this problem is unknown, but there is a solution: Open the simulator in another project, and then delete the problematic program in the simulator.

60. Warning "numeration not handledin switch"

In the new Apple LLVM compiler 4.0, the switch variable is checked. If the variable is of the enumeration type, all enumeration values need to be processed. You can add a default: break; statement indicates that all unenumerated values have been processed. You can also set the "Check switch statements" Compilation option to NO. You can also use the following macro to ignore the switch check:

# Pragmaclang diagnostic push

# Pragmaclang diagnostic ignored "-Wswitch"

... <Switchstatment>...

# Pragmaclang diagnostic pop



IOS 5 System Development

There are not many new features in iOS 5 Beta 5, and a hearing aid-like mode is added. In addition, the only thing worth mentioning is that the voice input function can be used for text message input through the speech recognition module. When iOS 5 is added with the voice input function, many features of Apple are intentionally or unintentionally enhancing the user experience of people with disabilities, including the previously mentioned gesture operations, the original intention is to facilitate the development of persons with disabilities in the hand, and this voice input function can also greatly facilitate the use of iPhone text input for persons with disabilities. On the voice input interface, in addition to being mentally handicapped everywhere, Apple also develops different functions for users in different regions. For example, the iOS 5 system will add the "earthquake warning" function to Japanese users. After the magnitude 9 earthquake in March 11 this year, I believe that the user-friendly earthquake warning feature of Apple iOS 5 will be welcomed by Japanese users. IOS 5 will be built into the earthquake warning application 6, iOS 5 Beta 6 in August 20, 2011, Apple released 6th iOS 5 system Beta versions. There are not many updated functions in iOS 5 Beta 6, mainly focusing on improving the use experience in the iTunes App Store. You can directly upgrade the application through the App Store. Compared with the operation steps, if the iOS operating system of the old version needs to upgrade the application, it will automatically jump to the iPhone's main screen and tell you, the application you want is being downloaded. In iOS 5 Beta 6, after you click the Upgrade button of the application, the download process will be performed in the background, rather than requiring you to jump back to the system desktop. Once the upgrade process is complete, the Upgrade button changes to the installed status. Directly update the application

Is it good for beginners to get started with iOS 5 application development, or is it good for basic iOS 5 tutorials?

I am reading this basic iOS 5 tutorial. We recommend that you get started with the Stanford Old Man video.

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.