Questions about iOS development (2)

Source: Internet
Author: User
Unable to debug the device "Errorlaunchingremoteprogram: failedtogetthetaskforprocess6405." ad-hocProfile does not support debugging. Change to developmentprofile. 11. unable to debug the device "Error launching remote program: failed to get the task forprocess 6405 ."
Ad-hoc Profile does not support debugging. Change to development profile.
12. If OTA cannot be downloaded, the system prompts "The application cannot be downloaded"
The bundle-identifier in the. plist file is incorrectly written (or contains Chinese characters), for example:

 
  bundle-identifier
 
 
  com.xxx.--APN--
 

Com. xxx.-APN-contains Chinese characters ("--") and should be changed to English.
Or the signature certificate is invalid. Check the signature certificate in Orgnizer.
12. EXEC_BAD often appears in ASIHTTPRequest.
Program crashes often occur when ASIHTTPRequest is used for asynchronous requests. Especially in the request process (not Finished), if you switch the view. Because it is an asynchronous request, the request object may call delegate (ViewController) at any time, but ViewController may have been released at this time. Because UIKit will release the currently unavailable ViewController at any time. If you switch to ViewController, the hidden ViewController will be released at any time. If the request calls back the delegate method of ViewController, and the ViewController is released by UIKit, EXEC_BAD will occur. It is also mentioned in the official documents: Requests don't retain their delegates, so if there's a chance your delegatemay be deallocated while your request is running, it is vital that you clearthe request's delegate properties. in most circumstances, if your delegate isgoing to be deallocated, you probably also want to cancel request, since you nolonger care about the request's status
Therefore, when ASIHTTPRequest is used for asynchronous programming, we need to clear the delegate attribute of the request. In the dealloc method of delegate (ViewController), you should:

[request clearDelegatesAndCancel];[request release];

Of course, a request cannot be a temporary variable, but a retained member object (or attribute). Otherwise, you cannot clearDelegatesAndCancel in the dealloc method.

13. Assertion failure in-[UIActionSheet showInView:]
Open action sheet in the main thread:

[selfperformSelectorOnMainThread:@selector(showActionSheet) withObject:nilwaitUntilDone:NO];


ShowActionSheet method:

-(void) showActionSheet{ sheet = [[UIActionSheet alloc] initWithTitle:@"This is my ActionSheet!" delegate:self cancelButtonTitle:@"OK"destructiveButtonTitle:@"Delete Message!" otherButtonTitles:@"Option1", @"Option 2", @"Option 3", nil];[sheet showInView:self.view];}

14. RegexKitLite compilation error
The following error is prompted during compilation:

"_uregex_find", referenced from: _rkl_search in RegexKitLite.o……

Add it to the Other Linke Flag of Build Settgins
-Licucore
15. Archive encountered the error "ResourceRules. plist: cannot read resources ".
Find the Code Signing Resource Rules Path in build settings, and enter $ (SDKROOT)/ResourceRules. plist

16. use ZombieEnable to solve the EXEC_BAD_EXCESS error
This error is caused by sending messages to a release object. You can enable the ZombieEnable parameter to find the real problem.
Edit Scheme, select Run... Debug, open the Arguments group, and add a parameter to Environment Variables:

Run the program. when the EXEC_BAD_EXCESS error occurs, the console will output the specific error information, such:
* **-[ITSMTicketCell release]: message sent to deallocated instance0x897e920
It is directly indicated that a message is sent to an object after it is released.

17. questions about the inability of Xcode4 to debug older devices from generation to generation 2
After upgrading to Xcode4, you will find that many programs cannot run on the 2nd generation devices (some 3rd generation devices, for example, iTouch 3 is actually still the 2nd generation hardware, and Xcode4 is only "Running ..." "Finished ..." No prompts are displayed in the Xcode console or device logs.
Note: the difference between two and three generations is the cpu architecture. Two generations of devices use the ARMv6 architecture cpu, and three generations use the ARMv7 architecture cpu. IPhone 2G/3G, iPod 1G/2G belongs to ARMv6 architecture (2 generations), iPhone 3GS/4, iPod 3G, iPad belongs to ARMv7 architecture (3 generations ).
Stackoverflow has a post about this. the answer to shapecatcher is the most accurate:
Http://stackoverflow.com/questions/6378228/switching-from-xcode3-to-xcode4-cant-load-programs-onto-older-ipod-touch
1. open Build Settings of Target, find the ubuntures option, and change it from "$ (ARCHS_STANDARD_32_BIT)" to "armv6 $ (ARCHS_STANDARD_32_BIT )". Note that the case sensitivity is true. "$ (ARCHS_STANDARD_32_BIT)" is a variable, which is actually equivalent to armv7.
2. the Base SDK does not need to be changed. it is still Lastest iOS.
3. open the Target's info, find Required device capabilities, and delete the following armv7. This option is the default setting added by Xcode4 in the project. if you do not remove it, steps 2-1st cannot take effect.
18. "Avalid provisioning profile for this device was not found ."
Add the device's UDID to your development certificate.

19. add devices to the portal
Connect to the device and enable Orgnizer. Select a device from the device list and click "Add to Portal" in the lower-left corner of the right window. Alternatively, right-click the device in the device column and select "AddDevice to Provisioning Portal ".

20. renew profile
Open Orgnizer and select Provisioning Profiles in the LIBRARY. In the right window, select the profile to renew and click "Refresh" in the lower right corner. Enter the Portal password and the profile will be renew.

21. renew signature certificate and device activation document
Remove expired signature certificates from the portal
Re-create development certificate and publish certificate
Provisioningprofiles)
Use the new certificate to recreate Provisioningprofiles for development and deployment.
Delete old certificate from key string
Install new provisioning profiles in XcodeOrganizer
Complete

The above is the content for iOS development FAQ (2). For more information, see PHP Chinese website (www.php1.cn )!

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.