Questions tagged «xcode»

Xcode是Apple的集成开发环境(IDE)。使用注意:此标签仅用于有关Xcode IDE本身的问题,而不用于一般的Mac或iOS编程主题。对于Mac编程问题,请使用[cocoa],对于iOS编程问题,请使用[cocoa-touch]或[iOS]或[Swift]。

9
有没有办法抑制Xcode中的警告?
有没有办法抑制Xcode中的警告? 例如,我正在调用一个未公开的方法,由于该方法不在头文件中,因此我会收到编译警告。我知道我可以将其添加到标题中以停止警告,但是我想知道是否有其他方法可以将其添加到标题中(这样我就可以使标题保持清洁和标准)来抑制警告?杂物之类的?

1
Xcode 9中的“此函数声明不是原型”警告
使用Xcode 9时,有一些编译器警告说This function declaration is not a prototype。建议添加void到方法主体,这将解决该问题。我遇到的问题是,对于系统API的UIApplication委托(例如委托方法)也会引发这些警告: - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler 这可以通过以下方法解决: - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)(void))completionHandler 现在,我想知道委托方法是否仍然可以长期使用,或者Apple将void在更高的iOS 11 Beta版本中插入。我很好奇,因为如果包含void主体,Xcode会抱怨方法选择器不匹配(这很有意义)。到目前为止,有人遇到过同样的问题吗?

14
使用Cocoapods的Xcode单元测试
最近几天,我一直在用这种方法撞墙,但是尽管进行了多次Google / SO / Github搜索,但我找不到解决所遇到问题的方法! 我要做的就是为我的应用程序创建一些单元测试,以利用Firebase Pod。 我正在使用Xcode 7.3.1和Cocoapods 1.0.1。更新: Xcode 8.0仍然存在问题 使用此Podfile: platform :ios, '9.0' use_frameworks! inhibit_all_warnings! target 'MyApp' do pod 'Firebase' pod 'Firebase/Auth' pod 'Firebase/Database' pod 'Firebase/Storage' target 'MyAppTests' do inherit! :search_paths end end 在我的XCTest类中,我得到了 缺少必需的模块“ Firebase” 错误于 @testable import MyApp 或者使用此Podfile: platform :ios, '9.0' use_frameworks! inhibit_all_warnings! def …

15
在SwiftUI中使VStack充满屏幕的宽度
给定此代码: import SwiftUI struct ContentView : View { var body: some View { VStack(alignment: .leading) { Text("Title") .font(.title) Text("Content") .lineLimit(nil) .font(.body) Spacer() } .background(Color.red) } } #if DEBUG struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() } } #endif 导致这种交互: VStack即使标签/文本组件不需要整个宽度,也如何填充屏幕的宽度? 我发现的一个技巧是在结构中插入一个空 HStack,如下所示: VStack(alignment: .leading) { …
119 ios  swift  xcode  swiftui 

4
刷新配置文件时Xcode崩溃
我似乎无法在Xcode中刷新我的配置文件而不会崩溃。每当我在管理器中按下刷新按钮时,它就会崩溃,并从错误日志中检索以下行: UNCAUGHT EXCEPTION (NSInvalidArgumentException): *** setObjectForKey: object cannot be nil (key: teamId) 所以我检查了我的teamId,但没有发现任何异常。有人有什么想法导致我的问题吗?每次刷新个人资料时,这都会为我工作。甚至今天早上做了十次。 编辑: 如果需要,这里是崩溃报告: Process: Xcode [1136] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 4.6.1 (2067) Build Info: IDEApplication-2067000000000000~2 App Item ID: 497799835 App External ID: 14581035 Code Type: X86-64 (Native) Parent Process: launchd [272] User ID: 501 Date/Time: 2013-03-15 15:21:43.906 …

