小编Sub*_*ash的帖子

用于节标题的UICollectionReusableView无法正常工作

我为UICollecton视图节标题创建了一个UICollectionReusuable视图.我使用以下代码实现头视图.

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
ThemeHeader *headerView = [[ThemeHeader alloc] init];
headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader
                                                                 withReuseIdentifier:@"header"
                                                                        forIndexPath:indexPath];
NSString *title = @"Title for the header";
headerView.title.text = title;
return headerView;
Run Code Online (Sandbox Code Playgroud)

}

它崩溃了,给我以下错误:

- [UICollectionReusableView title]:无法识别的选择器发送到实例0xac846a0'

我的ThemeHeader类看起来像这样

@interface ThemeHeader : UICollectionReusableView
@property (strong, nonatomic) IBOutlet UILabel *title;

@end
Run Code Online (Sandbox Code Playgroud)

我提前感谢您的帮助.

objective-c ios uicollectionview uicollectionreusableview

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

UITableView setSeparatorInset无法正常工作

我试图在UITableView中为分隔符设置自定义插件.这是我的viewDidLoad代码

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView registerClass:[ChatTableCell class] forCellReuseIdentifier:@"ChatCell"];
    [self.tableView setSeparatorInset:UIEdgeInsetsMake(0, 65, 0, 0)];
}
Run Code Online (Sandbox Code Playgroud)

单元格分隔符插图无法正常工作,如图所示.它适用于某些细胞而不适用于其他细胞.我在这做错了什么?

这是我的viewcontroller.m文件的样子

#import "ChatListViewController.h"

@interface ChatListViewController ()

@end

@implementation ChatListViewController

- (id)initWithStyle:(UITableViewStyle)style {
    //self = [super initWithStyle:style];
    self = [super initWithStyle:UITableViewStylePlain];
    if (self) {
        self.parseClassName = kChatRoomClassKey;
        self.paginationEnabled = YES;
        self.pullToRefreshEnabled = YES;
        self.objectsPerPage = 25;
        //[self.tableView setSeparatorInset:UIEdgeInsetsMake(0, 65, 0, 0)];
    }
    return self;
}

- (PFQuery *)queryForTable {

    if (![PFUser currentUser]) {
        PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
        [query setLimit:0];
        return query;
    }

    PFQuery …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios ios7 pfquery

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

如何清除PFFIle缓存(Parse.com)

我有一个应用程序,可以从解析中下载并显示大量图像.几乎每分钟都会将图像添加到数据库中.由于PFFile自动缓存没有过期日期,即使我只需要显示最近的图像,旧的图像仍然保留在缓存中,因此占用了大量的存储空间.因此,该应用程序在我的iPhone上占用大约5GB的存储空间.我一直在对这个问题进行大量的研究,发现Parse没有用于清理PFFile Cache的公共API,也不允许在缓存文件上设置过期日期.有没有解决方法,我可以手动删除旧的缓存数据?

先感谢您.

caching ios parse-platform nscache pffile

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