gpt4 book ai didi

ios - nib 对象在运行时不会改变

转载 作者:行者123 更新时间:2023-11-28 22:45:26 26 4
gpt4 key购买 nike

你好,我有一个包含 3 个 UIButtons 的 nib 文件,我需要在从 nib 加载后在运行时更改按钮的属性,但我不知道我做错了什么。更改 bool 值后我也有 NSlog,但我总是在输出中得到“0”。任何帮助谢谢

-(void)SettingBtnPressed:(id)sender
{

UIButton *btn =(UIButton*)sender;
UITableViewCell *btncell =(UITableViewCell *)[btn superview];

if ([[recentActivities objectAtIndex:btn.tag] isKindOfClass:[MeetingSummary class]]) {

[MainManager getSharedInstance].Summary = [recentActivities objectAtIndex:btn.tag];
MeetingSummary *ms=[recentActivities objectAtIndex:btn.tag];
Meeting *m=ms.meeting;


if(![popoverController isPopoverVisible]){
lastPoint = sender;
if (![m.endedDate isEqualToString:@"1/1/0001"]) {

if (settingpop) {
[settingpop release];
}
settingpop = [[SettingsPopViewController alloc] initWithNibName:@"SettingsPopViewController" bundle:nil];
settingpop.start.hidden=YES;
settingpop.start.enabled=NO;
NSLog(@"%i",settingpop.start.hidden);
NSLog(@"%i",settingpop.start.enabled);
settingpop.btnShowDetail.enabled=NO;
settingpop.btnShowDetail.hidden=YES;
// [settingpop.start removeFromSuperview];
// [settingpop.btnShowDetail removeFromSuperview];
settingpop.view.frame=CGRectMake(0, 0, 250, 54);

}
else
{

settingpop = [[SettingsPopViewController alloc] initWithNibName:@"SettingsPopViewController" bundle:nil];

}
settingpop.delegate = self;
[settingpop setActivityView:self.view];

popoverController = [[[UIPopoverController alloc] initWithContentViewController:settingpop] retain];

[popoverController setPopoverContentSize:CGSizeMake(250.0f, 162.0f)];

[popoverController presentPopoverFromRect:btn.frame inView:btncell
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}else{

[popoverController dismissPopoverAnimated:YES];
}
}
}

最佳答案

移动行:

settingpop.view.frame=CGRectMake(0, 0, 250, 54);

行前:

settingpop.start.hidden=YES;

关于ios - nib 对象在运行时不会改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13324156/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com