【发布时间】:2011-10-29 04:38:41
【问题描述】:
我想知道是否有一种方法可以在不同于 initWithTitle 的 UIAlertView 的构造函数中传递参数。特别是我想传递一个 NSArray。是否可以? 这是代码:
@implementation UIAlertTableView
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
array=[NSArray arrayWithObjects:@"Capitaliz. semplice",@"Capitaliz. composta",@"Pagamenti rateali",@"Bond", nil];
table = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
table.delegate=self;
table.dataSource=self;
[self addSubview:table];
}
return self;
}
谢谢
【问题讨论】:
-
我没有在该代码中看到您对 UIAlertView 的调用 - 只有数组的创建...
-
你想在警报视图中传递一个按摩字符串(这就是我们所做的一切),是的,你可以轻松传递。
-
你希望警报视图如何处理这个数组?
-
你最终找到答案了吗?
标签: iphone objective-c ios ios4 iphone-sdk-3.0