Objective c 在基于Xcode视图的界面生成器中,能否将MakeKeyandDerfront与简单的UIWindow一起使用?

Objective c 在基于Xcode视图的界面生成器中,能否将MakeKeyandDerfront与简单的UIWindow一起使用?,objective-c,nswindow,uiwindow,Objective C,Nswindow,Uiwindow,如果不是,NSWindow和UIWindow之间有什么区别 我该如何实现makekeyandrefront函数呢 这是我到目前为止所有的代码 // // DisappearanceViewController.h // Disappearance // // Created by Angelo Rivera on 2/24/11. // Copyright 2011 Cal State Uniuversity Channel Islands. All rights reserved. /

如果不是,NSWindow和UIWindow之间有什么区别

我该如何实现makekeyandrefront函数呢

这是我到目前为止所有的代码

//
//  DisappearanceViewController.h
//  Disappearance
//
//  Created by Angelo Rivera on 2/24/11.
//  Copyright 2011 Cal State Uniuversity Channel Islands. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <AudioToolbox/AudioToolbox.h>

@interface DisappearanceViewController : UIViewController 
{
IBOutlet UIImageView *view1;
    IBOutlet UILabel *label;    

}

-(IBAction)toggleLabel: (id)sender;
    @property (nonatomic, retain) UIImageView *view1;

@end



//
//  DisappearanceViewController.m
//  Disappearance
//
//  Created by Andrew Rivera on 2/24/11.
//  Copyright 2011 Cal State Uniuversity Channel Islands. All rights reserved.
//

#import "DisappearanceViewController.h"

@implementation DisappearanceViewController

int i = 0;

-(IBAction)toggleLabel:(id)sender
{
    UIButton *button = (UIButton*) sender;

    if (i ==0)
    {
    label.text = @"Hello World";
    }

    else {
            label.text = @"lmao";
    }
    i++;

}
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/


/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (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.
}

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end
//
//消失视图控制器
//消失
//
//由安吉洛·里维拉于2011年2月24日创作。
//版权所有2011加州州立大学海峡群岛分校。版权所有。
//
#进口
#进口
#进口
@界面消失ViewController:UIViewController
{
IBUIImageView*view1;
IBUILABEL*标签;
}
-(iAction)切换标签:(id)发送方;
@属性(非原子,保留)UIImageView*view1;
@结束
//
//消失视图控制器
//消失
//
//由安德鲁·里维拉于2011年2月24日创作。
//版权所有2011加州州立大学海峡群岛分校。版权所有。
//
#导入“消失视图控制器.h”
@实现消失视图控制器
int i=0;
-(iAction)切换标签:(id)发送方
{
UIButton*按钮=(UIButton*)发送器;
如果(i==0)
{
label.text=@“Hello World”;
}
否则{
label.text=@“lmao”;
}
i++;
}
/*
//指定的初始值设定项。覆盖以执行加载视图之前所需的设置。
-(id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil{
self=[super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
如果(自我){
//自定义初始化
}
回归自我;
}
*/
/*
//实现loadView以编程方式创建视图层次结构,而不使用nib。
-(void)负荷视图{
}
*/
/*
//实现viewDidLoad以在加载视图(通常从nib)后执行附加设置。
-(无效)viewDidLoad{
[超级视图下载];
}
*/
/*
//替代以允许默认纵向方向以外的方向。
-(布尔)应自动旋转指针面定向:(UIInterfaceOrientation)interfaceOrientation{
//对于支持的方向返回YES
返回(interfaceOrientation==UIInterfaceOrientationGraphic);
}
*/
-(无效)未收到记忆警告{
//如果视图没有superview,则释放该视图。
[超级记忆警告];
//释放所有未使用的缓存数据、图像等。
}
-(无效)视图卸载{
//释放主视图的所有保留子视图。
//例如,self.myOutlet=nil;
}
-(无效)解除锁定{
[super dealoc];
}
@结束

该类没有名为
MakeKeyandDerfront:
的方法;它确实有一个名为的方法,这似乎是iOS上最接近的方法。如果您只想问这个问题,那么搜索文档就会回答这个问题。

这段代码与您的问题有什么关系?