久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='bemTJ'><style id='bemTJ'><dir id='bemTJ'><q id='bemTJ'></q></dir></style></legend>

      <small id='bemTJ'></small><noframes id='bemTJ'>

      <tfoot id='bemTJ'></tfoot>

      • <bdo id='bemTJ'></bdo><ul id='bemTJ'></ul>
    1. <i id='bemTJ'><tr id='bemTJ'><dt id='bemTJ'><q id='bemTJ'><span id='bemTJ'><b id='bemTJ'><form id='bemTJ'><ins id='bemTJ'></ins><ul id='bemTJ'></ul><sub id='bemTJ'></sub></form><legend id='bemTJ'></legend><bdo id='bemTJ'><pre id='bemTJ'><center id='bemTJ'></center></pre></bdo></b><th id='bemTJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bemTJ'><tfoot id='bemTJ'></tfoot><dl id='bemTJ'><fieldset id='bemTJ'></fieldset></dl></div>

      iOS - 如何創(chuàng)建“實用程序"?我的所有控制器都

      iOS - how do I create a quot;utilityquot; class that all my controllers can call(iOS - 如何創(chuàng)建“實用程序?我的所有控制器都可以調(diào)用的類)

        <tfoot id='f1atx'></tfoot>
          • <small id='f1atx'></small><noframes id='f1atx'>

            • <i id='f1atx'><tr id='f1atx'><dt id='f1atx'><q id='f1atx'><span id='f1atx'><b id='f1atx'><form id='f1atx'><ins id='f1atx'></ins><ul id='f1atx'></ul><sub id='f1atx'></sub></form><legend id='f1atx'></legend><bdo id='f1atx'><pre id='f1atx'><center id='f1atx'></center></pre></bdo></b><th id='f1atx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='f1atx'><tfoot id='f1atx'></tfoot><dl id='f1atx'><fieldset id='f1atx'></fieldset></dl></div>

              • <bdo id='f1atx'></bdo><ul id='f1atx'></ul>
                  <tbody id='f1atx'></tbody>
                <legend id='f1atx'><style id='f1atx'><dir id='f1atx'><q id='f1atx'></q></dir></style></legend>
                本文介紹了iOS - 如何創(chuàng)建“實用程序"?我的所有控制器都可以調(diào)用的類的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我是 iOS 和 obctive-c 的新手,所以我不太清楚如何最好地完成這個看似簡單的任務.

                I am new to iOS and obective-c so I am not too sure how to best accomplish this seemingly simple task.

                我想要的是用偽代碼制作一個看起來像這樣的類:

                What I want is to make a class that looks like this in pseudocode:

                class UtilityClass
                {
                    // Have a method that I can pass parameters to 
                    String doCalculation ( String art1 , String arg2 )
                    {
                        return arg1 + arg2;
                    }
                }
                

                我的不確定是:

                1) xCode 似乎傾向于以相對扁平的方式布置我的文件結構.那么我應該創(chuàng)建一個 utils 目錄并將這個文件放在 utils/fileName 下嗎?通常我習慣了至少有一些 src 目錄,但到目前為止,我還沒有被任何東西提示創(chuàng)建一個.2) 如何從我的控制器導入和調(diào)用這個類/函數(shù)?

                1) xCode seems to be inclined to lay out my file structure in a relatively flat way. So should I make a utils directory and have this file be under utils/fileName ? Usually I am kind of used to having at least some src directory, but so far I have not been prompted by anything to create one. 2) How do I import and call this class/function from my controllers?

                謝謝,亞歷克斯

                推薦答案

                只需創(chuàng)建一個名為 Utilities 的新組,然后在其中創(chuàng)建您的類.喜歡,

                Just create a new group called Utilities, and then create your class inside it. Like,

                utils.h 
                utils.m
                

                稍后在 ViewController 的頭文件中添加即可.

                Later in your ViewController's header file just add.

                #import "utils.h"
                

                如果這個 utils 類被很多控制器在非常胖的項目中使用,那么,找到一個名為的文件,應該在支持文件組內(nèi).

                if this utils class is used by many controllers in very fat project then, find a file called, Should be inside supporting files group.

                YourAppName-Prefix.pch
                

                在那個文件中你有一個這樣的代碼塊,

                In that file you have a code block like this,

                #ifdef __OBJC__
                    #import <UIKit/UIKit.h>
                    #import <Foundation/Foundation.h>
                    #import <CoreData/CoreData.h>
                #endif
                

                只需編輯此塊并在此處添加您的 utils.h 引用,這樣您的整個項目就可以創(chuàng)建 utils 對象而無需顯式導入到它們自己的標頭中.

                Just edit this block and add your utils.h reference here, In this way your entire project can create utils object without explicitly importing into their own header.

                像這樣編輯,

                #ifdef __OBJC__
                    #import <UIKit/UIKit.h>
                    #import <Foundation/Foundation.h>
                    #import <CoreData/CoreData.h>
                    #import "utils.h"
                #endif
                

                這篇關于iOS - 如何創(chuàng)建“實用程序"?我的所有控制器都可以調(diào)用的類的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                To stop segue and show alert(停止 segue 并顯示警報)
                iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標已經(jīng)包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  <i id='KVXvo'><tr id='KVXvo'><dt id='KVXvo'><q id='KVXvo'><span id='KVXvo'><b id='KVXvo'><form id='KVXvo'><ins id='KVXvo'></ins><ul id='KVXvo'></ul><sub id='KVXvo'></sub></form><legend id='KVXvo'></legend><bdo id='KVXvo'><pre id='KVXvo'><center id='KVXvo'></center></pre></bdo></b><th id='KVXvo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KVXvo'><tfoot id='KVXvo'></tfoot><dl id='KVXvo'><fieldset id='KVXvo'></fieldset></dl></div>
                  <legend id='KVXvo'><style id='KVXvo'><dir id='KVXvo'><q id='KVXvo'></q></dir></style></legend>

                    <small id='KVXvo'></small><noframes id='KVXvo'>

                    <tfoot id='KVXvo'></tfoot>
                      <bdo id='KVXvo'></bdo><ul id='KVXvo'></ul>
                          <tbody id='KVXvo'></tbody>
                          主站蜘蛛池模板: caoporn国产精品免费公开 | 欧美日韩一区二区视频在线观看 | 97久久精品| 成人一区二区视频 | 亚洲综合大片69999 | 亚洲a网 | 男人的天堂在线视频 | 成人av一区二区在线观看 | 综合久久综合久久 | 久草网址 | 精品久久久久久久久久 | 国户精品久久久久久久久久久不卡 | 日韩高清在线 | 97久久精品午夜一区二区 | 99精品电影 | 欧美福利视频 | 天天干天天插天天 | 国产欧美一区二区三区另类精品 | 国产精品久久久久久亚洲调教 | 日韩一区二区三区在线视频 | 国产精品国产自产拍高清 | 午夜影院在线 | 91在线网站 | 欧美成人一区二区三区 | 麻豆久久久久 | 国产精品久久国产精品99 gif | 久久久久久久久久久福利观看 | 91精品国产综合久久久久久丝袜 | 欧美在线一区二区三区 | 国产影音先锋 | 欧美理论片在线观看 | 久久精品亚洲一区二区三区浴池 | 国产精品久久久久免费 | 国产日韩欧美电影 | 嫩草视频在线免费观看 | 欧美日韩精品中文字幕 | 亚洲精品国产电影 | 91免费看片神器 | 麻豆精品国产免费 | 日韩三区| 狠狠干影院 |