Hi all,
I'm trying to add a subview to my current view as I have done before but I think it's causing a SIGABRT. Is there anyway I can trap what is actually causing this error?
My code is as follows:
Code:
- (void)tableView:(UITableView *)tableView
accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
// Loads the specified .xib file as designed earlier.
if (contactEdit == nil)
{
ContactEdit *contactsE = [[ContactEdit alloc] init];
contactsE.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
self.contactEdit = contactsE;
[contactsE release];
}
[self.view addSubview:self.contactEdit.view];
}
The ContactEdit class is as follows:
Code:
#import <UIKit/UIKit.h>
@class EditableField;
@interface ContactEdit : UIViewController
{
UITableView *table;
}
@property (nonatomic, retain) IBOutlet UITableView *table;
@end
And the view class I am trying to add it to is as follows:
Code:
#import <UIKit/UIKit.h>
#import <AddressBook/AddressBook.h>
#import <AddressBookUI/AddressBookUI.h>
@class ContactData;
@class ContactEdit;
#define kTableViewRowHeight 66
@interface ContactsList : UIViewController
<UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate>
{
}
The ContactList class is created, displayed and functions fine. The issue only comes when I try and add the subview to it within the AccessoryButtonTapped function.
Any help is much appreciated.
Kind Regards,
Slayer.