Q & A
글수 1,578
안녕하세요.개발자님들
아이폰프로그래밍 한걸음한걸음씩 힘들게 전진해가고있어요.
이제는 IB사용도 어지간해졌고 NavigationBar, TabBar, Modal View , TableView, View Transition, AlertView 등에 대해서 한번씩 내손으로 코드완성시켜보았어요.
제일 중요하게는 Objective-C에서 카테고리나 프로토콜,델리게이트개념을 오브젝트지향적인 관점에서 Visual C++과 대비적으로 ,실제 xCode상에서 자신이 그 매력을 직접 체험 및 스터디한거예요.
이제 약간 감이 들만해요.
여러분들이 답변 준데 대해 감사하게 생각해요.
하지만 이제 겨우 시작인거죠.
군말이 많았어요.
이번에는 오디오재생해보려고 하는데 또 치명적인 문제와 맞다들었어요.
코드구현절차는 다음과 같애요.
(아참, 저의 작업환경은 VMWare7.1/ MAC OS x10.6.6 / xCode4.0 and iPhone SDK 4.3 )
1. AVFoundation.Framework를 내프로젝트에 성과적으로 추가했어요.(Framworks에서 확인함)
2. #import <AVFoundation/AVFoundation.h>
3. .h파일에 AVAudioPlayer *myPlayer;
4. .m파일에서
NSString *audioFilePath = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"mp3"];
NSURL *url = [NSURL fileURLWithPath:audioFilePath];
//NSURL *url = [NSURL fileURLWithPath:@"1.mp3"];
NSError *err;
myPlayer= [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&err];
if (myPlayer == nil) {
}
else [myPlayer play];
물론 dealloc()에서 메모리해지는 해주었구요.(부차적인것이므로 쓰지 않겠음)
5.컴파일하면 워닝1개와 에러 1개 나와요.
ld: warning: ignoring file /Users/mac/project/test5/AVFoundation.framework/AVFoundation, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
objc-class-ref in test5AppDelegate.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Ignoring file /Users/mac/project/test5/AVFoundation.framework/AVFoundation, missing required architecture i386 in file
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
Objc-class-ref in test5AppDelegate.o
Symbol(s) not found for architecture i386
Collect2: ld returned 1 exit status
여기서 막혀버렸어요.구글링해보니까 이런 오유가 xCode4에서 허다하더군요.그러나 해법은 별로...
여러 고수님들 좀 도와주세요.

저는 xCode4 and iPhone SDK4.3을 애플홈페이지에서 다운받지 않고 토렌토에서 다운받았댔어요(4.2GB).
http://www.iphonedevsdk.com 유명아이폰개발자포럼인데 여기에다 질문던졌댔는데 현제까지 125명이 이 글을 읽었는데 유독한분이 정확한 힌트 주셨어요.
원인은 내가 다운받은 원본에 intel용 AVFoundation.Framework가 빠져있었거든요.
그래서 xCode4 전부 언인스톨하고 다시 설치하고 프로젝트 다시 열었더니 빠진 부분을 자체로 인식하고 다운하겠다고 메세지 뜨더군요.그래서 다운을 했더니 그만에야 OK!
으와,나한테는 왜 비정상적인 예외경우들만 차례지는지.공부를 더 힘들게 만들지 않나요.
어쨌든 나같은 경우 당한 사람들 참고했으면 해요.
그리구 이 문제 해결할려구 여기저기 많은 분들께 메일 날렸는데 이해해주세요.
워낙 성질이 급한놈이라여서...