Not sure why these changes aren't in my code.

This commit is contained in:
Mark Rickert
2013-06-28 15:28:47 -04:00
parent 12b7ae2ef8
commit b482a15724
3 changed files with 8 additions and 7 deletions

View File

@@ -71,9 +71,9 @@ module ProMotion
def set_data_cell_defaults(data_cell)
data_cell[:cell_style] ||= UITableViewCellStyleDefault
data_cell[:cell_identifier] ||= build_cell_identifier(data_cell)
data_cell[:cell_class] ||= PM::TableViewCell
data_cell[:cell_identifier] ||= build_cell_identifier(data_cell)
data_cell[:accessory] = {
view: data_cell[:accessory],
value: data_cell[:accessory_value],
@@ -85,9 +85,9 @@ module ProMotion
end
def build_cell_identifier(data_cell)
ident = "#{data_cell[:cell_class]}"
ident = "#{data_cell[:cell_class].to_s}"
ident << "-#{data_cell[:stylename].to_s}" if data_cell[:stylename] # For Teacup
ident << "-#{data_cell[:accessory][:view].to_s}" if data_cell[:accessory]
ident << "-accessory" if data_cell[:accessory]
ident << "-subtitle" if data_cell[:subtitle]
ident << "-remoteimage" if data_cell[:remote_image]
ident << "-image" if data_cell[:image]

View File

@@ -104,10 +104,10 @@ module ProMotion
table_cell
end
def create_table_cell(data_cell)
table_cell = table_view.dequeueReusableCellWithIdentifier(data_cell[:cell_identifier])
unless table_cell
data_cell[:cell_style] ||= UITableViewCellStyleSubtitle
table_cell = data_cell[:cell_class].alloc.initWithStyle(data_cell[:cell_style], reuseIdentifier:data_cell[:cell_identifier])

View File

@@ -56,10 +56,11 @@ describe "PM::TableViewCellModule" do
it "should have the right custom re-use identifier" do
@subject.reuseIdentifier.should == "Cell"
end
it "should have the right generated re-use identifier" do
ip = NSIndexPath.indexPathForRow(2, inSection: 1)
subject = @screen.tableView(@screen.table_view, cellForRowAtIndexPath: ip)
subject.reuseIdentifier.should == "Cell-accessory"
subject.reuseIdentifier.should == "ProMotion::TableViewCell-accessory"
end
it "should have the correct height" do