They were never "obsolete", at least as the term is commonly used. During WW2 they were useful for all manner of things, from escort duty to shore bombardment, and the only reason you didn't see the envisioned clash of battleships in the Pacific is because Halsey blundered at Leyte Gulf and took the battleline with him in pursuit of Ozawa. If he had left Task Force 34 behind, as he should have, it would have been American battleships and cruisers clashing with the Center Force, rather than escort carriers and destroyers.
As it happened, the Allied battleships performed their envisioned missions with distinction, and even a single German battleship (Tirpitz) was taken seriously enough to tie down most of the Royal Navy's battleships until she was put out of action. It was actually pretty damned hard to sink a battleship with aircraft, even under favorable conditions, as evidenced by Tirpitz, Yamato, and Musashi. To my knowledge there was only one Allied battleship lost at sea to aircraft, HMS Prince of Wales. American battleships were damaged by aircraft at sea, but never sunk or even put out of action.