【发布时间】:2014-03-11 09:11:06
【问题描述】:
我不知道我的错误在哪里......我已经在我的应用程序的其他视图控制器中使用了(!)这些代码行并且它有效。我已经设置了断点,如果正确执行并调用了 [warning show],但什么也没做!这是我的 viewWillAppear 方法中的第一行(在 [super viewWillAppear... 之后)。
if([self.category isDeleted] || ![((AppDelegate *)[[UIApplication sharedApplication] delegate]).managedObjectContext existingObjectWithID:self.category.objectID error:NULL]){
UIAlertView *warning = [[UIAlertView alloc]initWithTitle:NSLocalizedString(@"CategoryDeletedError", nil) message:NSLocalizedString(@"CategoryDeletedErrorExplanation", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Ok", nil) otherButtonTitles:nil, nil];
[warning show];
NSLog(@"%@",warning);
}
NSLog 打印出这个:
2014-03-11 10:08:08.133 App[752:70b] <UIAlertView: 0x8a8bb20; frame = (0 0; 0 0); opaque = NO; layer = <CALayer: 0x8aa2d60>>
所以创建了对象..但是为什么它不起作用?我的视图控制器也是正确的 UIAlertViewDelegate...
【问题讨论】:
标签: ios objective-c uialertview