11
提交时,Xcode 8“应用程序签名中缺少aps环境权利”
我有一个应用程序,在过去6个月中我们提交了数十个版本,并且我们确实使用了APNS。升级到Xcode 8后,我从Apple收到了以下电子邮件 亲爱的开发人员, 我们发现您最近为APP_NAME交付商品时遇到一个或多个问题。您的交付成功,但是您不妨在下一次交付中更正以下问题: 缺少推送通知权利-您的应用程序包含Apple的推送通知服务的API,但该应用程序的签名中缺少aps环境权利。要解决此问题,请确保在Provisioning Portal中为推送通知启用了您的App ID。然后,使用包含aps-environment权利的发行配置文件对您的应用程序进行签名。这将创建正确的签名,您可以重新提交您的应用程序。有关更多信息,请参见《本地和推送通知编程指南》中的“ Provisioning and Development”。如果您的应用程序不使用Apple Push Notification服务,则无需采取任何措施。您可以从以后的提交中删除该API,以停止此警告。如果您使用第三方框架, 解决问题之后,可以使用Xcode或Application Loader将新的二进制文件上载到iTunes Connect。 问候, App Store团队 奇怪的是我去了developer.apple.com- > 证书,标识符和配置文件,而我的AppId确实仍启用了推送通知。我没有做任何其他的事情,所以我对Xcode 8更新是否有问题感到好奇。有任何想法吗? 顺便说一句:他们在“推送通知编程指南”中放置的链接在电子邮件中已损坏,因此不是一个好兆头。


9
在UIImageView上使用淡色
我有自己的子类UIButton。我添加UIImageView它并添加图像。我想用淡淡的颜色在图像上绘制它,但是它不起作用。 到目前为止,我有: - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor clearColor]; self.clipsToBounds = YES; self.circleView = [[UIView alloc]init]; self.circleView.backgroundColor = [UIColor whiteColor]; self.circleView.layer.borderColor = [[Color getGraySeparatorColor]CGColor]; self.circleView.layer.borderWidth = 1; self.circleView.userInteractionEnabled = NO; self.circleView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:self.circleView]; self.iconView = [[UIImageView alloc]init]; [self.iconView setContentMode:UIViewContentModeScaleAspectFit]; UIImage * …

12
Xcode MyProjectName-Bridging-Header.h不存在
我想在我的Objective-C项目中开始使用Swift。所以我增加了一个快速班: import Foundation @objc class System : NSObject { @objc func printSome() { println("Print line System"); } } 并将其导入到.m文件中: #import "MyProjectName-Swift.h" 在构建我的项目时,出现以下错误: Bridging header 'PathToMyProject/MyProjectName-Bridging-Header.h' does not exist 注意:在“构建设置-> Swift编译器-代码生成-> Objective-C桥接标题”下设置为MyProjectName-Bridging-Header.h 我应该怎么做才能解决这个问题? 任何帮助深表感谢。 编辑:桥接头文件:#if defined(__ has_include)&& __has_include()#include #endif #include <objc/NSObject.h> #include <stdint.h> #include <stddef.h> #include <stdbool.h> #if defined(__has_include) && __has_include(<uchar.h>) …
118 ios  objective-c  xcode  swift 

25
Mac App Store上的Xcode无法安装,显示磁盘空间不足
我正在使用Mac OS安装XCode10.1。 我在Mac中有18.43GB的可用磁盘空间, 但是当我在应用商店中单击Xco​​de上的安装按钮时, 它始终显示“存储磁盘空间不足,您无法安装产品”警报消息。 如何解决MacOS Mojave(10.14.1)中的问题? 非常感谢你。
118 xcode  macos  install 

20
致命错误:AST文件格式错误或损坏-Xcode
在最新版本的Xcode中构建应用程序时出现此错误: 致命错误:AST文件格式错误或已损坏在'/ Users / me / Library / Developer / Xcode / DerivedData / ModuleCache / XYZYIE6ZV0OP'1处生成模块高速缓存。 当我导航到: / Users / me / Library / Developer / Xcode / DerivedData / ModuleCache 我可以看到目录“ XYZYIE6ZV0OP”不存在。 有人知道我该如何解决吗?我无法按照错误消息第二部分的建议删除该目录中的任何内容,因为该目录不存在!
117 ios  xcode  ios7 



4
Xcode 7库搜索路径警告
这是显示的警告: 找不到选项'-F / Applications / Xcode-beta.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS9.0.sdk / Developer / Library / Frameworks的目录” 谁能帮助解决警告?
117 xcode  xcode7 


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.