安装Xcode 9 beta后,Xcode 8在编译项目时出错:
在'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/cdtool'找不到cdtool:找不到平台的模拟器运行时
<DVTPlatform:0x7fd67af0a930:'com.apple.platform.iphonesimulator':<DVTFilePath:0x7fd67af0a7c0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform'>>.
我怀疑Xcode 9使用Xcode 8修改了一些共享状态(设置路径,覆盖文件等).但我已经尝试删除和两个Xcodes无济于事.
该项目使用Core Data,在尝试编译xcdatamodel时显然失败了.
我仍然可以在Xcode 9下编译和运行.
我无法NSFetchedResultsController在iOS 10中使用来自AECoreDataUI的CoreDataTableViewController中的 Swift 3进行初始化.
let request = NSFetchRequest<NasaPicture>(entityName:"NasaPicture")
request.predicate = Predicate(format: "isPagedResult == YES")
request.sortDescriptors = [SortDescriptor(key: "date", ascending: false)]
fetchedResultsController = NSFetchedResultsController(fetchRequest: request, managedObjectContext: moc, sectionNameKeyPath: nil, cacheName: nil)
Run Code Online (Sandbox Code Playgroud)
编译器抱怨说
"Cannot convert value of type NSFetchedResultsController<NasaPicture> to expected type NSFetchedResultsController<_>"
Run Code Online (Sandbox Code Playgroud)
控制器现在使用swift的泛型类型,但它没有正确地推断实体类型.我已经明确尝试过:
fetchedResultsController = NSFetchedResultsController<NasaPicture>(fetchRequest: request, managedObjectContext: moc, sectionNameKeyPath: nil, cacheName: nil)
Run Code Online (Sandbox Code Playgroud)
也没有运气.
谢谢!
这是示例代码:
//Called by VC:
HICircleView *circleView = [[HICircleView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
// init of circle view
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
CAShapeLayer *borderLayer = [CAShapeLayer layer];
borderLayer.fillColor = [UIColor whiteColor].CGColor;
borderLayer.path = [UIBezierPath bezierPathWithOvalInRect:self.frame].CGPath;
borderLayer.strokeColor = [[UIColor redColor] CGColor];
borderLayer.lineWidth = 5;
[self.layer addSublayer:borderLayer];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)

好的,谢谢你的回答.转移我:
CGRect rect = CGRectMake(3, 3, self.frame.size.width, self.frame.size.height);
borderLayer.path = [UIBezierPath bezierPathWithOvalInRect:rect].CGPath;
Run Code Online (Sandbox Code Playgroud)
并且制作了6个线宽.
我正在尝试使用游标浏览用户的推特朋友.由于你一次得到20个以及下一个光标,我想也许递归是处理这个问题的最佳方法.但是,我相信因为我使用的是完成处理程序块,所以它无法正常工作.我一直只得到两页朋友(40),然后又回来了.
- (void)fetchTwitterFriendsForCrush:(Crush*)crush
fromCursor:(NSString*)cursor
usingManagedObjectContext:(NSManagedObjectContext*)moc
withSender:(id) sender
usingCompletionHandler:(void(^)())completionHandler
{
// twitter returns "0" when there are no more pages to receive
if (([cursor isEqualToString:@"0"]) || (cursor == nil)) {
completionHandler();
return;
}
NSString *urlString =
[NSString stringWithFormat:@"https://api.twitter.com/1.1/friends/list.json?cursor%@skip_status=1", cursor];
NSURL *requestURL = [NSURL URLWithString:urlString];
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodGET
URL:requestURL
parameters:nil];
request.account = self.twitterAccount;
[request performRequestWithHandler:
^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
if (error) {
NSLog(@"Error getting twitter friends = %@", error);
}
if (responseData) {
NSError *jsonError;
NSString …Run Code Online (Sandbox Code Playgroud) 我的单元格都有不同的高度,由用户输入的文本决定.
无论最后一个细胞采取什么高度,似乎确定(改变)所有剩余空白细胞的高度.
似乎没有为这些剩余的空单元调用heightForRowAtIndexPath,CFRAIP也不会.
有谁知道如何解决这个或为什么会发生这种情况?
我在swift中为我的模型对象创建了NSManagedObject子类.
通常我的模式是创建一个对象的实例,然后在其上设置属性,然后保存.
新对象具有设置为nil的属性.但它们不是可选项.我认为这是不允许的?
很多时候我需要检查值,但如果我尝试类似的东西:
如果(managedObject.property == nil)我崩溃了.
ios ×6
core-data ×2
objective-c ×2
swift ×2
recursion ×1
twitter ×1
uitableview ×1
xcode ×1
xcode8 ×1
xcode9 ×1