对于部分在我的UITableView数量的正确数量,我使用以下功能:numberOfRowsInSection没有返回行
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return _matchCenterArray.count;
}
这正常工作,并显示在表中部分的正确的号码。它指的是看起来像这样的_matchCenterArray
:
(
{
"Top 3" = (
{
"Image URL" = "http://thumbs4.ebaystatic.com/m/mu05CM1bactFTAWZjesohNg/140.jpg";
"Item URL" = "http://www.ebay.com/itm/Nexus-7-Latest-Model-16GB-Wi-Fi-7in-Black-2nd-Generation-2013-/281443895415?pt=US_Tablets";
Price = "170.0";
Title = "Nexus 7 (Latest Model) 16GB, Wi-Fi, 7in - Black (2nd) Generation 2013";
},
{
"Image URL" = "http://thumbs4.ebaystatic.com/m/mjkaCfDBdTQ6S-VTD0kFimA/140.jpg";
"Item URL" = "http://www.ebay.com/itm/Asus-Google-Nexus-7-2nd-Generation-Tablet-7-16GB-Android-4-3-/351173222631?pt=US_Tablets";
Price = "165.59";
Title = "Asus Google Nexus 7 2nd Generation Tablet 7\" 16GB Android 4.3 ";
},
{
"Image URL" = "http://thumbs4.ebaystatic.com/m/mjIENDWxrHTfcrO_Tmu4-zw/140.jpg";
"Item URL" = "http://www.ebay.com/itm/Google-Nexus-7-16GB-HD-K008-NEXUS7-ASUS-2B16-2nd-Gen-Tablet-Priority-Ship-/301315740555?pt=US_Tablets";
Price = "164.99";
Title = "Google Nexus 7 16GB HD K008 NEXUS7 ASUS-2B16 2nd Gen Tablet Priority Ship";
},
{
"Search Term" = "nexus 7 16gb";
}
);
},
{
"Top 3" = (
{
"Image URL" = "http://thumbs3.ebaystatic.com/m/mbSjXw608gtlLhYC5GbrbOg/140.jpg";
"Item URL" = "http://www.ebay.com/itm/rolex-datejust-/301318985642?pt=Wristwatches";
Price = "400.0";
Title = "rolex datejust";
},
{
"Image URL" = "http://thumbs3.ebaystatic.com/m/mx2eBCLXBEY30DXIIMrm_MQ/140.jpg";
"Item URL" = "http://www.ebay.com/itm/VINTAGE-LADIES-ROLEX-STANDARD-17J-GOLD-FILLED-WATCH-WORKING-NICE-/111466728842?pt=Wristwatches";
Price = "349.99";
Title = "VINTAGE LADIES ROLEX STANDARD 17J GOLD FILLED WATCH WORKING NICE ";
},
{
"Image URL" = "http://thumbs2.ebaystatic.com/m/mj7-GblU-4Al2X5q0sRvkfw/140.jpg";
"Item URL" = "http://www.ebay.com/itm/Rolex-17000-Quartz-Datejust-BLACK-DIAL-5035-/271610085029?pt=Wristwatches";
Price = "400.0";
Title = "Rolex 17000 Quartz Datejust BLACK DIAL 5035";
},
{
"Search Term" = rolex;
}
);
}
)
据我所看到的,它是前3数组的数组。在这种情况下,有两个排名前3阵列,这导致了两个部分。就每节的行数而言,我希望它是Top 3数组中的字典对象的数量。
在这种情况下,如果我没有弄错,它们在这个数组中似乎都有4个字典。我试过用下面的函数做这个,但是它只显示每个部分一行:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSArray *currentSectionArray = _matchCenterArray[section];
return currentSectionArray.count;
return 3;
}
你试过调试它吗?在numberOfRowsInSection函数中放置一个断点,看看currentSectionArray是什么? – sha 2014-09-29 17:37:32