2013-05-10 32 views
0

我,是造成我想不通这是该类别的.H错误一个UIView类别:UIView的范畴导致无法识别选择错误

#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' 

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

+1

您是否将UIView + Genie.h文件导入到viewcontroller中? – 2013-05-10 20:13:38

+0

雅我想通了,当我将文件添加到我的项目它没有添加到目标 – JeffN 2013-05-10 20:14:56

回答

0

扩展名在创建时出于某种原因未被添加到目标中。添加它解决了问题。

+0

请将您的答案标记为解决方案,以便此问题从未答复。 – giampaolo 2013-05-10 20:32:01

+0

我不能说2天 – JeffN 2013-05-10 22:56:20

相关问题