xcode进行编程时可以运行。但加了语句后,运行也通过,模拟器会黑屏。

解决方案 »

  1.   

    #import <UIKit/UIKit.h>int main(int argc, char *argv[])
    {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        int retVal = UIApplicationMain(argc, argv, nil, nil);
        [pool release];
        return retVal;
    }
    #import "bE1ViewController.h"
    @implementation bE1ViewController 
    //@implementation buttonExampleViewController 
    @synthesize myLabel;
    -(void) tapA:(id)sender {
        myLabel.text = @"我按了 A 按钮"; 
    }
    -(void) tapB:(id)sender {
        myLabel.text = @"我按了 B 按钮";

    @end
    //#import <UIKit/UIKit.h>
    #import <UIKit/UIKit.h>@interface bE1ViewController : UIViewController{
        IBOutlet UILabel *myLabel; }
    @property (retain, nonatomic) UILabel *myLabel;
    -(IBAction) tapA:(id)sender;
    -(IBAction) tapB:(id)sender;
    @end
      

  2.   

    不清楚你说的。uiwindow上加了view么。
      

  3.   

    如果你使用了xib,请检查你的AppDelegate.m
    是否有指定首先显示的view:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
        // Override point for customization after application launch.
        self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
        self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
        return YES;
    }如果你使用storyboard,检查是否指定了入口viewcontroller,即  initial view controller