は私がのUITableViewControllerを持っていると私はそうのようなviewDidLoadMethod
にいくつかのプロパティを設定します。UITableViewが漏洩していますか?
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self.parentViewController.parentViewController action:@selector(dismissSettings)] autorelease];
[self setTitle:@"Gabbai Settings"];
//Set up the table
[self.tableView initWithFrame:self.tableView.frame style:UITableViewStyleGrouped];
[self.tableView setRowHeight:65.0];
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLineEtched];
[self.tableView.backgroundView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@_settings", kTheme] ofType:@"png"]]]];
}
アプリはUIScrollViewControllerとUIButtonを示しています。ボタンが押されると、アプリケーションはモーダルUINavigationControllerを表示し、UINavigationControllerにはUITableViewControllerが表示されます。
なぜなら、リークは、私がUITableViewControllerを表示するときにいくつかのリークを報告します。しかし、私が//Set up the table
の後の4行をコメントアウトすると、すべてが問題ありません。 4行はコメントを外しているとき
、リーク機器は次のことを示しています
私はここで何が起こっているかわからないんだけど、それは本当に迷惑なんです。私はUITableViewControllerをカスタマイズする前に同じ4行のコードを使用しました。これは新しい動作です。
何が間違っている可能性がありますか?
どのようにしてテーブルビューのスタイルを変更できますか? – Moshe
'UITableView'が作成されたときにテーブルスタイルを変更することはできません。 NIBとInterface Builderを使用していますか?その後、スタイルを変更することができます。それ以外の場合は、 'loadView'や' initWithStyle: 'を使って' UITableViewController'を作成しているときに行うことができます。 –
これを削除することで問題は解決しました。 – Moshe