小编zbM*_*Max的帖子

在后台重新加载UITableView的数据

在我的应用程序中,我有一个UITableViewController.

它的tableView分为3个部分.

我从我的服务器下载每个部分的数据.为此,我有3个函数(例如f1 f2和f3).每个都更新一个相应的NSArray,用作我的表的数据源.

现在我想要的是使用这个函数重新加载数据,并在完成这3个功能后刷新我的tableView,但不会打扰用户.

我没有使用异步请求,块,线程等...而且我正在寻找提示.

实际上,这就是我所做的:

-(void)viewDidLoad
{
    //some settings

    [NSTimer scheduledTimerWithTimeInterval:15.0 target:self selector:@selector(reloadDatas) userInfo:nil repeats:YES];

    dispatch_queue_t queue = dispatch_get_main_queue();
    dispatch_async(queue, ^{
        [self reloadDatas];
    });
}

-(void)reloadDatas
{
    dispatch_queue_t concurrentQueue = dispatch_get_main_queue();
    dispatch_async(concurrentQueue, ^{
        [self f1];
        [self f2];
        [self f3];
        [myDisplayedTable reloadData];
    });
}

-(void)f1
{
    //load datas with a url request and update array1
}
-(void)f2
{
    //load datas with a url request and update array2
}
-(void)f3
{
    //load datas with a url request and update array3 …
Run Code Online (Sandbox Code Playgroud)

asynchronous uitableview ios

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

Xcode错误:构建时没有这样的文件或目录

我读过类似的帖子,但无法找到问题的解决方案.

当我开始我的项目时,我首先将其保存在名称中有空格的文件夹中(让我们将其命名为"我的项目")
让我们简化通过我的项目的路径作为一个简单的文件夹:"我的路径"(是的,有层次结构中的空格).

我曾经在构建我的项目时遇到问题,特别是在Build设置中的Library搜索路径,经常返回xcode更新或/和项目重复以保存历史记录.

为了解决这个问题,我用下划线替换了所有空格.所以现在我的项目的文件夹名称是"My_Project"和路径"My_path".这些更改也已在我的项目的"构建设置"中执行.

但今天,我有一个错误,我无法摆脱.
当我构建我的项目时,每个文件编译都很完美,但在"复制"过程中,我遇到了这种错误.

/!\Copy AFNetworking ...in /Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder

CpResource /Users/admin/Desktop/My_path/My\ Project/Product-name/Sub\ Folder/AFNetworking /Users/admin/Library/Developer/Xcode/DerivedData/Product-name-gkplyeugxcxhijajdvpxutaodxmz/Build/Products/Release-iphoneos/Product-name.app/AFNetworking
cd /Users/admin/Desktop/My_path/My_Project/Product-name
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/admin/Desktop/My_path/My\ Project/Product-name/Sub\ Folder/AFNetworking /Users/admin/Library/Developer/Xcode/DerivedData/Product-name-gkplyeugxcxhijajdvpxutaodxmz/Build/Products/Release-iphoneos/Product-name.app
-------------------------------------
error: /Users/admin/Desktop/My_path/My Project/Product-name/Sub Folder/AFNetworking: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我没有在我的目标的构建设置中找到空格未被下划线替换的任何字段.

任何帮助赞赏.

(我正在使用Xcode 7.2,OS X El Capitan 10.11.2)

xcode build ios

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

在UIBarButtonItem中添加边框

在我的应用程序中,我在界面构建器中设计了一个视图.
此视图有一个工具栏,其中包含一些UIBarButtonItem.

我的按钮可以是自定义图像,或默认按钮,如共享,添加,...
现在使用iOS7,按钮不再有边框.所以我想补充一些. 在此输入图像描述

这是我想要做的:在我的屏幕截图上添加像白线一样的边框.我试过的是在工具栏中添加一个UIButton.在我的例子中,我设置了我的后退按钮大小(12x44).我将此按钮添加为视图控制器的IBOutlet属性,并尝试为其绘制边框:

CALayer *cancelBorder = [CALayer layer];
[cancelBorder setFrame:CGRectMake(12, 0, 1, 44)];
[backBorder setBackgroundColor:[[UIColor whiteColor] CGColor]];
[backButton.layer addSublayer:cancelBorder];
Run Code Online (Sandbox Code Playgroud)

但它不起作用.有人有解决方案吗?

uitoolbar uibarbuttonitem ios ios7

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