Registers a class for use in creating new table header or footer views.
SDKs
- iOS 6.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
- (void)registerClass:(Class)aClass forHeaderFooterViewReuseIdentifier:(NSString *)identifier;
Parameters
aClassThe class of the header or footer view that you want to register. You must specify either
UITableor a subclass of it.View Header Footer View identifierThe reuse identifier for the header or footer view. This parameter must not be
niland must not be an empty string.
Discussion
Before dequeueing any header or footer views, call this method or the register method to tell the table view how to create new instances of your views. If a view of the specified type is not currently in a reuse queue, the table view uses the provided information to create a one automatically.
If you previously registered a class or nib file with the same reuse identifier, the class you specify in the a parameter replaces the old entry. You may specify nil for a if you want to unregister the class from the specified reuse identifier.