Ionic self-assembly for functional hierarchical nanostructured materials.