message display in console window but not display in uitextview when i run the program what the problem in that.
-(void)getSmsData
{
array = [[NSMutableArray alloc] init];
NSArray *docPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentDir = [docPaths objectAtIndex:0];
self.databasePath = [documentDir stringByAppendingPathComponent:@"SMS.sqlite"];
FMDatabase *database = [FMDatabase databaseWithPath:self.databasePath];
[database setLogsErrors:TRUE];
[database open];
NSString *anQuery = [[NSString alloc]initWithFormat:@"SELECT * FROM SMSnJokes where
Id=%@",self.Id ];
FMResultSet *results = [database executeQuery:anQuery];
while([results next])
{
SmsTitle *title=[[SmsTitle alloc]init];
title.Id = [results stringForColumn:@"Id"];
title.Data=[results stringForColumn:@"Data"];
title.CategoryId = [results stringForColumn:@"CategoryId"];
title.Title = [results stringForColumn:@"Title"];
[array addObject:title];
NSLog(@"SMS LIST %@",title.Data);
}
[database close];
}
-(void)getSmsdisplay
{
smsdisplay=[[UITextView alloc]init];
for (SmsTitle *title in array)
{
NSString *tempStr = title.Data;
smsdisplay.text=tempStr;
smsdisplay.editable = NO;
[smsdisplay setTextColor:[UIColor blackColor]];
smsdisplay.font = [UIFont systemFontOfSize:15];
}
[self.view addSubview:smsdisplay];
}
message display in console window but not display in uitextview when i run the program what the problem in that.