나는 노래를 재생하는 간단한 프로그램이 있습니다. 상속받은 awakeFromNib 메소드에 있습니다. 그래서 ..NSSound는 작동하지만 초기화 또는 할당되지 않았습니다.
-(void)awakeFromNib {
NSSound *song = [NSSound soundNamed:@"MyTune.mp3"];
[song play];
}
제 질문은 왜 작동합니까? 어떻게이를 NSTextView 변수가 설정 한 ... 나는 또한 너무 문자열을 작동하는 것 같다이
NSSound *song = [[NSSound alloc]init];
song = [NSSound soundNamed:@"MyTune.mp3"];
[song play];
}
할 필요가 없습니다 와서 나는 다음을 수행 할 수 있습니다
-(void)awakeFromNib {
NSString *str = [NSString stringWithFormat:@"Hello there!"];
[myTextVariable insertText:str];
}
왜 didn를 ' t 객체를 할당하고 초기화해야합니다. 나는 너무 잃었습니다. 도와주세요.
누구? 나는 이것을 이해하는 데 어려움을 겪고있다. – Heartbound07