首先请允许我声明我是关于Objective-C和Xcode的绝对新手,因为我来自Flash Builder(IDE)/ AS3背景.我最近开始学习Objective-C并使用Xcode.
我现在正在编写我的第一个程序,并注意到Xcode中的自动完成功能不能像我期望的那样工作.它向我展示了各种与我正在使用的类型无关的价值观.
如果我宣布:
NSFileManager *manager;
Run Code Online (Sandbox Code Playgroud)
然后如果我manager = [NSFileManager在这里输入
并输入命令+空格,我希望defaultManager是其中一个建议.建议应该只是NSFileManager类的方法和属性.这就是我在Flash Builder中习惯它的方式.
这是Xcode中的一个错误,一些配置错误还是因为Xcode应该不起作用?

我今天在Xcode 4中添加了一个包含多个文件的新组.由于某种原因,这已经包含了一段时间,我无法命名或重命名组文件夹.
以前是否发生过这种情况,如果有的话,你是否遇到过修复?
我使用下面的代码通过意图启动Twitter,但它不起作用.我的手机上安装了Twitter应用程序.
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Content to share");
PackageManager pm = contexto.getPackageManager();
List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0);
for (final ResolveInfo app : activityList) {
if ("com.twitter.android.PostActivity".equals(app.activityInfo.name)) {
final ActivityInfo activity = app.activityInfo;
final ComponentName name = new ComponentName(activity.applicationInfo.packageName, activity.name);
shareIntent.addCategory(Intent.CATEGORY_LAUNCHER);
shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
shareIntent.setComponent(name);
contexto.startActivity(shareIntent);
break;
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试调用活动时获取异常:
android.content.ActivityNotFoundException:无法找到显式活动类{com.twitter.android/com.twitter.android.PostActivity}; 你有没有在AndroidManifest.xml中声明这个活动?
Apple 在NSPersistentCloudKitContaineriOS 13 中引入了,这使我们能够将 CloudKit 与 Core Data 一起使用。我让它在不同的设备上几乎立即工作,但我的主要问题仍然存在。
是否可以以简单的方式与其他用户共享数据?我一直在阅读,CKShare但不知道如何NSPersistentCloudKitContainer以简单的方式从这里开始。
core-data ios cloudkit ckshare nspersistentcloudkitcontainer
我想在我的View Controller中简单地放置一个Camera View.
我进口的AVFoundation顶部,以及UIImagePickerControllerDelegate与UINavigationControllerDelegate类.
但是,每当我尝试使用时AVCaptureStillImageOutput,Xcode告诉我它在iOS10中已被弃用,我应该使用AVCapturePhotoOutput.这是完全没问题,但是,只要我想打电话stillImageOutput.outputSettings,.outputSettings它本身就不可用.因此,我必须使用AVAVCaptureStillImageOutput它才能工作,但我有多个警告,因为在iOS10中不推荐使用此功能.
我搜索和搜索,但无法真正找到解决方案.我将衷心感谢您的帮助.我正在学习,所以任何解释都会很棒!代码如下.
import UIKit
import AVFoundation
class CameraView: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
var captureSession : AVCaptureSession?
var stillImageOutput : AVCaptureStillImageOutput?
var previewLayer : AVCaptureVideoPreviewLayer?
@IBOutlet var cameraView: UIView!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
captureSession = AVCaptureSession()
captureSession?.sessionPreset = AVCaptureSessionPreset1920x1080
var backCamera = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo)
var error : NSError?
do {
var input = try! AVCaptureDeviceInput (device: backCamera)
if …Run Code Online (Sandbox Code Playgroud) 我有一个passwordField,我将其设置isSecureTextEntry为true,用于隐藏字符.但是,当我点击这个时,passwordField这告诉我这个错误:
[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: "myapp" due to error: iCloud Keychain is disabled
Run Code Online (Sandbox Code Playgroud)
键盘自动传递到一个qwerty的azerty ...
如果我删除passwordField.isSecureTextEntry = true问题消失但角色没有隐藏...
我告诉你我的代码:
passwordField.borderStyle = UITextField.BorderStyle.none
passwordField.font = UIFont(name: "Avenir-Heavy", size: 13)
passwordField.autocorrectionType = UITextAutocorrectionType.no
passwordField.clearButtonMode = UITextField.ViewMode.whileEditing
passwordField.keyboardType = UIKeyboardType.default
passwordField.returnKeyType = UIReturnKeyType.done
passwordField.contentVerticalAlignment = UIControl.ContentVerticalAlignment.bottom
passwordField.isSecureTextEntry = true
Run Code Online (Sandbox Code Playgroud)
我测试了这个答案,但没有任何变化
如何在没有iCloud Keychain和没有更改键盘的情况下隐藏我的textField的字符到qwerty?
我看了所有其他主题,但没有比我的问题...
我正在开发一个反应本机应用程序,我使用一些内联错误消息来归档 TextInput。如果验证失败,我将显示带有错误消息的文本组件。它工作正常。但我在 iOS 上遇到 VoiceOver 问题。错误消息是动态的,焦点不会切换到错误消息。在android中,我添加了accessibilityLiveRegion="assertive"将焦点切换回错误文本然后阅读的功能。下面是代码。
<Text style={ messageCellStyle } accessibilityLiveRegion="assertive">
{ StringUtils.process(message, props) }
</Text>
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助使其在 iOS VoiceOver 中运行吗?我想在用户界面中显示错误消息时阅读它。
我刚刚创建了一个应用程序和一个传递,所以我可以将传递添加到iPod中的PassBook,但我无法通过电子邮件或Web服务器链接共享传递.从我从Apple读取的文档中,我需要添加一个MIME类型application/vnd.apple.pkpass.但是,我不清楚我应该采取什么措施.我不知道如何使用MIME类型.
我应该如何添加此MIME类型以便使用来自我的Web服务的传递?
NSInvalidArgumentException将项目升级到Swift 4.2(从4.0转换)后,我遇到异常.
2018-09-19 15:37:33.253482+0100 <redacted>-beta[3715:1010421] -[Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector sent to instance 0x107e6c290
2018-09-19 15:37:33.254312+0100 <redacted>-beta[3715:1010421] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector sent to instance 0x107e6c290'
Run Code Online (Sandbox Code Playgroud)
它是与a相关的东西NSMutableAttributedString和它添加一些属性的代码,例如,a NSAttributedString.Key.underlineStyle.
即将分配属性字符串时会发生异常: textView.attributedText = mutableAttributedString.
所以,它在Swift 4中工作:
mutableAttributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.styleNone.rawValue, range: range)
然后,使用Swift 4.2,编译器建议更改NSUnderlineStyle.styleNone.rawValue为NSUnderlineStyle.none.rawValue
之后,编译器开始大喊" 'none'不可用:使用[]构造一个空选项集 ":
mutableAttributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.none.rawValue, range: range)
^~~~~ 'none' is unavailable: use [] to construct an empty option set
Run Code Online (Sandbox Code Playgroud) ios ×4
swift ×3
xcode ×2
android ×1
autocomplete ×1
avfoundation ×1
ckshare ×1
cloudkit ×1
core-data ×1
ide ×1
ios10 ×1
mime-types ×1
nspersistentcloudkitcontainer ×1
passbook ×1
react-native ×1
reactjs ×1
swift3 ×1
swift4.2 ×1
testflight ×1
twitter ×1