我解決它,謝謝反正:
#import "UIAlertTableView.h"
@implementation UIAlertTableView
@synthesize tableSelected,fontSize;
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
c=0;
table = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
table.delegate=self;
table.dataSource=self;
[self addSubview:table];
}
return self;
}
- (void)setFrame:(CGRect)rect {
if (c==0)
c++;
else if(c==1){
if([tableSelected isEqualToString:@"categorie"])
array=[NSArray arrayWithObjects:@"Capitalizzazione semplice",@"Capitalizzazione composta",@"Pagamenti rateali",@"Bond", nil];
else if([tableSelected isEqualToString:@"tassi"])
array=[NSArray arrayWithObjects:
@"Tasso effettivo annuo",
@"Tasso effettivo mensile",
@"Tasso effettivo bimestrale",
@"Tasso effettivo trimestrale",
@"Tasso effettivo quadrimestrale",
@"Tasso effettivo semestrale",
@"Tasso nominale convertibile mensilmente",
@"Tasso nominale convertibile bimestralmente",
@"Tasso nominale convertibile trimestralmente",
@"Tasso nominale convertibile quadrimestralmente",
@"Tasso nominale convertibile semestralmente",
nil];
else if([tableSelected isEqualToString:@"rate"])
array=[NSArray arrayWithObjects:
@"Rata annuale",
@"Rata mensile",
@"Rata bimestrale",
@"Rata trimestrale",
@"Rata quadrimestrale",
@"Rata semestrale",
nil];
[table reloadData];
[table selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];
c++;
}
[super setFrame:CGRectMake(0, 0, rect.size.width, 300)];
self.center = CGPointMake(320/2, 480/2);
}
我沒有看到你的調用UIAlertView在該代碼中 - 只有數組的創建... – bryanmac
你想傳遞的警報視圖中的按摩字符串(這就是我們所做的),是的,你可以通過那很容易。 – rptwsthi
你期待警報視圖如何處理這個數組? – jrturton