Reloading table view header or footer

2013-08-06 Thread Rick Mann
I've been struggling with updating the content of a table view footer. I ended 
up creating a custom view that I hang on to, returning that from the delegate 
method, and then changing its content.

But I'm looking at the Personal Hotspot UI in Settings, and I see that the 
section footer changes nicely when you enable and disable the hot spot. It 
resizes with animation, and the rest of the table doesn't change.

How is this properly done?

-- 
Rick




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Reloading table view header or footer

2013-08-06 Thread Alex Zavatone
Have you tried any of these?

reloadSections:withRowAnimation

reloadRowsAtIndexPaths, perhaps?  Or reloadSectionIndexTitles?

Set an observer to the data record that is being used to populate that cell, 
then create a little method in your TV class that is triggered when that data 
value changes.  Then within that method, issue the appropriate reload:

[self.tableView reloadSections: mySectionIndexPath withRowAnimation: 
UITableViewRowAnimationNone]

or

[self.tableView reloadSectionIndexTitles];

or

NSArray *mySectionIndex = [NSArray arrayWithObject[thatIndexPathForThisSection]]
[ self.tableView reloadRowsAtIndexPath: mySectionIndex withRowAnimation: 
UITableViewRowAnimationNone];

Not sure if reloading a cell that is a section header will really do a refresh 
on it, but it looks like reloadSectionIndexTitles sure will.


GL.

On Aug 6, 2013, at 4:49 PM, Rick Mann wrote:

 I've been struggling with updating the content of a table view footer. I 
 ended up creating a custom view that I hang on to, returning that from the 
 delegate method, and then changing its content.
 
 But I'm looking at the Personal Hotspot UI in Settings, and I see that the 
 section footer changes nicely when you enable and disable the hot spot. It 
 resizes with animation, and the rest of the table doesn't change.
 
 How is this properly done?
 
 -- 
 Rick
 
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
 
 This email sent to z...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Reloading table view header or footer

2013-08-06 Thread Rick Mann

On Aug 6, 2013, at 14:24 , Alex Zavatone z...@mac.com wrote:

 reloadSections:withRowAnimation
 
 reloadRowsAtIndexPaths, perhaps?  Or reloadSectionIndexTitles?
 
 Set an observer to the data record that is being used to populate that cell, 
 then create a little method in your TV class that is triggered when that data 
 value changes.  Then within that method, issue the appropriate reload:
 
 [self.tableView reloadSections: mySectionIndexPath withRowAnimation: 
 UITableViewRowAnimationNone  ]
 
 or
 
 [self.tableView reloadSectionIndexTitles];
 
 or
 
 NSArray *mySectionIndex = [NSArray 
 arrayWithObject[thatIndexPathForThisSection]]
 [ self.tableView reloadRowsAtIndexPath: mySectionIndex withRowAnimation: 
 UITableViewRowAnimationNone];
 
 Not sure if reloading a cell that is a section header will really do a 
 refresh on it, but it looks like reloadSectionIndexTitles sure will.

Unfortunately, of those that cause a section to reload, it makes all the cells 
reload, too, which is something I want to avoid.


-- 
Rick




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com