小编Geo*_*sda的帖子

在交换机中未处理枚举值'NSFetchedResultsChangeMove'和NSFetchedResultsChangeUpdate'

我收到此警告:在交换机中未处理枚举值'NSFetchedResultsChangeMove'和NSFetchedResultsChangeUpdate'

有任何想法吗?

- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type {
    switch(type) {
        case NSFetchedResultsChangeInsert:
            [self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
            break;

        case NSFetchedResultsChangeDelete:
            [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
            break;
    }
}

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
    [self.tableView endUpdates];
}
Run Code Online (Sandbox Code Playgroud)

提前致谢

xcode uitableview ios

4
推荐指数
2
解决办法
3397
查看次数

带有drawAtPoint的多行文字(wordwrap)?

有没有办法用drawAtPoint绘制多行文字?我试过UILineBreakModeWordWrap但似乎没有工作?

你如何将此代码转换为工作的多行文本?

point = CGPointMake(boundsX, 50);
[self.heading drawAtPoint:point forWidth:labelWidth withFont:mainFont minFontSize:12.0 actualFontSize:NULL lineBreakMode:UILineBreakModeWordWrap baselineAdjustment:UIBaselineAdjustmentAlignBaselines];
Run Code Online (Sandbox Code Playgroud)

谢谢!

iphone sdk word-wrap cgpoint ios4

3
推荐指数
1
解决办法
2801
查看次数

带有swift的布尔值

这真令人困惑.有没有人有任何想法?

let viewHasMovedToRight == false //initially I want this to be false
Run Code Online (Sandbox Code Playgroud)

然后

func moveViewToRight(sender: UIButton!) {
        if viewHasMovedToRight == false {               
            viewHasMovedToRight == true;

            UIView.animateWithDuration(
                0.75,
                animations: {},
                completion: { (value: Bool) in
                     println(" moved")                     
                }
            )
        }                
        else {                
            viewHasMovedToRight == false;             
            UIView.animateWithDuration(
                0.75,
                animations:{},
                completion:{ (value: Bool) in                     
                    println("not moved")                       
                }
            )
        }

       // println("move view")
    }
Run Code Online (Sandbox Code Playgroud)

只有第一个if叫.我无法将值重新分配给true ...

Obj-C现在用swift这么容易的东西是如此令人沮丧......

ios swift

3
推荐指数
2
解决办法
3万
查看次数

UIButton textLabel有不同的字体

有没有办法在textLabel中使用两种不同字体大小的UIButton?原生?

我不想让UILabel在上面.

uibutton ios

3
推荐指数
2
解决办法
1584
查看次数

在swift中创建一个UIColor数组

为什么这会给我一个错误?

 var colorArray = [UIColor.self]

colorArray.append(UIColor.redColor()) //error here
colorArray.removeLast() 
Run Code Online (Sandbox Code Playgroud)

如何定义要存储的可变数组UIColor

nsmutablearray uicolor ios swift2

1
推荐指数
1
解决办法
5558
查看次数

在ovalInRect 中的起点

有没有办法将起点从ovalInRect 形式的“右”更改为“左”?似乎无论我如何创建它,“起点”总是在“右侧......

 let ovalPath = UIBezierPath(ovalInRect: CGRect(x: 515, y: 276.5, width: 280.5, height: 214.5))
        let ovalShapeLayer = CAShapeLayer()
        ovalShapeLayer.fillColor = UIColor.clearColor().CGColor
        ovalShapeLayer.strokeColor = UIColor.lightGrayColor().CGColor
        ovalShapeLayer.lineWidth = 1.5
        ovalShapeLayer.path = ovalPath.CGPath

        self.view.layer.insertSublayer(ovalShapeLayer, atIndex: 1)
Run Code Online (Sandbox Code Playgroud)

谢谢

ios uibezierpath swift2

1
推荐指数
1
解决办法
424
查看次数