я делаю subviewcontroller с тремя файлами .h .m .nib
.h содержание: -
@interface du3a : UIViewController <AVAudioPlayerDelegate> {
}
.m один является: -
#import "du3a.h"
@implementation du3a
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"jaber" ofType:@"mp3"];
AVAudioPlayer *theAudio; [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
проблема исходит от mainview .m специально в этой строке: -
-(IBAction)du3a:(id)sender {
du3a *du3 = [[du3a alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:du3 animated:YES];
}
Любая помощь приветствуется