UA-17470720-3

Jump to content


Photo
- - - - -

sectionActions.detailViewControllerForRowAtIndexPath not loading detail view

data-definitions sections actions

  • Please log in to reply
3 replies to this topic

#1 rolfenstein

rolfenstein

    Jr. Member

  • STV 4.0 Pro
  • PipPip
  • 16 posts
Reputation: 1
Good

Posted 27 May 2014 - 01:46 PM

I have a table generated from a Web Service Definition. It is modeled after the twitter and youtube examples. I am trying to configure a custom detail view, but clicking on a cell only makes the cell highlight grey. What am I missing? The youtube example does the same thing for me and the twitter example doesn't load any data so not sure if this is working. 

 

    SCArrayOfObjectsSection *webSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil webServiceDefinition:activityDef batchSize:10];

  //  webSection.itemsAccessoryType = UITableViewCellAccessoryNone;

    webSection.sectionActions.cellForRowAtIndexPath = ^SCCustomCell*(SCArrayOfItemsSection *webSection, NSIndexPath *indexPath)

    {

        NSString *bindingsString = @"1001:Russia.png;1002:UserName;1003:ActivityDescription;1004:Price;1005:Duration";

        SCCustomCell *customCell = [SCCustomCell cellWithText:nil objectBindingsString:bindingsString nibName:@"ActivityCell"];

        

        return customCell;

    };

    webSection.sectionActions.detailViewControllerForRowAtIndexPath = ^UIViewController*(SCTableViewSection *section, NSIndexPath *indexPath)

    {

        ActivityViewController *customVC = [[ActivityViewController alloc] initWithNibName:@"ActivityView" bundle:nil];

        

        return customVC;    };

    [self.tableViewModel addSection:webSection];

 


#2 Everett

Everett

    Ev

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 191 posts
  • LocationMichigan
Reputation: 60
Outstanding

Posted 27 May 2014 - 05:10 PM

your code looks good as far as I can tell.  

two things to try:

 

 a) make sure you are getting a non-nil object back for your customVC.  Replace that with this line to test:

    return [[SCViewController alloc]init];

 

B) to ensure compatibility, your customVC should inherit from SCViewController or SCTableViewController.


  • rolfenstein likes this

#3 rolfenstein

rolfenstein

    Jr. Member

  • STV 4.0 Pro
  • PipPip
  • 16 posts
Reputation: 1
Good

Posted 27 May 2014 - 11:30 PM

Found my problem. I was assigning my nib to class SCCommandCell instead of SCCustomCell. Works fine now.

 

This is I guess another topic but will ask. So when I call a new view from a nib, it is not embedded in my tab view controller? I am not so familiar with working with nib/xib files.



#4 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 28 May 2014 - 08:35 AM

Hi rolfenstein,

 

If by "when I call a new view from a nib, it is not embedded in my tab view controller" you mean that the UITabBar is disappearing, that can be set using hidesBottomBarWhenPushed. It's a SCDetailViewControllerOptions  and it's TRUE by default, so the UITabBar disappears, setting it to FALSE and the UITabBar will still be there.


  • rolfenstein likes this
Cheers,

Dave

www.dgapps.ie





Also tagged with one or more of these keywords: data-definitions, sections, actions

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users