0

我有一个导致错误的 UIView 类别,我无法确定这是该类别的 .h:

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, BCRectEdge) {
    BCRectEdgeTop    = 0,
    BCRectEdgeLeft   = 1,
    BCRectEdgeBottom = 2,
    BCRectEdgeRight  = 3
};

@interface UIView (Genie)

/*
 * After the animation has completed the view's transform will be changed to match the destination's rect, i.e.
 * view's transform (and thus the frame) will change, however the bounds and center will *not* change.
 */

- (void)genieInTransitionWithDuration:(NSTimeInterval)duration
                      destinationRect:(CGRect)destRect
                      destinationEdge:(BCRectEdge)destEdge
                           completion:(void (^)())completion;



/*
 * After the animation has completed the view's transform will be changed to CGAffineTransformIdentity.
 */

- (void)genieOutTransitionWithDuration:(NSTimeInterval)duration
                             startRect:(CGRect)startRect
                             startEdge:(BCRectEdge)startEdge
                            completion:(void (^)())completion;

@end

然后我将它导入视图控制器。创建一个新的 UIView 并使用其中一种方法。它在我开始输入时建议使用此方法,如果我定义它,它会出现在正确的位置。但是当我运行它时,它说:

'-[UIView genieInTransitionWithDuration:destinationRect:destinationEdge:completion:]: unrecognized selector sent to instance 0x1552c220'

有什么想法吗?快把我逼疯了。

4

1 回答 1

0

由于某种原因,扩展名在创建时没有添加到目标中。添加它解决了这个问题。

于 2013-05-10T20:16:03.707 回答