我试图从Xcode 9远程调试在Apple TV4(tvOS11)上运行的应用程序,但我遇到了一个问题,因为我无法激活"通过网络连接",因为此选项在Xcode 9中仍然是灰色/禁用的.
我检查AppleTV设置中是否有错误但没有成功.当然,我的MacBook在同一个网络上:
MacBook IP 192.168.0.23 Apple TV IP:192.168.0.39
当然,当与USB链接连接时,Apple TV会出现在Xcode中.
有没有人有想法?
我最近升级到Xcode 9 Server并发现了一个突然的问题.在我遇到这个错误之前,还有其他一些问题.我从自动签名变为手动唱歌来回.现在在我的iOS项目中我手动设置它并在服务器上我尝试了两者.构建是成功的,它产生一个存档(我不能下载它),但它也给我错误:
exportArchive: exportOptionsPlist error for key 'iCloudContainerEnvironment': expected one of {Development, Production}, but no value was provided
我还检查了集成输出目录,它不会生成ipa文件.
由于我不手动触发xcodebuild,我不知道如何解决它.
我正在尝试创建AttributedString并添加属性
typingAttributes(from textView)
问题是
.typingAttributes
返回
[String, Any]
和
NSAttributedString(string:.. , attributes:[])
需求
[NSAttributedStringKey: Any]
我的代码:
NSAttributedString(string: "test123", attributes: self.textView.typingAttributes)
Run Code Online (Sandbox Code Playgroud)
我不想创建for循环来遍历所有键并将其更改为
NSAttributedStringKey
Run Code Online (Sandbox Code Playgroud) 最近我将Xcode升级到Xcode 9.1.之后,当我尝试发布我的应用程序时,Xcode不允许选择我为ad-hoc创建的分发配置文件.这么说
个人资料不是IOS App Store个人资料
如果有关Xcode 9.1的应用程序分发程序有变化,请告知我们
我正在使用Xcode 9.我做了归档构建并进入归档窗口/组织窗口.从那里我们通常导出构建.但由于某种原因,我无法做到这一点.
在Xcode的早期版本中,我们可以在iTunes的帮助下进入包内容并从.app生成.ipa.但现在他们已经删除了这个选项.有人可以帮助我从我们生成的.app文件生成.ipa吗?
使用Xcode 9和Swift 4以及vapor heroku push/ vapor heroku init,我收到:
-----> Swift app detected
Cloning into 'swiftenv'...
Swift 3 Heroku Installer
Version: 3.1.1
Operating System: ubuntu1404
Installing Swiftenv
Cloning into '/app/.swiftenv'...
Installing Swift
Downloading https://swift.org/builds/swift-3.1.1-release/ubuntu1604/swift-3.1.1-RELEASE/swift-3.1.1-RELEASE-ubuntu16.04.tar.gz
/tmp/swiftenv-3.1.1- /tmp/build_d
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
/tmp/build_d
3.1.1 has been installed.
? Done
-----> Installing clang-3.7.0
precompile
-----> Building Package ... this will take a while
swift-build: error: Package requires …Run Code Online (Sandbox Code Playgroud) 我在iOS上生成视频缩略图列表:
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
// get a reference to our storyboard cell
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath as IndexPath)
cell.backgroundColor = UIColor.red
// Use the outlet in our custom class to get a reference to the UILabel in the cell
let imageView = UIImageView(frame: CGRect(x:0, y:0, width:cell.frame.size.width, height:cell.frame.size.height))
let image = uiImageArray[indexPath.row]
imageView.image = image
imageView.contentMode = UIViewContentMode.scaleAspectFit
cell.addSubview(imageView)
return cell
}
Run Code Online (Sandbox Code Playgroud)
当用户点击图片我想播放视频时:
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: …Run Code Online (Sandbox Code Playgroud) 我看到XCode 9有一个非常新的错误/功能,如果我选择了一些快速字符串,在字符串末尾键入"添加额外":
"Existing String" //selected by double clicking on quotes
""Existing String"" //adding another quote does not overwrite the string, but wraps it in more quotes, resulting in utter nonsense
Run Code Online (Sandbox Code Playgroud)
我得到两个空字符串,其间有一个未知的引用.我希望得到一个新的空字符串.
新行为与Objective-C代码中的[]类似.我想覆盖该方法,而是获得一对额外的括号.
如果已经有引号或括号,如何阻止XCode在所选文本周围插入引号或括号?
PS.我也得到了其他文本编辑错误,最明显的是在创建新的Obj-C方法时{不会被关闭}平衡.
我有一个适用于IoS的Ionic3应用程序.直到昨天我才能在xcode9中打开.xcodeproj并将应用程序上传到我的iphone.我不知道出了什么问题,但现在我收到此错误"命令/ usr/bin/codesign失败,退出代码为1",无法将应用程序上传到手机(使用电缆)或存档.
我的技术:
cli包:(/ usr/local/lib/node_modules)
@ionic/cli-utils : 1.15.2
ionic (Ionic CLI) : 3.15.2
Run Code Online (Sandbox Code Playgroud)
全球套餐:
cordova (Cordova CLI) : 6.4.0
Run Code Online (Sandbox Code Playgroud)
本地包裹:
@ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.0.0 ios 4.3.1
Ionic Framework : ionic-angular 3.6.0
Run Code Online (Sandbox Code Playgroud)
系统:
ios-deploy : 1.9.0
ios-sim : 6.1.2
Node : v7.3.0
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Run Code Online (Sandbox Code Playgroud)
关于我的错误的更多细节:
CodeSign /Users/macbook/Library/Developer/Xcode/DerivedData/HelloCordova-bsbygjyhdfcgftavbtgwrsqhgdkb/Build/Products/Debug-iphoneos/HelloCordova.app
cd /Users/macbook/ionic/componentaalex3/platforms/ios
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Signing Identity: "iPhone Developer: Alex Claudiu (xxxxxxxxxxxx)"
Provisioning …Run Code Online (Sandbox Code Playgroud) 我有一个查询API的函数,然后根据结果填充对象数组(参见下面的代码).从检索到的JSON中我可以使用guard语句来捕获任何错误,这意味着如果数据丢失则会被捕获,但是如果URL不正确或者函数无法连接到URL,则会导致应用程序崩溃
let task = URLSession.shared.dataTask(with: request) { (data: Data?, response: URLResponse?, error: Error?) in
Run Code Online (Sandbox Code Playgroud)
并给出以下错误消息
2018-01-27 23:11:28.759466+0000 myPregnancy[6321:224887] TIC Read Status [1:0x6040001729c0]: 1:57
2018-01-27 23:11:28.759940+0000 myPregnancy[6321:224887] Task <05716AF1-B1E0-4EB8-ADC7-138C026C58AC>.<1> HTTP load failed (error code: -1005 [4:-4])
2018-01-27 23:11:28.760813+0000 myPregnancy[6321:224886] Task <05716AF1-B1E0-4EB8-ADC7-138C026C58AC>.<1> finished with error - code: -1005
Run Code Online (Sandbox Code Playgroud)
如何使用guard来捕获此错误并返回类似于我处理丢失数据的错误消息?
func loadMedication(){
print("Getting medication")
self.medication.removeAll()
let myUrl = URL(string: "URL HIDDEN");
var request = URLRequest(url:myUrl!)
request.httpMethod = "POST"// Compose a query string
let postString = "userToken=" + User.user.getUserId();
request.httpBody = postString.data(using: String.Encoding.utf8);
let …Run Code Online (Sandbox Code Playgroud)