Hi there , iam using AVFoundation Framework to play mp3 file ,everything works great ، i have 2 buttons and i put they together , [Play and resume with .hidden function],when user play music [play button going to hide and resume button un hide], so if the user change view , (music is playing) and back to previews view, the buttons don't work normally it means just play music and resume doesn't work , i put my codes to the viewDidLoad , and i know it's because of that but how can i solve this problem ?
NSString * musicSonati = [[NSBundle mainBundle] pathForResource:@"music" ofType:@"mp3"];
myMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:musicSonati] error:NULL];
myMusic.delegate = self;
myMusic.numberOfLoops = -1;
pauseM.hidden = YES;
play.hidden = NO;