V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
NonClockworkChen
V2EX  ›  问与答

objective-c 如何在 xcode 快速新建一个对象

  •  
  •   NonClockworkChen · 2017-09-08 09:27:30 +08:00 · 1278 次点击
    这是一个创建于 2415 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Does a keyboard shortcut exist or is there a way to create a custom shortcut for allocating and initializing a class? Say we have:

    MyCustomClass customClass =

    At this point there should be an autocomplete option to:

    MyCustomClass customClass = [[MyCustomClass alloc] init];

    这也是 Stack Overflow 上提问的一个,可惜无人问津.
    4 条回复    2017-09-08 10:35:39 +08:00
    TangMonk
        1
    TangMonk  
       2017-09-08 09:32:08 +08:00   ❤️ 1
    关键字:Xcode Snippets

    http://nshipster.com/xcode-snippets/
    wohenyingyu02
        2
    wohenyingyu02  
       2017-09-08 10:18:31 +08:00   ❤️ 1
    实际开发过程中不太会用到这种直白的新建,快速好像没有太大意义
    maxxxxx
        3
    maxxxxx  
       2017-09-08 10:29:24 +08:00   ❤️ 1
    没必要吧,init 方法那么多,很难补全到自己想要的
    hoogle
        4
    hoogle  
       2017-09-08 10:35:39 +08:00   ❤️ 1
    1 楼正解。可以加下面的 code spippet 到 Xcode,不过感觉并没必要

    <#Class#> *<#var#> = [[<#Class#> alloc] init];
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2798 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:32 · PVG 20:32 · LAX 05:32 · JFK 08:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.