我试图创建新的 Xcode 8 Source Editor Extension,但由于某种原因基本的例子总是disabled(截图)对我来说,我不确定它是否是测试版的一些错误或我遗漏了一些东西.
所以我创建了几乎基本的扩展,例如WWDC视频和示例教程,由于某种原因,这个菜单项总是被禁用.
我在终端中运行sudo/usr/libexec/xpccachectl并重新启动Mac.我使用的是10.11.5 Mac OS.
还我测试工作实施例从像github上这个 (截图2)或这但它们也被禁用.
**
所以我的问题是:由于Xcode 8仍然处于测试阶段或者我的身边缺少某些配置以使扩展工作,这是否是某种错误?
在以前版本的SpriteKit中,原点(0,0)始终位于左下角.此外,默认情况下,Node已添加到其父级.
似乎从Xcode 8开始,新的默认原点位于屏幕的中心.
这是正确的行为,测试版中的错误,还是我根本不了解SpriteKit?
两者都使用相同的代码
import SpriteKit
import GameplayKit
class GameScene: SKScene {
override func didMove(to view: SKView) {
let ship = SKSpriteNode(imageNamed: "Spaceship")
addChild(ship)
}
}
Run Code Online (Sandbox Code Playgroud)
Xcode 7:
Xcode 8:
我创建了一个简单的应用程序,使用UIActivityViewController如下.
let text = "Test Text"
let printData = UISimpleTextPrintFormatter(text: text)
let vc = UIActivityViewController(activityItems: [text, printData], applicationActivities: nil)
vc.completionWithItemsHandler = { (type,completed,items,error) in
print("completed. type=\(type) completed=\(completed) items=\(items) error=\(error)")
}
vc.modalPresentationStyle = .popover
vc.popoverPresentationController?.sourceView = self.openActivityButton
vc.popoverPresentationController?.sourceRect = self.openActivityButton.bounds
vc.popoverPresentationController?.permittedArrowDirections = .up
vc.popoverPresentationController?.delegate = self
self.present(vc, animated: true) { () in
}
Run Code Online (Sandbox Code Playgroud)
我在iOS 10(Xcode 8.0 beta 6)上运行此应用程序.
completionWithItemsHandler会调用它.completionWithItemsHandler会调用它.completionWithItemsHandler会调用它.completionWithItemsHandler是不叫.这种奇怪的行为发生在iOS 10上,但没有发生在iOS9上(处理程序是在iOS9上调用的)
这是iOS 10的错误吗?如果是这样,是否有任何变通方法来检测UIActivityController …
只是在将我的代码从swift 2.3转换为3的过程中.在旧代码中,我通过以下代码创建了一个渐变:
let colours:CFArrayRef = [tColour.CGColor, bColour.CGColor]
let colorSpace = CGColorSpaceCreateDeviceRGB()
let gradient = CGGradientCreateWithColors(colorSpace, colours, nil)
Run Code Online (Sandbox Code Playgroud)
当Xcode 8转换代码时,它将其更改为以下内容:
let colours:CFArray = [tColour.cgColor, bColour.cgColor]
let colorSpace = CGColorSpaceCreateDeviceRGB()
let gradient = CGGradient(colorsSpace: colorSpace, colors: colours, locations: nil)
Run Code Online (Sandbox Code Playgroud)
但是,代码会产生以下错误:
上下文类型"CFArray"不能与数组文字一起使用
任何人都可以建议如何正确转换代码.
感谢
Reza
当从xcode 7 for iOS 8到10编译时,应用程序运行正常,但是当从xcode 8编译时,应用程序仅在iOS 8上正常工作,iOS 8上的应用程序崩溃,应用程序崩溃不一致.有时它会停在一个随机的UI元素,例如:
但更常见的是它会在主要时崩溃:
* thread #1: tid = 0x11d655, 0x35deaf56 libobjc.A.dylib`objc_msgSend + 22, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xf632d5c1)
frame #0: 0x35deaf56 libobjc.A.dylib`objc_msgSend + 22
frame #1: 0x2db167ea CoreUI`-[CUINamedImage initWithName:usingRenditionKey:fromTheme:] + 98
frame #2: 0x2db21d48 CoreUI`-[CUICatalog imageWithName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:] + 128
frame #3: 0x2b8aee98 UIKit`__98-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 240
frame #4: 0x2b8aecea UIKit`-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 230
frame #5: 0x2b95df86 UIKit`-[UIImageAsset imageWithTraitCollection:] + 474
frame #6: 0x2b58d9d2 UIKit`-[UIImageView _resolveImageForTrait:] + 286
frame #7: 0x2b58d690 UIKit`-[UIImageView …Run Code Online (Sandbox Code Playgroud) 我正在使用iOS 10和使用相机拍照的应用程序.当相机视图打开时,而不是取消按钮,标题为"API_CANCEL_TITLE".当我捕捉到整个标题看到的图片时,我想要的不是这个长标题,而是看起来"取消".我使用过应用本地化.我搜索了几个链接但找不到解决方案.
这是屏幕截图:
这只发生在iOS 10中,在iOS 9中它将正常工作在这里是代码:
- (IBAction)takePicturePressed:(UIButton *)sender
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
请建议......
我收到了这个错误
使用未解析的标识符'kGMSMarkerAnimationPop'
当我在Swift 3中使用以下代码时:
let camera = GMSCameraPosition.camera(withLatitude: location.coordinate.latitude, longitude: location.coordinate.longitude, zoom: 14)
mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView?.isMyLocationEnabled = true
mapView?.settings.myLocationButton = true
view = mapView
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude)
marker.title = "Sydney"
marker.snippet = "Australia"
marker.appearAnimation = kGMSMarkerAnimationPop // the error is occurring in this line
marker.map = mapView
locationManager.stopUpdatingLocation()
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我阅读了如何控制何时在iOS中提示用户推送通知权限和类似问题,但它们不是用Swift 3编写的.
我在Xcode 8/Swift 3.0中阅读过注册推送通知?五次.
我一遍又一遍地在模拟器中运行我的应用程序但是在第一次之后,应用程序从未提示用户提供推送通知权限.
我在Xcode 8/Swift 3.0中使用了注册推送通知的代码?并继续尝试不同的答案并将代码移动到不同的地方,以便只有在按下某个按钮后才会要求用户许可,而不是在应用程序启动时立即.
我是否必须使用Apple ID等注册推送通知代码才能在Simulator中工作?
切换到Xcode 9然后回到Xcode 8后,我的构建失败了,我收到了这个错误.我在Xcode 9上没有收到任何错误.
为什么我收到此错误?
BasketTotalView.xib:内部错误.请在bugreport.apple.com上提交一个错误并附上"/ var/folders/dg/_yf1yfd15svdj48mrrlws5vw0000gp/T/IB-agent-diagnostics_2017-08-18_10-08-35_271000".
xcode8 ×10
ios ×6
xcode ×5
swift3 ×4
ios10 ×3
objective-c ×2
swift ×2
camera ×1
gmsmapview ×1
google-maps ×1
macos ×1
skspritenode ×1
sprite-kit ×1
xcode9 ×1