0

I was unable to load a tableview inside today extension. I deleted the initial view controller and replaced it with a tableView controller. Did added the delegates in table view NCWidgetProviding and its function widgetPerformUpdate. It was just a sample app, to check the today extension. Can anybody respond with a solution !!!

Thanks Screenshot

SgtDroelf
  • 331
  • 1
  • 18
fAiSaL
  • 754
  • 1
  • 10
  • 29

2 Answers2

0

Few things I noticed:

  1. try setting tableView's delegate and datasource in viewDidLoad():

    self.tableView.delegate = self
    self.tableView.dataSource = self
    
  2. it's better to use tableView.dequeueReusableCellWithIdentifier with indexPath:

    let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath)
    

More on this here

If none of the above helps, maybe there's something wrong with autolayout? Table might be displayed, it's just not visible.

Community
  • 1
  • 1
Adam Bardon
  • 3,829
  • 7
  • 38
  • 73
  • hey thanks for the response... however I'm not getting any output ... constraint are all fine... Could you please tell me what is the role of framework in between extension and the app – fAiSaL Nov 11 '16 at 12:20
  • still I'm getting "Unable to load" alert in extension... I did deleted default view controller from extension storyboard and added new tableView controller to it. Does this influence the issue – fAiSaL Nov 11 '16 at 12:44
0

When you replace the default view controller in the storyboard, you need to check "Is Initial View Controller" in the Attributes Inspector.

ewerx
  • 403
  • 4
  • 10