Welcome, Guest
Username Password: Remember me

detailViewDidDisappearForRowAtIndexPath not being called
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: detailViewDidDisappearForRowAtIndexPath not being called

detailViewDidDisappearForRowAt​IndexPath not being called 1 year, 7 months ago #1

Hi All,

I need some specific code to run when a user has dismissed a detail edit view for a particular STV row. As such, I have implemented the - (void)tableViewModel:(SCTableViewModel *) tableViewModel detailViewDidDisappearForRowAtIndexPath:(NSIndexPath *) indexPath method and specified that the class conforms to the SCTableViewModelDelegate. However, the delegate method never gets called.

I thought this may have been something that I mistakenly did (or did not do!) within my app, so I implemented the same delegate method within the CustomizationViewController sample app, but the same thing happens (or doesn't happen) - the delegate method is never called when I go back from the detail edit view.

In both cases the detail edit view is being displayed within a UINavigationController. As a test I set .detailViewModal = YES but the problem still occurs, so it does not seem related to whether the detail view is displayed as a modal or not.

Just in case I also implemented the - (void)detailViewWillAppearForCell:(SCTableViewCell *) cell withDetailTableViewModel:(SCTableViewModel *) detailTableViewModel method and conformed the class to SCTableViewCellDelegate. However, this method is never called either in response to dismissing a detail edit view.

If anyone could let me know whether I have done something wrong that would be great. Probably the easiest test would be implementing this method in the CustomizationViewController sample app and checking whether it works for you, as it didn't for me.

Thanks,
Matthew
  • skoota
  • OFFLINE
  • Expert Boarder
  • Posts: 89
  • Karma: 2

Re: detailViewDidDisappearForRowAt​IndexPath not being called 1 year, 7 months ago #2

Hi Matthew,

I am guessing that you're using an SCArrayOfObjectsSection. For this kind of STV control, you should be implementing the method tableViewModel:detailViewDidDisappearForSectionAtIndex: instead, as the detail view is not always generated by a cell (e.g. by an add button).

Hope this helps
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: detailViewDidDisappearForRowAt​IndexPath not being called 1 year, 7 months ago #3

Thanks again Tarek. I knew that I was missing something obvious
  • skoota
  • OFFLINE
  • Expert Boarder
  • Posts: 89
  • Karma: 2

Re: detailViewDidDisappearForRowAt​IndexPath not being called 1 year, 6 months ago #4

I am using an SCArrayOfObjectsSection as well and have found that many of the delegate methods don't get called. Is there a delegate method that can be called when the view will *appear*? Is there somewhere I can find the delegate methods that SCArrayOfObjectsSection supports?

Thanks!
  • kes815
  • OFFLINE
  • Junior Boarder
  • Posts: 32
  • Karma: 0

Re: detailViewDidDisappearForRowAt​IndexPath not being called 1 year, 6 months ago #5

Hey Karl,

What delegate methods are you using? Are you sure you're conforming to the SCTableViewModelDelegate protocol? There are two set of delegate methods you can use (all under the SCTableViewModelDelegate documentation):

a. For detail view generated for a new object:
- tableViewModel:detailViewWillAppearForSectionAtIndex:withDetailTableViewModel:
- tableViewModel:detailViewWillDisappearForSectionAtIndex:
- tableViewModel:detailViewDidDisappearForSectionAtIndex:

b. For a detail view generated for an existing object upon tapping its corresponding cell:
- tableViewModel:detailViewWillAppearForRowAtIndexPath:withDetailTableViewModel:
- tableViewModel:detailViewWillDisappearForRowAtIndexPath:
- tableViewModel:detailViewDidDisappearForRowAtIndexPath:

Please tell me if you need any more help.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: detailViewDidDisappearForRowAt​IndexPath not being called 1 year, 6 months ago #6

Not sure what I was doing wrong but these delegates do work as noted.

Thank you!
  • kes815
  • OFFLINE
  • Junior Boarder
  • Posts: 32
  • Karma: 0
  • Page:
  • 1
  • 2
Time to create page: 0.90 seconds