iOS interview (2015.10.30)

Source: Internet
Author: User

Today to Shenzhen Feng Tai Rui da Industrial Co., Ltd. interview, interview divided into a written test and interview two parts, the results are very unsatisfactory, but learned a lot. The interview questions are recorded as follows:

1. Realization of three common methods of TableView

-(Nsinteger) Numberofsectionsintableview: (UITableView *) TableView

{

return [Titlearray Count]; //Returns the number of elements in the header array to determine the number of partitions

}

-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section

{

Switch (section) {

Case 0: return [dataArray1 count];//each partition usually corresponds to a different array, returning its number of elements to determine the row count of the partition

         Break

Case 1: return [dataArray2 Count];  break ;

Default: return 0;  break ;

}

}

-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath

{

    static NSString *cellidentifier = @"Cell"; //Initialize the cell and specify its type, or you can customize the cell

UITableViewCell *cell = (uitableviewcell*) [TableView Dequeuereusablecellwithidentifier:cellidentifier];

if (cell = = nil)

{

cell = [[[UITableViewCell Alloc]initwithframe:cgrectzero Reuseidentifier:cellidentifier] autorelease];

}

Switch (indexpath.section)

         {  

        Case 0://corresponds to the respective partition

[[Cell Textlabel] settext:[dataarray1 objectatindex:indexpath.row]];//add data to cell

Break ;

Case 1:    

[[Cell Textlabel] Settext:[dataarray2 ObjectAtIndex:indexPath.row];

Break  

Default:

[[Cell Textlabel] settext:@"Unknown"];

}

Return cell;//back to cell

}

2. Navigationcontroller Customize right button and set picture "1.png" as Button picture

3. JSON data parsing

4. Request a picture from the server and cache the picture

5, assign strong copy and other definition of variables when the use of keywords (arc mode and non-arc mode?) )

6, multi-threaded use

7, the extent of understanding the block

8, the use of Bluetooth

iOS interview (2015.10.30)

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.