Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lynkynpark86

macrumors 6502
Original poster
Hello,
I've got a nib with two views. The classes for these views are "OfflineMusicViewController.h" (and .m), and PlayingView.h (and .m). In the main view of the xib (OfflineMusicView), there's a button that is supposed to a) start playing a music file (w/ AVFoundation), and b) switch to a new view in the same xib (PlayingView) that has a button that stops the music and closes the second view, going back to the first. I've got the AVAudioPlayer (theAudio) in OfflineMusicViewController.h, but I need to use "[theAudio stop];" in PlayingView.m. How can I give theAudio a command from a different class file?
 
You are mixing up your views and viewControllers. Normally, you should have a single viewController that is responsible for the (sub)views that, appropriately, it controls.

Have you read through the View Controller Programming Guide for IOS yet? If not, you should. This should help you sort the difference between views and viewControllers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.