IOS Development Hundred Questions (5)

Source: Internet
Author: User

42. Warning: multiplebuild commands for output file

Target references a resource that has been repeatedly named

Locate the current target, and then expand. Find the Copybundle Resources section. Then we find the resources of repeated names inside. You can remove the one you don't want.

43. Signature error: Provisioningprofile can ' t be found

In Xcode when you update your certificate and then compile your program again, the real machine debugging will always appear code sign error:provisioning profile ' XXXX ' can ' t is found will be another you very annoyed. Here are the solutions to help you solve the problem very well.

1. Close your project. Locate the project file Xxxx.xcodeproj, and right-click on the file. Select "Show Package Contents" (Showpackage Contents). A new finder will be opened. Note: In fact, Xxxx.xcodeproj is a directory, where the newly opened finder inside the three files is the Xxxx.xcodeproj directory inside the file.

2. Locate the project.pbxproj in the newly opened finder. and open. In this find the encoding information for your previous certificate. The error message I reported earlier is:

CodeSign error:provisioning profile ' 37d44e7f-0339-4277-9a82-c146a944cd46 ', So I found all the rows containing 37d44e7f-0339-4277-9a82-c146a944cd46 in the way I looked. and delete.

3. Save and start your project again. Re-compile.

It's OK.

44. Arc4random_uniform is not available after upgrading to Xcode 4.6

A compilation error occurred when the project was upgraded to Xcode4.6:

Useof undeclared identifier ' arc4random_uniform '; Did you mean ' Arc4random_stir '?

It seems that SDK 6.1 does not support ' arc4random_uniform ', replaced with ' arc4random ' after problem solving.

45, after upgrading Xcode4.6, there is a compilation error: Undefinedsymbols for architecture x86_64: "_objc_class_$_nsmutableorderedset"

In the build settings. Set "implicitly link objective-c Runtime support" to no, problem solved.

46, after upgrading Xcode4.6. A warning appears: function ' sleep ' is invalid in C99

#import <unistd.h> Post-resolution. After upgrading Xcode4.6, many header files are not actively imported by default. For example, Stdlib.h and Unistd.h.

47. Compile error: AutoLayout on iOS versions prior to 6.0

This issue occurs when you compile the app for Target 4.0 in Xcode 4.6 (True machine debugging. Device is 3GS, upgrade to iOS 6.1.3). Find an error. xib file. In the document panel, J disables "Useautolayout" (see).

48, how to set Buttontitlelabel text alignment?

To set the Contenthorizontalalignment property:

Emailbtn.contenthorizontalalignment= Uicontrolcontenthorizontalalignmentleft;

or adjust the text margin with Contentedgeinset (0 means incorrect alignment):

Emailbtn.contentedgeinsets= uiedgeinsetsmake (0, 10, 0, 0);

Or they are used together at the same time.

49. Error: Errordomain=ua_asihttprequesterrordomain code=8 "Failed to move the file from

Theerror happens after the file is downloaded; But before the file was successfullymoved from the TMP location to the Cache location

An error occurred downloading the file to a temporary file. But before it is moved to the documents directory (can be used iexplorer to see the existence of temporary files).

Use "[Requestsetshouldattemptpersistentconnection:no];" Resolve this issue.

50. Compile error: "Hasbeen modified since the precompiled header was built"

The file was modified when the precompiled header was compiled. Clean and compile again.

51. Error could excutable permissions on the application

You can't install two different apps on the iphone with the same AppID. Typically a failure occurs when you run the Project-->profile command in Xcode. Since a debug application is installed on the iphone during normal debugging, the program will be reinstalled on iphone after running Project-->profile. The AppID of the two programs is naturally the same. The above error occurs. Workaround: Delete the app on your iphone first. Run the Project-->profile command again.

52. Instruments ERROR: Targetfaild to run, for example, as seen.


Click on the lower left corner of the menu bar scheme. Select "Edit Scheme ..." To change its "buildconfiguration" from "Release" to "Debug" by selecting "Profile Xxx.app" in the left sidebar of the popup form.

53. View the object that the pointer points to

Assuming you know the address, you can print the object represented by the address with the GDB command. Like what:

PO 0x1fba2e20

Assuming that the pointer is not an object, use:

P0x1fba2e20

54, Xcode Packaging when the Skip install problem

Summary: In your own project, you need to set Skipinstall to No, in the introduction of other static library files in project skip install set to Yes, otherwise you can not publish your program in Orgnizer.

-The main app needs to be deployed. So do not set the skip install to Yes, only need to change the dependency on the project.

55. Error: Pushinga navigation controller is not supported

The SDK does not agree to push a navigationcontroller directly in a navigationcontroller. You can replace it with this code:

[Self.navigationControllerpushViewController:nc.topViewController Animated:yes];

56, why when the user clicks on the tab bar button, will always display the selected Navigationcontroller Rootviewcontroller?

You can specify a delegate property for Tabbarcontroller and implement Uitabbarcontrollerdelegate trust 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, use Settitle cannot refresh the title text of Navigationbar

Sometimes using Viewcontroller's Settitle method does not refresh the title text of Navigationbar. It is very likely that you have customized the Titleview with 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];

Suppose so. You need to use the same code again to customize Titleview, ability to refresh Navigationbar title. Or, use the default titleview instead of customizing it.

58. Nested push animation can result in corrupted navigation bar ...

Suppose you pushviewcontroller multiple times (more than two times) in your code. The above information, which is neither an error nor a lot of warnings, is just the information of the console output, but it can lead to some potential problems, such as Navigationcontroller stack errors (for example, users must sometimes double-click two times Backbutton ability to return to the upper view). It is often accompanied by output such as the following information:

Unbalancedcalls to begin/end appearance transitions <FirstViewController:0x2a2c00>

The so-called successive times means that at least one push is called without user interaction and directly from the code. For example, when the user clicks on a Tableviewcell, a viewcontroller pops up. Then there is a viewcontroller in the code Push for this Viewcontroller Viewdidload method or Viewwillappear method. This second push is not a user action but is triggered by code, and therefore causes the problem.

The workaround is to set the animated parameter to NO at the second push.

59, the real machine can run, simulator not

Sometimes the simulator can not debug the situation, the program will exit when the operation, and the simulator seems to "die" dropped. Only a black-and-black form appears. Pressing the home key also has no effect.

But the program can run on the real machine.

The solution to this problem is unknown. But there is one solution: Open the emulator in a project. Then you can delete the problematic program in the simulator.

60. Warning "numeration not Handledin switch"

The switch variable is checked in the new Apple LLVM compiler 4.0. Assuming that the variable is an enumeration type, you need to handle all the enumeration values. You can add a default:break; The statement indicates that all enumerated values have been processed. or set the compile option "Check switch statements" to No.

You can also ignore the switch check with the following macros:

#pragmaclang Diagnostic push

#pragmaclang diagnostic ignored "-wswitch"

... <switchstatment>..

#pragmaclang Diagnostic Pop


IOS Development Hundred Questions (5)

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.