Learn essay notes (not organized)

Source: Internet
Author: User

1. When processing constant volume data using Fmdb, the data must be encapsulated as an object, or the program will crash and error. For example, when I want to store a bool value in the database, I need to do these things:

-(BOOL) Insertnewmodeldatatodatabase: (Flower *) flower{fmdatabase*db =[Fmdatabase DatabaseWithPath:self.databasePath]; if(! [DB Open])returnNO; int isnotification = (flower.neednotification)? 1:0; BOOL Success= [db executeupdate:@"INSERT into flowers (name, soil, date, time, pic, Noti) VALUES (?,?,?,?,?,?)", Flower.name, Flower.soil, Flower.date, Flower.time, Flower.pic, [NSNumber numberwithint:isnot        Ification]];        [DB close]; if(!success) NSLog (@"%@", [DB lasterrormessage]); returnYES;}

2. How to remove the blank of the UITableViewCell line, add the following code:

#pragmaMark displays the full split line (clear left blank)-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell Forrowatindexpath: (Nsindexpath *) indexpath{if([Cell Respondstoselector: @selector (setseparatorinset:)]) {[Cell Setseparatorinset:uiedgeinsetszero]; }        if([Cell Respondstoselector: @selector (setlayoutmargins:)]) {[Cell Setlayoutmargins:uiedgeinsetszero]; }}- (void) viewdidlayoutsubviews{if([Self.detailtableview respondstoselector: @selector (setseparatorinset:)]) {[Self.detailtableview setSeparator    Inset:uiedgeinsetszero]; }        if([Self.detailtableview respondstoselector: @selector (setlayoutmargins:)]) {[Self.detailtableview Setlayoutmarg    Ins:uiedgeinsetszero]; }}

Learn essay notes (not organized)

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.