私はiPhone用の簡単なシグネチャキャプチャアプリケーションを作成するためのノブです。iPhoneアプリケーションでゾンビオブジェクトを特定できない
アプリケーションは、ユーザーが配信されたテーブルビューにナビゲートできるようにします。次に、彼らは現在配信している配信をクリックします。
テーブルビューを読み込もうとするとエラーEXC_BAD_ACCESS
が表示されるので、ゾンビ診断装置を実行して問題が見つかるかどうかを確認してください。私はゾンビのエラーを受け取りましたが、 "責任者"の誰も私が書いたコードを参照していません。
これまで私のアプリの基本的な流れは、3つのボタンがあるビューがあり、そのうちの1つがテーブルビューにつながり、それを使用するとクラッシュします。
このビュースイッチ用のコードである:
-(IBAction) deliveriesButtonClicked:(id)sender {
if (self.deliveriesViewer == nil) {
DeliveriesViewerController *aOptionController = [[DeliveriesViewerController alloc] initWithNibName: @"DeliveriesViewerController" bundle: nil];
self.deliveriesViewer = aOptionController;
[aOptionController release];
}
[self.mainNavigationController.view removeFromSuperview];
[self.view insertSubview:self.deliveriesViewer.view atIndex:0];
}
これは、それが
ヘッダに切り替えていることを出荷クラスのコードである:
#import <UIKit/UIKit.h>
@interface DeliveriesViewerController : UITableViewController <UITableViewDelegate> {
IBOutlet UITableView *myTable;
}
@property (nonatomic, retain) UITableView *myTable;
@end
実装:
#import "DeliveriesViewerController.h"
#import "AppDelegate.h"
@implementation DeliveriesViewerController
@synthesize myTable;
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)viewDidUnload {
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
return appDelegate.invoices.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
}
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
cell.text = [appDelegate.invoices objectAtIndex:indexPath.row];
return cell;
}
@end
もし誰かが私にこの問題を見つけるのを助けることができたら、それは非常に感謝します。
deliveryiesViewerがretainプロパティとして設定されていますか? – Daniel
はい、保持するように設定されています。 – AquaCash5
請求書の配列を作成するコードを投稿してください –