2 Replies - 3641 Views - Last Post: 29 May 2013 - 08:56 PM

#1 horriblecoder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-April 13

Xcode sim launches to black screen

Posted 27 April 2013 - 09:16 AM

This is my first app so im still working through things and cant figure this one out.

Problem:
When I run my program it builds successfully but the simulator launches and stays on a black screen.

Heres my code:
.h file

//
//  TipCalculatorViewController.h
//  TipCalculator
//
//  Created by Ethan Lee on 4/27/13.
//  Copyright (c) 2013 Ethan Lee. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface TipCalculatorViewController : UIViewController{
    
    IBOutlet UITextField *userInput;
    IBOutlet UILabel *outputHigh;
    IBOutlet UILabel *outputNormal;
    IBOutlet UILabel *outputLow;
    
}
- (IBAction)enterPressed:(id)sender;

//properties
@property (strong,nonatomic) UILabel *userInput;
@property (strong,nonatomic) UILabel *outputHigh;
@property (strong, nonatomic) UILabel * outputNormal;
@property (strong,nonatomic) UILabel *outputLow;

@end


.m file

//
//  TipCalculatorViewController.m
//  TipCalculator
//
//  Created by Ethan Lee on 4/27/13.
//  Copyright (c) 2013 Ethan Lee. All rights reserved.
//

#import "TipCalculatorViewController.h"

@interface TipCalculatorViewController ()

@end

@implementation TipCalculatorViewController

@synthesize outputHigh = _outputHigh;
@synthesize outputLow = _outputLow;
@synthesize outputNormal = _outputNormal;
@synthesize userInput=_userInput;

- (void)viewDidLoad
{
    [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.
}

- (IBAction)enterPressed:(id)sender {
    float result = [userInput.text floatValue];
    float normal = result * .15;
    float high = result * .2;
    float low = result * .11;
    
    NSString *stringHigh = [NSString stringWithFormat:@"%f",high];
    self.outputHigh.text = stringHigh;
    
    NSString *stringNormal = [NSString stringWithFormat:@"%f",normal];
    self.outputNormal.text = stringNormal;
    
    NSString *stringLow = [NSString stringWithFormat:@"%f",low];        
    self.outputLow.text = stringLow;
    
    
}
@end


Things i've tried:
-restart xcode and computer
-create a duplicate project

any help is appreciated

Is This A Good Question/Topic? 0
  • +

Replies To: Xcode sim launches to black screen

#2 horriblecoder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-April 13

Re: Xcode sim launches to black screen

Posted 27 April 2013 - 02:11 PM

Heres what the console is telling me:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TipCalculatorViewController 0x7566b20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key outputHIgh.'
Was This Post Helpful? 0
  • +
  • -

#3 jeffwow  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-April 12

Re: Xcode sim launches to black screen

Posted 29 May 2013 - 08:56 PM

seems something wrong while linking your xib file with your source codes. Have you used xib files ?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1