0
IM上的應用程序,具有搜索視圖中工作, 搜索視圖包含的tableView與3個部分 - i。由如何確定在UITableView的小區中的區段 - 目標c
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 3;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if (section == 0){
UITextField *title = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 320, 10)];
[title setBackgroundColor:[UIColor lightGrayColor]];
[title setTextAlignment:UITextAlignmentRight];
[title setFont:[UIFont boldSystemFontOfSize:15]];
[title setText:@"videos"];
return title ;
}
if (section == 1){
UITextField *title = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 320, 10)];
[title setBackgroundColor:[UIColor lightGrayColor]];
[title setTextAlignment:UITextAlignmentRight];
[title setFont:[UIFont boldSystemFontOfSize:15]];
[title setText:@"documents"];
return title ;
}
if (section == 2){
UITextField *title = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 320, 10)];
[title setBackgroundColor:[UIColor lightGrayColor]];
[title setTextAlignment:UITextAlignmentRight];
[title setFont:[UIFont boldSystemFontOfSize:15]];
[title setText:@"questions"];
return title ;
}
}
現在手動執行部與接收到的XML看起來像這樣我的所有數據:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>documents</title>
<item>
<title>how to count the days</title>
<link>some link...</link>
<date>11/09/2007 16:45:00</date>
<SupplierName>roei</SupplierName>
<CategoryName>the omer</CategoryName>
</item>
<item>
<title>research</title>
<link>some link...</link>
<date>16/05/2010 13:41:00</date>
<SupplierName>eran</SupplierName>
<CategoryName>shavoot</CategoryName>
</item>
</channel>
<channel>
<title> video </title>
<item>
<title>the end of holiday</title>
<link>some link...</link>
<date>06/06/2011 08:56:00</date>
<SupplierName>dina</SupplierName>
<CategoryName>shavoot</CategoryName>
</item>
<item>
<title>bible</title>
<link>some link...</link>
<date>24/05/2012 10:00:00</date>
<SupplierName>amir</SupplierName>
<CategoryName>shavoot</CategoryName>
</item>
</channel>
<channel>
<title>questions</title>
<item>
<title>questions for shavvot</title>
<link>some link...</link>
<date>28/10/2008 13:31:00</date>
<SenderName>אלי.ד.</SenderName>
<CategoryName>holidays</CategoryName>
</item>
<item>
<title>Shavoot</title>
<link>some link...</link>
<date>25/05/2008 01:01:00</date>
<SenderName>amir</SenderName>
<CategoryName>holidays</CategoryName>
</item>
</channel>
</rss>
,你可以見式我與段的名稱頭銜,但我應該如何確定,細胞的正確部分? IM解析所有的數據到一個數組,然後得到它使用字典:
NSDictionary *object = [ResultsArrayDisplay objectAtIndex:indexPath.row];
請幫我而言,我什麼也沒有幫助的在互聯網上迄今嘗試的幾個小時後。
好吧,即時通訊工作..我會讓你知道,如果我需要任何幫助。 TNX –
我終於做到了,謝謝你我的朋友,你幫了很多! –