我是 iPhone 开发的新手。请帮我
我有一个视图控制器NSObject
在后台调用视图控制器的方法,当该方法调用时,我正在创建一个视图,我self.view addSubview:view
在这一行之后编写了它们,我的视图再次加载调用。
我不知道为什么会出现这个问题,请帮助我这里是我的代码。
NSObject.m
- (void) showModalMessage:(NSString *)mes
{
self = [super init];
if (self) {
objViewController = [[ViewController alloc] init];
}
[objViewController showPopUp:mes];
}
ViewController.m
- (void) showPopUp:(NSString *)mes
{
labelView = [[UIView alloc] initWithFrame:CGRectMake(470, 740, 380, 50)];
[self setLabelViewSettings];
label = [[UILabel alloc] initWithFrame:CGRectMake(20, 8, 340, 30)];
[self setLabelSettings];
[labelView addSubview:label];
[label release];
[self.view addSubview:labelView];// After This line View did load calls again
[labelView release];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.6];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(hide)];
[UIView commitAnimations];
}
对不起,我的英语不好,请帮助我