相关疑难解决方法(0)

Cocoa的这个双下划线是什么?

Objective-C中的单个下划线显然是为Apple的"内部"使用保留的(并且在Apple声明之前可用于私有实例变量).但是为什么他们会在他们的SQLiteBooks示例中为iPhone 使用 -underscore呢?请参阅从MasterViewController.m获取的此片段:

+ (EditingViewController *)editingViewController {
    // Instantiate the editing view controller if necessary.
    if (__editingViewController == nil) {
        __editingViewController = [[EditingViewController alloc] initWithNibName:@"EditingView" bundle:nil];
    }
    return __editingViewController;
}
Run Code Online (Sandbox Code Playgroud)

在这个论坛上提到了双重下划线,因为它与C有关 - 它是"compier的内部使用".我想我不知道这在这种情况下是如何适用的.

我在我的应用程序中需要一个ViewController,它的行为与SQLiteBooks示例项目中的一样,但是这个双下划线让我感到困惑.

cocoa objective-c double-underscore

6
推荐指数
2
解决办法
4301
查看次数

标签 统计

cocoa ×1

double-underscore ×1

objective-c ×1