버튼을 누른 다음 UIAlertView
이있는 응용 프로그램을 실행하려고 시도하고 있으며 사용자 정의 단추가 3 개있는 UIView
이 있습니다. 지금까지 모든 것이 작동합니다. 내가 3 버튼 중 하나를 클릭하면 UIImageView
의 이미지를 변경하고 싶습니다. 문제는 내 앱을 시작하려고 할 때마다 갑자기 아무 일도 일어나지 않는다는 것입니다. 이 라인에 내 AppDelegate.m
에self.window.rootViewController를 설정하면 SIGABRT가 발생합니다
SIGABRT
일 : 누군가가 나를 도울 수 있다면
self.window.rootViewController = self.viewController;
이 좋은 것 그리고 그 길을 메신저로 매우 엑스 코드와 사용되지 오브젝티브 -C 그래서 난이 없습니다 이것이 일어나는 이유에 대한 단서.
여기 여기 MainWindow.xib에있는
#import "savingstatusViewController.h"
@implementation savingstatusViewController
@synthesize loginView;
@synthesize statusImage,MyTicketAlert;
- (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
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[self setLoginView:nil];
[self setStatusImage:nil];
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
- (IBAction)status:(id)sender
{
MyTicketAlert = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:self cancelButtonTitle:nil
otherButtonTitles: nil];
[MyTicketAlert addSubview:loginView];
[MyTicketAlert show];
MyTicketAlert.frame = CGRectMake(0, 1000, 440, 110);
}
- (IBAction)green:(id)sender
{
statusImage.image = [UIImage imageNamed:@"etat_controle.png"];
[MyTicketAlert dismissWithClickedButtonIndex:0 animated:YES];
}
- (IBAction)yellow:(id)sender
{
statusImage.image = [UIImage imageNamed:@"etat_attention.png"];
[MyTicketAlert dismissWithClickedButtonIndex:0 animated:YES];
}
- (IBAction)red:(id)sender
{
statusImage.image = [UIImage imageNamed:@"etat_danger.png"];
[MyTicketAlert dismissWithClickedButtonIndex:0 animated:YES];
}
@end
창과 viewController를 초기화하는 코드는 어디에 있습니까? 그걸 게시 할 수 있니, 제발? – fbrereto
동일한 문제가 발생했습니다 : ( –