我正在尝试添加带纹理的圆形按钮NSToolbar.我使用Interface Builder添加NSButton到允许的工具栏项和默认项.
我正在使用window!.titleVisibility设置为的Safari样式工具栏.hidden.
Xcode 8打印此错误消息:
NSToolbarItem (<NSToolbarItem: 0x100c24000>) had to adjust the size of
<NSButton: 0x100c36690> from {43, 25} to {45, 27} as the height is expected to be
27.000000. Make sure that this toolbar item view has a valid frame/min/max size.
Run Code Online (Sandbox Code Playgroud)
这在以前的OS X版本中对我有用.
我尝试将最小和最大工具栏项高度设置为27,但Xcode会自动将最小值恢复为25.
我需要将我的代码更新为swift 3.下面的代码是完美的原始解决方案,但是在XCode 8 beta和iOS 10中使用swift 3时,'userContentController'委托在我使用原始的html + js代码时没有调用打电话给本机.
class ViewController: UIViewController, WKUIDelegate, WKScriptMessageHandler, WKNavigationDelegate,UIWebViewDelegate,CLLocationManagerDelegate,URLSessionDataDelegate,UIImagePickerControllerDelegate, UINavigationControllerDelegate {
....
func initWebView(){
// JAVASCRIPT PART
let contentController = WKUserContentController();
let jScript:String = "var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width'); document.getElementsByTagName('head')[0].appendChild(meta);";
let wkUScript:WKUserScript = WKUserScript(source: jScript, injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: true);
contentController.addUserScript(wkUScript)
contentController.add(
self,
name: "refreshWebPage"
)
contentController.add(
self,
name: "forceStepBack"
)
contentController.add(
self,
name: "setPageTitle"
)
contentController.add(
self,
name: "allowBackNavigate"
)
contentController.add(
self,
name: "changeBackNavigationURL"
)
contentController.add(
self,
name: "changeLeftButtonIconVisibility"
)
contentController.add(
self, …Run Code Online (Sandbox Code Playgroud) 以前使用Xcode 7.3.1我能够在我的iPad上直接在我的应用程序商店应用程序上构建并测试升级方案,该方案完美无缺.本周我升级到Xcode 8,当我尝试完全相同的方法时,我不断收到此升级错误
"此应用程序的应用程序标识符授权与已安装的应用程序的授权不匹配.这些值必须匹配才能允许升级."
我尝试在这个帖子上发布了多个解决方案,但没有一个有效.我也没有手表应用程序.只是一个简单的iOS应用目标.
我删除了我的证书和配置文件并重新创建它们仍然是同样的问题.然后我去下载Xcode 7.3.1并再次尝试使用完全相同的问题.
现在我陷入困境,无法完全测试我的升级方案.
请帮忙 !!
我有这个应用程序,总是在iOS9上正常工作,现在我已经将swift代码迁移到3.0并添加了所需的plist行来访问照片库.
在尝试使用UIImagePickerController模拟器从相机胶卷中选择视频(通过拖动预加载)时,它总是卡在"压缩视频"上,并且不会回调委托方法.
@IBAction func videoFromLibrary(_ sender: UIBarButtonItem) {
picker.allowsEditing = false
picker.sourceType = .photoLibrary
picker.mediaTypes = UIImagePickerController.availableMediaTypes(for: .photoLibrary)!
picker.modalPresentationStyle = .popover
present(picker, animated: true, completion: nil)
picker.popoverPresentationController?.barButtonItem = sender
}
Run Code Online (Sandbox Code Playgroud)
使用真实设备它工作正常,它似乎是一个苹果bug,我想知道是否有人有这个问题或我错过了一些东西,以便UIImagePickerController在模拟器上使用视频正确再次工作(或者如果有一个解决方法).
我已经定义了这样一个类:
internal class C {
internal func method() -> Void {
print("method called")
}
}
Run Code Online (Sandbox Code Playgroud)
如果我从该方法声明一个闭包,则该方法显示为删除线
let closure = C.init().meth
let closure2 = C.meth
Run Code Online (Sandbox Code Playgroud)
如果我在autocasting paranthesis中使用它,也会发生同样的情况 \(...)
print("\(C.init().meth)")
Run Code Online (Sandbox Code Playgroud)
我使用的Xcode 8.我想添加一个UIButton与Image在左侧和Title右侧.我想保持之间的距离Image,并Title在的UIButton在Storyboard.我Edge在这里看不到选项.这里的任何帮助非常感谢.
Build Phases - > Link Binary与Libraries或Build Settings - > Linker Flags有什么区别?
前者似乎不允许您在Debug与Release之间进行指定,并且其中指定的框架似乎也与后者不匹配.
注意:我已经检查了SO上的现有帖子,但没有找到能够准确回答这个问题的帖子.
我已经更新到MacOS 10.12.4 Sierra和Xcode 8.3.2,但现在因为Xcode项目导航器字体大小太小而失明.有没有办法增加导航器字体大小?我们曾经允许使用MMNavigatorFont这样的插件执行此操作但不再使用.
当我尝试在模拟器中运行应用程序时,我持有Xcode 8.3.2和Xcode 9 beta 1,我的项目在Xcode 8.3.2中运行.我得到了以下错误.
Images.xcassets: error: Failed to find a suitable device for the type SimDeviceType : com.apple.dt.Xcode.IBSimDeviceType.iPad-2x with runtime SimRuntime : 10.3 (14E269) - com.apple.CoreSimulator.SimRuntime.iOS-10-3
Failure Reason: Failed to create SimDeviceSet at path /Users/Mac/Library/Developer/Xcode/UserData/IB Support/Simulator Devices. You'll want to check the logs in ~/Library/Logs/CoreSimulator to see why creating the SimDeviceSet failed.
Underlying Errors:
Description: Failed to initialize simulator device set.
Failure Reason: Failed to subscribe to notifications from CoreSimulatorService.
Underlying Errors:
Description: Error returned in reply to …Run Code Online (Sandbox Code Playgroud) 我是iOS开发的新手,我无法弄清楚如何从Xcode 8中删除错误的证书.我觉得我到处都搜索过,但我找不到直截了当的答案.
这是我尝试过的(下面的几张图片):
在Xcode中,我转到Preferences然后Accounts选项卡,然后单击我的Apple ID登录.我有两个不同的团队 - 个人团队和公司企业团队.
当我点击我的个人帐户,然后去Manage Certificates,有一个旧证书,使用我之前使用的错误电子邮件,它说状态Not in Keychain.但是,当我右键单击它时,所有选项,例如Delete Certificate灰显.我怎么能删除这个?我真的不希望它在那里因为它看起来很乱.
然后,当我去公司团队,然后去Manage Certificates,有一个证书,我通过现在命名的门户网站意外撤销了Untitled.当我右键单击它时,Delete Certificate它也会变灰.
我怎样才能摆脱这些证书?
xcode8 ×10
ios ×3
ios10 ×2
macos-sierra ×2
xcode ×2
certificate ×1
font-size ×1
ios11 ×1
linker-flags ×1
macos ×1
swift ×1
swift3 ×1
uibutton ×1
wkwebview ×1
xcode7.3 ×1
xcode9-beta ×1