Doesn't open up in iPhone Simulator

Discussion in 'iOS Programming' started by DIGITALiam, Jul 23, 2010.

  1. macrumors newbie

    Joined:
    Jun 23, 2010
    #1
    Hey I'm writing a basic timer app for learning purposes. When I try to build and run it in the simulator, it crashes right away. I assume it is a memory problem but some guidance would be great. Here is the only code I have written so far.

    MainViewController.h
    Code:
    #import "FlipsideViewController.h"
    
    @interface MainViewController : UIViewController <FlipsideViewControllerDelegate> {
    	IBOutlet UILabel *UIsecondTime;
    	IBOutlet UILabel *UIminuteTime;
    	IBOutlet UILabel *UIstate;
    	
    	NSTimer *myTicker;
    	
    	int secondTime;
    	int minuteTime;
    	int state;
    }
    @property(nonatomic,retain) UILabel* UIsecondTime;
    @property(nonatomic,retain) UILabel* UIminuteTime;
    @property(nonatomic,retain) UILabel* UIstate;
    
    - (IBAction)showInfo:(id)sender;
    - (IBAction)startTimer;
    - (void)stateAndTime;
    
    
    @end
    
    

    MainViewController.m
    Code:
    #import "MainViewController.h"
    
    
    @implementation MainViewController
    
    @synthesize UIsecondTime;
    @synthesize UIminuteTime;
    @synthesize UIstate;
    
    int secondTime = 00;
    int minuteTime = 00;
    int state = 0;
    
    
    
    
    
    - (IBAction)startTimer{
    	
    	myTicker = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(stateAndTime) userInfo:nil repeats:YES];
    	
    }
    
    - (void)stateAndTime{
    	secondTime = secondTime - 1;
    	UIsecondTime.text = [NSString stringWithFormat:@"%d", secondTime];
    }
    
    ... 
    @end
    
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Do you get any run-time errors? Have you looked at the crash report? Also, keep this in mind: Getting Answers
     
  3. thread starter macrumors newbie

    Joined:
    Jun 23, 2010
    #3
    Sorry I didn't clarify enough.

    There is no errors. I don't exactly know what the crash report is or how to get it and my quick google search didn't come up with anything.
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
  5. thread starter macrumors newbie

    Joined:
    Jun 23, 2010
    #5
    Thanks.

    I fixed it. I couldn't figure it out but I copied and pasted the code into a new XCode project.
     

Share This Page