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)