42. Warning: multiplebuild commands for output file
Target references a duplicate name resource
Find the current target, expand, find the Copybundle Resources section, and then find the duplicate name in the resource, delete the one that is not
43. Signature error: Provisioningprofile can ' t be found
In Xcode when you update your certificate and then recompile your program, the real machine debugging will always appear code sign error:provisioning profile ' XXXX ' can ' t is found is not going to be another you are annoyed. Here is the solution, so that you solve the problem well.
1. Close your project, locate the project file Xxxx.xcodeproj, right-click on the file, and select "Show Package Contents" (Showpackage Contents). A new finder will be opened. Note: In fact, Xxxx.xcodeproj is a folder, where the newly opened a finder inside the three files is the Xxxx.xcodeproj folder inside the file.
2. Locate the project.pbxproj in the newly opened finder and open it. 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 that included 37d44e7f-0339-4277-9a82-c146a944cd46 in the way I looked, and I deleted them.
3. Save, restart your project, and then 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 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 automatically imported by default, such as Stdlib.h and Unistd.h.
47. Compile error: AutoLayout on iOS versions prior to 6.0
This issue occurs when the app for Target 4.0 is compiled in Xcode 4.6 (true machine debug, device 3GS, upgrade to iOS 6.1.3). Find the error. xib file, and in the document panel, J disables "Useautolayout" (see).
48, how to set the button Titlelabel text alignment?
To set the Contenthorizontalalignment property:
Emailbtn.contenthorizontalalignment= Uicontrolcontenthorizontalalignmentleft;
or adjust the text margin with Contentedgeinset (0 means misaligned):
Emailbtn.contentedgeinsets= uiedgeinsetsmake (0, 10, 0, 0);
Or they are used together.
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
The error occurred before the file was downloaded to a temporary file, but before it was moved to the documents directory (you can see the presence of the temporary file with Iexplorer).
Use "[Requestsetshouldattemptpersistentconnection:no];" Resolve this issue.
50. Compile error: "Hasbeen modified since the precompiled header was built"
Precompiled header when the file is modified. Clean and recompile.
51. Error could excutable permissions on the application
You can't install two different apps on the iphone with the same AppID. A problem typically occurs when you execute the project-->profile command in Xcode. Because the general real machine debugging will be installed on the iphone debug application, after the execution of Project-->profile will again install the program on the iphone, two programs of the AppID nature is the same, so the above error occurs. Workaround: First delete the app on the iphone and then execute the project-->profile command.
52. Instruments ERROR: Targetfaild to run as shown in.
Click on the lower left corner of the menu bar scheme, select "Edit Scheme ...", and in the left sidebar of the pop-up window, select "Profile Xxx.app" and change its "buildconfiguration" from "Release" to "Debug".
53. View the object that the pointer points to
If you know the address, you can use the GDB command to print the object represented by the address, for example:
PO 0x1fba2e20
If the pointer is not an object, use:
P0x1fba2e20
54, Xcode Packaging when the Skip install problem
Summary: In your own project need to set Skipinstall to No, in the introduction of other static library files in the 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 and only need to change dependent projects.
55. Error: Pushinga navigation controller is not supported
The SDK does not allow you to push a navigationcontroller directly in a navigationcontroller. You can use this code instead:
[Self.navigationControllerpushViewController:nc.topViewController Animated:yes];
56, why when the user click on the tab bar button, will always display the selected Navigationcontroller Rootviewcontroller?
You can specify a delegate property 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, 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 used a similar code to customize the Titleview:
UILabel* label = [[[UILabel alloc] init] autorelease];
Label. backgroundcolor=[uicolor clearcolor];
Label. text = self. title;
Label. font = [uifont systemfontofsize: 20];
......
[Self. Navigationitem Settitleview: label];
If so, you need to re-customize Titleview with the same code to refresh Navigationbar title. Or, use the default titleview instead of customizing it.
58. Nested push animation can result in corrupted navigation bar ...
If you pushviewcontroller in the code several times (more than two times), the above information will appear, which is neither an error nor a lot of warning, just the console output information, but it will cause some potential problems, such as Navigationcontroller Stack error (for example, users sometimes have to double-press two times to Backbutton to return to the upper view). The output is often accompanied by 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 a user clicks on a tableviewcell, pops up a viewcontroller, and then uses the code in the Viewcontroller Viewdidload method or Viewwillappear method to Push another Viewcontroller. This second push is not a user action but is triggered by the 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 execute, simulator not
Sometimes the simulator can not debug the situation, the program runs out, and the simulator seems to "die" dropped, only a black window appears, press the home button also does not function. But the program can run on the real machine. The cause of this problem is unknown, but one solution is to open the emulator in another project and then remove the problematic program from the emulator.
60. Warning "numeration not Handledin switch"
In the new Apple LLVM compiler 4.0, the switch variable is checked, and if the variable is an enumeration type, you need to handle all the enumeration values, you can add a default:break, and the statement indicates that all the enumerated values that are not enumerated are 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