Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iPhone中,如何以编程方式仅为一个UIButton使用BCGenieEffect?_Iphone_Ios_Objective C_Xcode_Uibutton - Fatal编程技术网

在iPhone中,如何以编程方式仅为一个UIButton使用BCGenieEffect?

在iPhone中,如何以编程方式仅为一个UIButton使用BCGenieEffect?,iphone,ios,objective-c,xcode,uibutton,Iphone,Ios,Objective C,Xcode,Uibutton,我想在我的应用程序中使用BCGenieEffect。我从github下载了演示示例。 在本例中,使用了xib,4个UIB按钮与xib一起使用。我想在没有xib的情况下使用这段代码,并且只针对一个按钮。我不想拖动我的视图,这就是为什么我要删除该代码 我有一个按钮: UIButton *Pop_Hidebtn = [[UIButton alloc]initWithFrame:CGRectMake(290, 5, 15, 15)]; Pop_Hidebtn.backgroundColor = [UI

我想在我的应用程序中使用BCGenieEffect。我从github下载了演示示例。

在本例中,使用了xib,4个UIB按钮与xib一起使用。我想在没有xib的情况下使用这段代码,并且只针对一个按钮。我不想拖动我的视图,这就是为什么我要删除该代码

我有一个按钮:

UIButton *Pop_Hidebtn = [[UIButton alloc]initWithFrame:CGRectMake(290, 5, 15, 15)];
Pop_Hidebtn.backgroundColor = [UIColor clearColor];
[Pop_Hidebtn setImage:[UIImage imageNamed:@"close.png"] forState:UIControlStateNormal];

Pop_Hidebtn.titleLabel.textColor = [UIColor blueColor];
[Pop_Hidebtn addTarget:self action:@selector(Hidden_pop:) forControlEvents:UIControlEventTouchUpInside];  
[popup_View addSubview:Pop_Hidebtn];


-(void)Hidden_pop:(UIButton *)sender{

[self genieToRect:sender.frame edge:BCRectEdgeBottom];
}


// I modified this and it says-> UIButton may not respond to enumerateobjectsusingblock


- (void) genieToRect: (CGRect)rect edge: (BCRectEdge) edge
{
NSTimeInterval duration = 3.0;

CGRect endRect = CGRectInset(rect, 5.0, 5.0);

[help_Button enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx, BOOL   *stop)     
{ 
help_Button.enabled = NO;
}];


if (self.viewIsIn) {

[popup_View_under2 genieOutTransitionWithDuration:duration startRect:endRect     startEdge:edge completion:^{
popup_View_under2.userInteractionEnabled = YES;

[help_Button enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx,  BOOL  *stop) {
help_Button.enabled = YES;

}];
}];
} else {
popup_View_under2.userInteractionEnabled = NO;
[popup_View_under2 genieInTransitionWithDuration:duration destinationRect:endRect   destinationEdge:edge completion:
^{
[help_Button enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx,  BOOL  *stop) {
button.enabled = YES;
}];}];
}
self.viewIsIn = ! self.viewIsIn;
}

如何解决此问题?

由于示例中只使用了一个按钮而不是四个按钮,因此不需要使用
帮助按钮上的
枚举对象,只需
帮助按钮.enabled=YES可以。

欢迎专家提供任何建议。