안녕하세요, 저는 코코아가있는 초보 개발자이고 간단한 앱을 만들려고합니다. 탭 모음을 통해 선택할 수있는 4 개의 다른 페이지를 표시합니다.(Xcode) UIButtons와 페이지 사이의 링크
문제점 : IB로 첫 번째/홈 페이지 (==> FirstView.xib)에서 UIButton을 만들었으며 두 번째 페이지 (==> SecondView.xib)에 링크를 시도했는데 그물.
문제는 코드를 만들 수 있지만 버튼을 클릭 할 때 아무런 반응이 없기 때문입니다. FirstView.h에 대한
코드 : FirstView.m에 대한
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController {
UIButton *button;}
@property (nonatomic, retain) IBOutlet UIButton *button;
- (IBAction)goToViewTwo;
@end
코드 : @implementation FirstViewController @synthesize 버튼; FIrstVIew.xib의 콘센트에 대해
- (IBAction)goToViewTwo {
SecondViewController *SecondView= [[SecondViewController alloc] initWithNibName: @"SecondView" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:SecondView animated:YES];
}
- (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.
}
- (void)dealloc {
[super dealloc];
[button release];
}
@end
는 :
나는 "터치 업 내부"에서 "goToViewTwo"와 "B^utton"을 "파일의 소유자 '
성령의 *** ^^, 대단히 감사합니다 (그래서 바보가 된 기분 지금 : o) 잘 작동합니다. :) – Nicolas
내 기쁨. 그래도 바보 같은 느낌은 들지 않습니다. 시간이 지날수록 많은 유용한 자료를 찾아 낼 수 있습니다. 받아 들여지는 대답은 많이 감사 하겠지만, =] – justin