iOS common error grooming continues to update

Source: Internet
Author: User

this article reprinted to http://blog.csdn.net/yesjava/article/details/80861851. Mutating method sent to immutable object '

It is literally understood that mutable messages are sent to immutable objects. For example, an object of type Nsdictionary calls the SetValue method. The nsdictionary should be changed to the nsmutabledictionary type.

2.Local Declaration of ' content ' hides instance variable

The variables defined inside the function are usually the same as the class attribute variables. There is a rare case of duplicate system variables.

3.unrecognized Selector sent to instance

Most of the time, the object is in the early release, and in the absence of the hope of his release, the pointer is still there, the object is gone.

Many times, it is because the INIT initialization function, the property assignment does not use the Self.foo assignment, but directly to Foo assignment, resulting in the Property object is not retain (the heart thought retain), and early release.

4. Compiling with ASIHTTPRequest does not pass

The reason is that some class libraries are not added. Add these libraries into the cfnetwork, SystemConfiguration, mobilecoreservices, and Libz.dylib

5. Add UIButton in UIView click does not work

The reason is that the UIButton frame is beyond the frame range of the UIView. In fact UIView does not set frame, after setting (the range must be outside the UIButton), UIButton Click on it can be

6. When using Presentviewcontroller and Dismisspresentviewcontroller, if this error is reported: While presentation was in progress, modify the method to [MainView  Dismissmodalviewcontrolleranimated:no]; Change the parameter animated to No; If you report this error while a presentation or dismiss are in progress, try this

 if (![ [MainView Modalviewcontroller] isbeingdismissed] {
        [MainView Dismissmodalviewcontrolleranimated:no];
   }
7. When calling the system album, it is very easy to have a memory warning, adding red code will be better:


Uiimagepickercontroller * Picker = [[Uiimagepickercontroller alloc]init];
Picker.delegate = self;
picker.allowsediting = NO; Whether it can be edited
Picker.videoquality=uiimagepickercontrollerqualitytypelow;
Camera
Picker.sourcetype = Uiimagepickercontrollersourcetypecamera;
[Self presentmodalviewcontroller:picker animated:yes];
[Picker release];


8.ios developers have encountered a mistake: exc_bad_access. This is quite similar to the second one. The usual debugging method is to add the nszombieenabled variable, adding the method to Baidu itself.

and used in the development process

[[Nsnotificationcenterdefaultcenter]

To publish local messages, this also often occurs with exc_bad_access errors. This time only needs to be in your view alive Viewcontrollers of the Dealloc method to join

[[nsnotificationcenterdefaultcenter]removeobserver:selfname:@ "Yournotification" object:nil]; it's OK.


9. Meet an egg-ache problem "linker command failed with exit code 1 (use-v to see invocation)". I can't find the reason to go through it. And then there was this warning.

Duplicate symbol _objc_class. The original import. m file instead of. h file when importing a class

iOS common error grooming continues to update

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.