小编Kop*_*Bob的帖子

nginx守护进程开/关选项有什么区别?

这是我的第一个Web服务器管理经验,我想构建使用nginx作为Web服务器的docker容器.在所有docker教程daemon off;选项被放入主.conf文件但是省略了关于它的说明.

我在互联网上搜索它,我不明白daemon on;daemon off;选项之间有什么区别.有人提到daemon off;是生产,为什么?

你能解释一下,这两个选项有什么区别,为什么我应该用于daemon off;制作?

webserver daemon nginx docker

36
推荐指数
2
解决办法
2万
查看次数

如何在objective-C(iOS sdk)中使用继承

我刚开始学习iOS编程,我的继承问题.有2个文件.

第一个文件

#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
    int x;
}
@end
Run Code Online (Sandbox Code Playgroud)

执行:

#import "ViewController.h"
#import "NewClass.h"
@implementation ViewController
#pragma mark - View lifecycle
- (void)viewDidLoad
{
    [super viewDidLoad];
    x = 999;
    NewClass *myClass = [[[NewClass alloc] init] autorelease];
}
@end
Run Code Online (Sandbox Code Playgroud)

第二档

标题:

#import "ViewController.h"

@interface NewClass : ViewController 
@end
Run Code Online (Sandbox Code Playgroud)

执行:

#import "NewClass.h"
@implementation NewClass

-(id)init { 
    self = [super init];                                       
    if (self != nil) {                                            
        NSLog(@"%i",x);
    }
    return self;                           
}
@end
Run Code Online (Sandbox Code Playgroud)

在ViewController中我将x设置为999,而在NewClass中我想得到它,但是当我调用NSLog(@"%i",x);它时,它会给我0.

我在哪里弄错了?

iphone model-view-controller objective-c ios

5
推荐指数
2
解决办法
2022
查看次数