小编mar*_*eli的帖子

UISwipeGestureRecognizerDirectionRight不在使用iOS 5.1的DetailViewController.m中工作

这是我的第一个问题,但是我在过去几个月里使用过这个网站(感谢所有人).

我的问题:我有一个i-Pad的拆分视图项目.在DetailViewController中,我使用了一个UIButton.这是DetailViewController.h中的一些代码:

@property (strong, nonatomic) IBOutlet UIButton *button;
- (void)swipeRightDetected:(UISwipeGestureRecognizer *)recognizer;
Run Code Online (Sandbox Code Playgroud)

DetailViewController.m中我只是这样做:

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self configureView];

    UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeRightDetected:)];
    swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
    [self.button addGestureRecognizer:swipeRight];
}

- (void)swipeRightDetected:(UISwipeGestureRecognizer *)recognizer
{

    if (recognizer.view == self.button) {
    NSLog(@"YEAH");
    }
}
Run Code Online (Sandbox Code Playgroud)

现在问题是:它与iOS 5.0.1和之前的版本完美配合.现在它不再起作用了.它适用于任何其他方向,但不适用于正确的方向,仅适用于DetailViewController !! 只有当你用力量和速度击中iPad时才会起作用(就像一记耳光!),同样适用于模拟器......只有你非常快速地进行滑动才有效!

我认为这是一个错误......我该怎么办?也许在苹果论坛上发布相同的问题?谢谢大家,你们都很棒!! 马尔科

ipad uisplitviewcontroller ios uiswipegesturerecognizer ios5.1

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

在一对多关系中使用AND建立NSPredicate

我是NSPredicate的新手所以如果有人会告诉我我是否正确的方式我会很感激..
问题:(类是NSManagedObject的子类)
我有一个这个字段的Player类:

@property (nonatomic, retain) NSSet *hisNumbers; //it's a set of Numbers
Run Code Online (Sandbox Code Playgroud)

数字类是这样的:

@property (nonatomic, retain) NSNumber * first;
@property (nonatomic, retain) NSNumber * second;
@property (nonatomic, retain) Season *forSeason; //it's one-to-one relationship with a Season Object
@property (nonatomic, retain) Player *owner; //one-to-one with Player
@property (nonatomic, retain) NSNumber * isPresent;
Run Code Online (Sandbox Code Playgroud)

赛季类已经得到了这些参数:

@property (nonatomic, retain) NSSet *seasonGames; //set of Game
@property (nonatomic, retain) NSSet *numbers; //set of Numbers (inverse of forSeason)
Run Code Online (Sandbox Code Playgroud)

我正在尝试做的是一种方法,它需要一个赛季 …

core-data objective-c subquery nspredicate ios

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