IOS Learning (error 1 encountered in the Project)

Source: Internet
Author: User

IOS Learning (error 1 encountered in the Project)

1. [AppModel copyWithZone:]: unrecognized selector sent to instance 0x7ffda9f4cf70

* ** Terminating app due to uncaught exception 'nsinvalidargumentexception ', reason:'-[AppModel copyWithZone:]: unrecognized selector sent to instance 0x7ffda9f4cf70'

*** First throw call stack:

Cause of this error: attribute definition issues should be noted that when defining an attribute

Several problems may occur during the property operation.

Nonatomic: single thread, High Efficiency

Atomic: multi-thread, low efficiency, but default

ReadWrite: readable and writable, which is also the default

ReadOnly: Read-Only

Assign: it refers to the int, float. And other numeric types. It is the default

Copy: Refers to a string object. For example, name

Retain: indicates an object. For example, time object

Strong: strongly referenced

Weak: weak reference

The cause of my error is that when I define a class object, I misuse copy instead of strong.

2. When using tableView, you will find that this method is not executed sometimes. The reason is: the frame of _ tableView is not set, and _ dataArry is not assigned a value. Another way is to use an Asynchronous Method When retrieving data, but the wood has to refresh tableView data.

-(UITableViewCell *) tableView :( UITableView *) tableView cellForRowAtIndexPath :( NSIndexPath *) indexPath {

Return nil;

}

3. Errors Caused by data NSData not initialized

Terminating app due to uncaught exception 'nsinvalidargumentexception ', reason: 'Data parameter is nil'

4. If the retrieved data is null, the following error occurs:

* ** Terminating app due to uncaught exception 'nsangeexception', reason: '***-[_ NSArrayM objectAtIndex:]: index 3 beyond bounds [0.. 2]'

 

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.