我是初学者,使用Xcode 7 beta,使用Xcode 6编写教程.在教程中,教师选择Editor,Pin和Horizontal Spacing来固定两个图像之间的空间,以便在切换到横向时保持不变.在Xcode 7中,Editor菜单不包含Pin菜单.有谁知道如何在新的Xcode 7中固定两个图像之间的水平间距?
有人可以详细说明为什么nonnull在iOS 9中引入?
例如,该NSArray方法+ (instancetype)array;现在+ (instancetype nonnull)array;
请参阅:https: //developer.apple.com/library/prerelease/ios/releasenotes/General/iOS90APIDiffs/frameworks/Foundation.html
这是一个客观的c级功能,这将如何影响现有的应用程序?
我看到了这个问题,但我仍然无法导入框架并在Xcode 7 beta 2(7A121l)中使用它.
所以目前我正在尝试使用结果,通过carthage.将其添加到带有二进制和嵌入框架的构建阶段/链接二进制文件后,我能够成功编译,但是我收到错误说明(是的,它表示成功,然后是错误:S):
No such module 'Result'
Run Code Online (Sandbox Code Playgroud)
关于进口:
import Result
func serverRequest() -> Result<String, NSError> {
...
}
Run Code Online (Sandbox Code Playgroud)
构建能够运行和编译,但我无法cmd +单击Result,例如.
编辑1: 在Xcode 6.3.2上它按预期工作.
编辑2: 打开雷达:21588771
问题:如何使用Deliver从运行在Xcode 7和Server 4.1上的Bot上传IPA到itunesconnect?
我已经能够在Xcode 6.4,Server 4.1中使用机器人和Deliver(通过fastlane)建立持续集成解决方案.一旦我升级到Xcode 7 beta-3,我的机器人就停止了工作.
以下是我为Xcode 6.4所做的简要概述:
gem install --user-install deliver#Run To Gemexport PATH=$PATH:/var/_xcsbuildd/.gem/ruby/2.0.0/bin#Run将Gems添加到Path从后触发:
echo `DELIVER_PASSWORD="Password"
/var/_xcsbuildd/.gem/ruby/2.0.0/bin/deliver testflight
"${IPA_PATH}" -a 101233338 -u example@gmail.com --beta`
Run Code Online (Sandbox Code Playgroud)一切都运行良好,每次集成后都会将构建内容上传到itunesconnect.
当我升级到Xcode 7时,我无法再使用Deliver上传到itunesconnect.这是我的Xcode 7工作流程:
发布触发器1:成功构建IPA(使用此Apple开发人员帖子的推荐)
xcrun xcodebuild -exportArchive -archivePath
$XCS_ARCHIVE -exportPath $XCS_ARCHIVE
-exportOptionsPlist /Library/Developer/XcodeServer/ExportOptions.plist
-IDEPostProgressNotifications=YES
-DVTAllowServerCertificates=YES
-DVTSigningCertificateSourceLogLevel=3
-DVTSigningCertificateManagerLogLevel=3
-DTDKProvisioningProfileExtraSearchPaths=/Library/Developer/XcodeServer/ProvisioningProfiles
Run Code Online (Sandbox Code Playgroud)尝试使用Deliver上传IPA:
echo `DELIVER_PASSWORD="Password"
/var/_xcsbuildd/.gem/ruby/2.0.0/bin/deliver testflight
"${IPA_PATH}" -a 101233338 -u example@gmail.com --beta`
Run Code Online (Sandbox Code Playgroud)结果:
构建服务问题:终止xcodebuild,因为它没有产生太长时间的输出.
注意:我可以使用机器人生成的IPA并通过终端上传它们.
Xcode没有打印出所有日志,当我将输出重定向到文件时,看起来Deliver运行得很好
ESC[37m[12:03:08]: ESC[0mESC[32mReady to …Run Code Online (Sandbox Code Playgroud) 当使用Xcode 7b5构建包含Today Extension的应用程序时,我无法创建有效的存档.当我进行存档时,构建成功,然后在管理器中它显示在"其他项目"下而不是"iOS应用程序"下.
如果我关闭项目并在Xcode 6.3.2中打开相同的项目,当我进行存档时,它会显示在"iOS Apps"下.
我比较了档案,我注意到的一件事是我的今日小工具被放置在Applications目录之外.对于Xcode 6.3.2和Xcode 7b5,结构如下所示:
Xcode 6.3.2
| -Archive
| - 产品
| ---应用程序
| ---- MyMainApp.app
Xcode 7 Beta 5
| -Archive
| - 产品
| ---应用程序
| ---- MyMainApp.app
| --- MyTodayWidget.appex
我认为问题是MyTodayWidget打包在Applications目录之外和.app之外.我不确定为什么Xcode 7 beta 5会以不同于Xcode 6.3.2的方式打包应用程序,而我没有做任何更改.
更新2015年8月14日:这似乎是CocoaPods和Extensions的一个问题,如WatchKit或Today扩展.据报道,在Xcode 7 beta 5(带有watchkit扩展名)#4021中使用"Archive"时,其他开发人员生成了无效存档.这似乎是这个问题的根本原因.
环境:
- Xcode 7 Beta 5
- 今日扩展
- 普通应用程序
- CocoaPods 0.38.2(截至9/22的最新发布版本)
- AFNetworking用于扩展和应用程序
我已将设备升级到iOS 9,将Xcode环境升级到7.0 beta.推送通知在iOS 9中无效?
这是我的代码:
float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
if(ver >= 8 && ver<9)
{
if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
{
[[UIApplication sharedApplication] registerForRemoteNotifications];
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
}
}else if (ver >=9){
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else{
//iOS6 and iOS7 specific code
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert];
}
Run Code Online (Sandbox Code Playgroud)
在使用Xcode 6.4构建的iOS 8到8.3上,推送通知正常工作.
我在将Google AnalyticsSDK集成到iOS项目时遇到了很多麻烦.我正在使用XCode 7并以iOS 7为目标.使用Swift 2.0.但是我可以让样本正常工作(尽管不转换为Swift 2.0).
我已尝试通过CocoaPods安装并手动复制文件:
https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download
通过CocoaPods安装时,我尝试了两种方法
pod 'Google/Analytics'
Run Code Online (Sandbox Code Playgroud)
,
pod 'GoogleAnalytics'
Run Code Online (Sandbox Code Playgroud)
和
pod 'Google/Analytics', '~> 1.0.0'
Run Code Online (Sandbox Code Playgroud)
无论哪种情况,XCode构建都会失败并出现错误
BridgingHeader.h:2:9: 'Google/Analytics.h' file not found
Failed to import bridging header '/Users/jonas.andersson/Projects/MyAppName/MyAppName/Supporting files/BridgingHeader.h'
Run Code Online (Sandbox Code Playgroud)
这个在行:
#import <Google/Analytics.h>
Run Code Online (Sandbox Code Playgroud)
我也尝试过添加
$(SRCROOT)/Pods/GoogleAnalytics
Run Code Online (Sandbox Code Playgroud)
添加到AppDelegate时找不到Google/Analytics.h文件中的其他建议
更新
使用pod 'GoogleAnalytics'然后#import <Google/Analytics.h>更好地工作.但是,我收到以下错误:
Use of unresolved identifier 'GGLContext'
Run Code Online (Sandbox Code Playgroud)
当我根据Google文档尝试设置GA时:
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
Run Code Online (Sandbox Code Playgroud) 我的配置:Mac Watch X El Capitan上的Apple Watch(WatchOS 2.0.1),iPhone 5S(iOS 9.1)Xcode 7.1.
我可以在iPhone上运行我的应用程序就好了.但是,当我尝试在Apple Watch上运行我的应用程序时,似乎不可能.我在状态栏中看到的是通常的步骤
在Apple Watch上构建MyApp
安装到Apple Watch
在Apple Watch上运行MyApp
然后,在不到一秒的时间里,它显示出来
在Apple Watch上完成运行MyApp
好像我刚刚按下了Xcode中的停止按钮(但没有完全按下它).没有错误消息或警告.它就停止了.
因此,我无法在Apple Watch上调试我的应用程序以查看日志消息,内存使用情况等.
有任何想法吗?在此先感谢您的帮助!
我的UI测试失败,因为测试等待无休止,直到应用程序闲置.我无法看到背景中发生了任何事情,比如加载微调器.
它只出现在一个选项卡上.所有其他选项卡都是可点击的,但测试在屏幕3上失败.在屏幕3上测试后,单击另一个选项卡,测试恢复并成功完成.
有任何想法吗?
- (void)testExample
{
XCUIElementQuery* tabBarsQuery = self.app.tabBars;
[tabBarsQuery.buttons[@"Screen2"] tap];
[tabBarsQuery.buttons[@"Screen3"] tap];
[tabBarsQuery.buttons[@"Screen1"] tap];
[tabBarsQuery.buttons[@"Screen4"] tap];
}
Run Code Online (Sandbox Code Playgroud) 运行XCT UI测试时,可以在后台运行正在测试的应用程序:
XCUIDevice().pressButton(XCUIDeviceButton.Home)
Run Code Online (Sandbox Code Playgroud)
它可以以某种方式将应用程序恢复到前台(活动状态)而无需重新启动应用程序?
xcode7 ×10
ios ×7
ios9 ×4
xcode ×4
swift ×2
bots ×1
carthage ×1
cocoapods ×1
iphone ×1
objective-c ×1
watchos-2 ×1
xcode-server ×1
xcode6 ×1
xcode7-beta2 ×1
xcode7-beta5 ×1
xctestcase ×1