Android Create and use database detailed guide (1)

Source: Internet
Author: User

Print an object: NSLog (@ "%@", Stu); The name and memory address of the object that is printed by default, and the description method needs to be overridden

// Override Description Method -(NSString *) description{    return [nsstring stringWithFormat:@ "  title:%@,icon:%@,answer:%@,options:%@", Self.title, Self.icon, Self.answer, Self.options];} // One of the last options is an array, others can print normally, only the array cannot be printed, you need to extend a class to Nsarray, rewrite: Descriptionwithlocale method

Overriding method in Nsarray's classification Nsarray + log: Descriptionwithlocale

-(NSString *) Descriptionwithlocale: (ID) locale{nsmutablestring*STRM = [nsmutablestringstring]; [StrM appendString:@"(\ n"];  for(IDObjinchSelf ) {[StrM AppendFormat:@"\t%@,\n", obj]; } [StrM appendString:@")"]; returnStrM;}

This can be printed in Chinese, usually read from the plist file some properties, one of the properties is an array, programming to see if the array is taken, you can pass the above printing method;

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.