Hi all,
I'm absolutely stumped at this. My properly working application [on iOS<=3.1] was crashing on iOS4. When I tried debugging it, I saw it's crashing at this line:
EDIT: I tried changing the position of this statement and put some log statements to check and I could confirm that the application is crashing just at this line.
This is a part of my code:
//Various allocations here like
lblForAttachingPhoto = [[UILabel alloc]initWithFrame:CGRectMake(235, 105, 40, 20)];
lblForAttachingPhoto.backgroundColor = [UIColor grayColor];
[lblForAttachingPhoto setText:@"140"];
[lblForAttachingPhoto setTextAlignment:UITextAlignmentCenter];
btnAttachPhoto = [UIButton buttonWithType:UIButtonTypeCustom];
btnAttachPhoto.frame = CGRectMake(275, 105, 20, 20);
btnAttachPhoto.autoresizesSubviews = YES;
btnAttachPhoto.clipsToBounds = YES;
[btnAttachPhoto setImage:[UIImage imageNamed:@"arrow.jpg"] forState:UIControlStateNormal];
[btnAttachPhoto addTarget:self action:@selector(attachPhoto) forControlEvents:UIControlEventTouchUpInside];
viewForAttaching = [[UIView alloc]init];
viewForAttaching.frame = CGRectMake(5, -340, 310, 140);
for(NSInteger e=0;e<[_appDelegate.genericArray count];e++)
{
[genericArray addObject:[_appDelegate.genericArray objectAtIndex:e]];
}
for(NSInteger f=0; f< [_appDelegate.category_type count]; f++)
{
[category_type addObject:[_appDelegate.category_type objectAtIndex:f]];
}
txtVw = [[UITextView alloc]init]; //txtVw is a textview
But despite the position of the statement of textview allocation statement, it's making the app crash.
Console output:
Program received signal: “EXC_BAD_ACCESS”.
warning: check_safe_call: could not restore current frame
warning: Unable to restore previously selected frame.
Is it possible? I'm also implementing UITextViewDelegate protocol.
Can anybody please help?
Thanx in advance.