我,是造成我想不通這是該類別的.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'
有什麼想法?快把我逼瘋。
您是否將UIView + Genie.h文件導入到viewcontroller中? – 2013-05-10 20:13:38
雅我想通了,當我將文件添加到我的項目它沒有添加到目標 – JeffN 2013-05-10 20:14:56