gpt4 book ai didi

ios - 以编程方式获取项目中的框架数组 - Xcode

转载 作者:可可西里 更新时间:2023-11-01 00:53:38 25 4
gpt4 key购买 nike

我想以编程方式获取 Xcode 项目中的框架数组或当前文件。我需要什么代码才能做到这一点?

最佳答案

要列出框架,您可以使用 [NSBundle allFrameworks]

The returned array includes frameworks that are linked into an application when the application is built and bundles for frameworks that have been dynamically created.

for (NSBundle *framework in [NSBundle allFrameworks]) {
printf("%s : %s\n",
framework.bundleURL.lastPathComponent.UTF8String,
framework.bundleIdentifier.UTF8String
);
}

在 iOS 模拟器中运行裸“单 View 应用程序”模板的结果

CoreUI.framework : com.apple.CoreUI
Accounts.framework : com.apple.Accounts
lib : (null)
AggregateDictionary.framework : com.apple.AggregateDictionary
CoreTelephony.framework : com.apple.coretelephony
CommonUtilities.framework : com.apple.commonutilities
QuartzCore.framework : com.apple.QuartzCore
CoreText.framework : com.apple.CoreText
system : (null)
ConstantClasses.framework : com.apple.ConstantClasses
OpenGLES.framework : com.apple.opengles
AudioToolbox.framework : com.apple.audio.toolbox.AudioToolbox
IMFoundation.framework : com.apple.imfoundation
Foundation.framework : com.apple.Foundation
CoreVideo.framework : com.apple.CoreVideo
SimulatorClient.framework : com.apple.iphonesimulator.SimulatorClient
CoreMedia.framework : com.apple.CoreMedia
TelephonyUtilities.framework : com.apple.TelephonyUtilities
TextInput.framework : com.apple.TextInput
BackBoardServices.framework : com.apple.BackBoardServices
AVFoundation.framework : com.apple.avfoundation
PrintKit.framework : com.apple.framework.PrintKit
AppSupport.framework : com.apple.AppSupport
UIFoundation.framework : com.apple.UIFoundation
MobileAsset.framework : com.apple.MobileAssets
introspection : (null)
JavaScriptCore.framework : (null)
CommunicationsFilter.framework : com.apple.communicationsfilter
CFNetwork.framework : com.apple.CFNetwork
MobileCoreServices.framework : com.apple.MobileCoreServices
AddressBook.framework : com.apple.AddressBook
CoreImage.framework : com.apple.CoreImage
FrontBoardServices.framework : com.apple.FrontBoardServices
WebKitLegacy.framework : com.apple.WebKitLegacy
DataMigration.framework : com.apple.datamigration
ProofReader.framework : com.apple.ProofReader
DictionaryServices.framework : com.apple.DictionaryServices
PlugInKit.framework : com.apple.pluginkit.framework
UIKit.framework : com.apple.UIKit
BaseBoard.framework : com.apple.BaseBoard
SpringBoardServices.framework : com.apple.SpringBoardServices
GraphicsServices.framework : com.apple.GraphicsServices
vecLib.framework : com.apple.Accelerate.vecLib
FontServices.framework : com.apple.FontServices
MediaToolbox.framework : com.apple.MediaToolbox
OAuth.framework : com.apple.OAuth
CoreData.framework : com.apple.CoreData.PersistenceTesting
WebCore.framework : com.apple.WebCore
FaceCore.framework : com.apple.vision.FaceCore
AssetsLibraryServices.framework : com.apple.AssetsLibraryServices
DataAccessExpress.framework : com.apple.dataaccess.dataaccessexpress.framework
PhysicsKit.framework : com.apple.PhysicsKit
CoreFoundation.framework : com.apple.CoreFoundation
AssertionServices.framework : com.apple.AssertionServices
DTDDISupport.framework : com.apple.DTDDISupport
Celestial.framework : com.apple.Celestial

关于ios - 以编程方式获取项目中的框架数组 - Xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26832626/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com