简体   繁体   中英

iOS app shows black screen

I'm trying to test an app I'm working on but the app shows a black screen and I get a yellow warning triangle thing next to thread 1 on the left panel (I forget what it's called) it says Thread 1, and under Queue: com.apple.main-thread. Also, every time the thread pauses it brings up the main method and this

@autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([DXAppDelegate class]));
    }

I'm guessing I did something wrong with my image views or something... I'm not sure where to find an error log either. Thank you for the help also, heres my .m class

//
//  DXViewController.m
//  SpaceShipGame1
//
//  Created by Abdul Ahmad on 2/15/14.
//  Copyright (c) 2014 Abdul Ahmad. All rights reserved.
//

#import "DXViewController.h"

@interface DXViewController ()

@end

@implementation DXViewController

-(void)giveBulletsProperties {
  //  bullets.image = @"bullet2.png";
    //bullets.center = CGPointMake(userSpaceShip.center.x + 35, userSpaceShip.center.y);

}

-(UIImageView *)shootBullet {


    return bullets;
}

-(void)gameMovement {

}



-(IBAction)clickUp:(id)sender {

}

-(IBAction)clickDown:(id)sender {

}

-(IBAction)clickStart:(id)sender {
    isAtStartScreen = NO;
    [self hideStartScreenViews];

}

-(void)showStartScreenViews {
    enemyShip1.hidden = YES;
    enemyShip2.hidden = YES;
    enemyShip3.hidden = YES;
    enemyShip4.hidden = YES;
    enemyShip5.hidden = YES;
    userBullet.hidden = YES;
    enemyBullet1.hidden = YES;
    enemyBullet2.hidden = YES;
    enemyBullet3.hidden = YES;
    up.hidden = YES;
    down.hidden = YES;
    startButton.hidden = NO;
    title.hidden = NO;
    score.hidden = NO;


}

-(void)hideStartScreenViews {
    enemyShip1.hidden = NO;
    enemyShip2.hidden = NO;
    enemyShip3.hidden = NO;
    enemyShip4.hidden = NO;
    enemyShip5.hidden = NO;
    userBullet.hidden = NO;
    enemyBullet1.hidden = NO;
    enemyBullet2.hidden = NO;
    enemyBullet3.hidden = NO;
    up.hidden = NO;
    down.hidden = NO;
    title.hidden = YES;
    score.hidden = YES;
    startButton.hidden = YES;


}

-(void) gameLogic {

}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    //UITouch *touch = [touches anyObject];

}


- (void)viewDidLoad
{

    [self showStartScreenViews];
    userSpaceShip.hidden = NO;
    backgroundImage.hidden = NO;


    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

您可能将uiviews错误地绑定到您的.h文件,发生在尝试手动操作,尝试使用ctr键并单击并拖动时

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM