小编Jor*_*mos的帖子

当App处于后台模式时,UILocalNotification可以触发自定义方法吗?

好吧标题是自我解释.我想创建一个App,可以在App处于后台模式时管理编程的本地通知.通知工作顺利但我想在触发警报时触发自定义方法.

可能吗?谢谢.

iphone notifications objective-c

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

UICollectionView需要很长时间才能刷新数据

这对你们所有人来说都是挑战......

我有一个UICollectionView内部我的UIViewController女巫正确加载.我也有一个定制UICollectionViewCell类女巫包含一个UIButton.

NSArray从我的服务器检索一些UIImage对象,以便将一个背景图像分配给我的自定义按钮UICollectionViewCell.

这是我的cellForItemAtIndexPath功能代码:

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
{
    UserPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"userPhotoCell" forIndexPath:indexPath];

    if (indexPath.section == 0) {
        [[cell imageButton] setBackgroundImage:[userPublicImages objectAtIndex:indexPath.row] forState:UIControlStateNormal];
    } else {
        [[cell imageButton] setBackgroundImage:[userPrivateImages objectAtIndex:indexPath.row] forState:UIControlStateNormal];
    }

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

你可以看到很简单.

这有一个奇怪的行为:如果我把我的所有习惯都UICollectionViewCell放在其中的一个部分UICollectionView,那么性能还可以......

有任何想法吗?

一些额外的信息:UICollectionView有标题.自定义标题.这只是一个UIView机智UILabel.

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    UICollectionReusableView *reusableView …
Run Code Online (Sandbox Code Playgroud)

reloaddata ios uicollectionview

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