小编Stu*_*ntX的帖子

"在仅变换层中更改属性masksToBounds,将在Xcode 7中无效"

当我在iPad Xcode 7 beta 6上启动我的应用程序时,我在调试器控制台中收到此警告.在Xcode 6之前没有这样的警告.我不明白为什么它可能会来,也只是在iPad上.

根据Apple论坛帖子,它可能是Apple方面的一个错误.有人找到了解决方案吗?

ios ios9 xcode7-beta6

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

链接TTTAttributedLabel的点击颜色

我在我的项目中使用TTTAttributedLabel.我已经设法通过修改链接属性来更改我创建的任何链接的默认颜色和下划线.

NSArray *pKeys = [[NSArray alloc] initWithObjects:(id)kCTForegroundColorAttributeName,
                      (id)kCTUnderlineStyleAttributeName
                     , nil];

NSArray *pObjects = [[NSArray alloc] initWithObjects:pAlertColor,[NSNumber numberWithInt:
                                                                             kCTUnderlineStyleNone], nil];

NSDictionary *pLinkAttributes = [[NSDictionary alloc] initWithObjects:pObjects
                                                                  forKeys:pKeys];

self.alertMessage.linkAttributes = pLinkAttributes;
self.alertMessage.activeLinkAttributes = pLinkAttributes;
Run Code Online (Sandbox Code Playgroud)

但是,我注意到当我点击链接时,它会随着任何其他链接在点击时的瞬间变为红色.我需要改变这种颜色.有关如何做到这一点的任何线索?

objective-c ios tttattributedlabel

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

弹出视图控制器时更改导航栏颜色

我有三个视图控制器.在第一个视图控制器(FirstVC)中,导航栏的条纹色调为clearColor,条形本身是半透明的.当我点击某些内容时,我会推送到导航栏需要不透明的SecondVC.所以我将barTintColor设置为某个颜色值,并将isTranslucent设置为false.当我从SecondVC推送到ThirdVC时,导航栏又需要是半透明的.当我弹出ThirdVC并返回SecondVC时会出现问题.导航栏在一秒钟内显示为透明,然后根据需要变为不透明.我无法理解延迟的原因.

viewWillAppear()SecondVC 调用以下方法.我试过从viewWillDisappear()ThirdVC 做同样的事情,但没有效果.

fileprivate func configureNavigationBar(){

        self.navigationController?.navigationBar.setBackgroundImage(nil, for: UIBarMetrics.default)
        self.navigationController?.navigationBar.shadowImage = nil
        self.navigationController?.navigationBar.isTranslucent = false
        self.navigationController?.navigationBar.barTintColor = Style.Movie.primaryBackgroundColor
        let titleDict: NSDictionary = [NSForegroundColorAttributeName: UIColor.white]
        self.navigationController?.navigationBar.titleTextAttributes = titleDict as? [String:Any]
    }
Run Code Online (Sandbox Code Playgroud)

如果我向后滑动而不是点击后退按钮,它工作正常.

uinavigationbar ios swift

17
推荐指数
2
解决办法
5233
查看次数

尝试从应用程序Xcode下载容器时发生错误

在iPhone上运行我的应用程序时,我需要查看数据库内容.所以我在Xcode中选择了设备并选择了我的设备.此后,我选择了我的应用程序,然后单击"设置"按钮,其中显示3个选项:显示容器,下载容器和删除容器.单击"下载容器"选项时,系统会询问我要将容器存储在何处.选择位置后,我收到以下错误:尝试从应用程序"MyApp"下载容器时发生错误.....

在选择"显示容器"选项时,将打开一个列表,但其中没有文件.

我使用Xcode运行的其他应用也会出现同样的问题.

关于为什么会发生这种情况以及如何解决问题的任何想法?

xcode

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

条形上方的标签不显示水平条 ios-charts

我正在我的项目中为水平条形图实施 ios-charts。我需要各个条形的值出现在条形上方(因为图表是水平的,标签应该出现在条形的右侧)。但是,我无法使其工作。代码如下:

func setupHorizontalChartView() {

        self.chartView.chartDescription?.enabled = false
        chartView.dragEnabled = false
        chartView.setScaleEnabled(true)
        chartView.pinchZoomEnabled = false

        let chartXAxis = chartView.xAxis
        chartXAxis.labelPosition = .bottom

        let chartLeftAxis = chartView.leftAxis
        chartLeftAxis.labelFont = NSUIFont(name: "Helvetica", size: 12)!
        chartLeftAxis.labelTextColor = UIColor.darkGray

        chartView.rightAxis.enabled = false

        chartView.drawValueAboveBarEnabled = true

        let formatter = BarChartFormatter()
        formatter.setValues(values: self.months)

        chartView.xAxis.valueFormatter = formatter
        chartView.xAxis.setLabelCount(self.months.count - 1, force: false)

        chartView.xAxis.drawGridLinesEnabled = false
        chartView.leftAxis.drawGridLinesEnabled = false

        chartView.xAxis.drawAxisLineEnabled = false
        chartView.leftAxis.drawAxisLineEnabled = false

        chartView.leftAxis.drawLabelsEnabled = false
    }

    func setChart(dataPoints: [String], values: [Double]) {

        var dataEntries: [BarChartDataEntry] …
Run Code Online (Sandbox Code Playgroud)

ios ios-charts

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

cellForRowAtIndexPath中对象的潜在泄漏

我收到以下代码的上述违规行为:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"Cell";

    UITableViewCell *cell = [tableView   dequeueReusableCellWithIdentifier:simpleTableIdentifier];

    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier];
    }



        cell.textLabel.text = [mapContacts objectAtIndex:indexPath.row];
    NSLog(@"%@",cell.textLabel.text);
    cell.detailTextLabel.text = [number objectAtIndex:indexPath.row];



        return cell;


}
Run Code Online (Sandbox Code Playgroud)

违规行为显示return cell;可以采取哪些措施来解决这个问题?请帮忙.我正在使用带有ARC的XCode 4.5.

objective-c ios automatic-ref-counting xcode4.5

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