AVFoundation framework error

Discussion in 'iOS Development' started by wearmaize, Jun 19, 2009.

  1. wearmaize

    wearmaize Active Member

    Joined:
    Feb 13, 2008
    Messages:
    2,442
    Likes Received:
    13
    Device:
    iPhone 4S (Black)
    Hello,
    Everything was going fine with AVFoundation.framework until I applied a distribution cert. and tried to build the app (not run it) for Device 2.2.1 Distribution. I got this error:
    Code:
      "_OBJC_CLASS_$_AVAudioPlayer", referenced from:
          __objc_classrefs__DATA@0 in MainView.o
          __objc_classrefs__DATA@0 in BugView.o
          __objc_classrefs__DATA@0 in TeacherView.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    
    Here is my TeacherView .m and .h, for example:

    .m:
    Code:
    #import "TeacherView.h"
    #import <AVFoundation/AVFoundation.h>
    
    @implementation TeacherView
    - (IBAction)push1 {
    	
    	NSString *path = [[NSBundle mainBundle] pathForResource:@"teacher" ofType:@"mp3"];
    	AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
    	theAudio.delegate = self;
    	[theAudio play];
        
    }
    @end
    
    and .h
    Code:
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    
    @interface TeacherView : UIView {
    
    }
    - (IBAction)push1;
    @end
    
    Any idea what the error is about? I need it to codesign so I can distribute it. When I build (or build and go) on the simulator it works fine, but the error occurs any time I try to build for a device. Thanks.

Share This Page