Sha256: fbc713dbe098fd5398c770d8d41bee307b03e85ec6b762402a513b7c80bddcee

Contents?: true

Size: 726 Bytes

Versions: 23

Compression:

Stored size: 726 Bytes

Contents

class PlacesListController < UITableViewController
  attr_accessor :places_list

  def viewDidLoad
    @places_list = []
    Places.load(self)
    view.dataSource = view.delegate = self
  end 

  def viewWillAppear(animated)
    view.reloadData
  end

  def tableView(tableView, numberOfRowsInSection:section)
    @places_list.size
  end

  def reloadData
    view.reloadData
  end

  CellID = 'CellIdentifier'
  def tableView(tableView, cellForRowAtIndexPath:indexPath)
    cell = tableView.dequeueReusableCellWithIdentifier(CellID) || UITableViewCell.alloc.initWithStyle(UITableViewCellStyleSubtitle, reuseIdentifier:CellID)
    placeItem= @places_list[indexPath.row]
    cell.textLabel.text = placeItem
    cell
  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
bubble-wrap-1.1.5 samples/location/app/controllers/image_list_controller.rb
bubble-wrap-1.1.4 samples/location/app/controllers/image_list_controller.rb
bubble-wrap-1.1.3 samples/location/app/controllers/image_list_controller.rb