私は、ページングコントロール付きのスクロールビューを持っています。配列に応じて複数のページが読み込まれ、各ページにはテーブルビューがあります。"メッセージが割り当て解除されたインスタンスに送信されました" - 保持する方法が見つかりません。
for(id name in categories) {
NSLog(@"Loading Page.%i",i);
NSLog(@"categories count:%i",[categories count]);
TasksPageViewController *tasks = [[TasksPageViewController alloc] init] ;
tasks = [self.storyboard instantiateViewControllerWithIdentifier:@"TasksPageViewController"];
CGRect frame = scrollView.frame;
frame.origin.x = frame.size.width * i;
frame.origin.y = 0;
tasks.view.frame = frame;
[tasks populateWithData:(i-1) categoryName:name];
[self.scrollView addSubview:tasks.view];
i++;
}
.hファイルがある:のUITableViewはしかし
*** -[TasksPageViewController tableView:numberOfRowsInSection:]: message sent to deallocated instance 0x68efac0
を返して
#import <UIKit/UIKit.h>
#import "MainPageViewController.h"
#import "TasksPageViewController.h"
@interface ViewController : UIViewController{
UIScrollView *scrollView;
IBOutlet UIPageControl *pageControl;
// To be used when scrolls originate from the UIPageControl
BOOL pageControlUsed;
}
@property (nonatomic, strong) IBOutlet UIScrollView *scrollView;
@property (nonatomic, strong) IBOutlet UIPageControl *pageControl;
- (void)scrollViewDidScroll:(UIScrollView *)scrollView;
- (IBAction)changePage;
@end
(もともとはEXEC_BAD_ACCESS
だったが、NSZombiesEnabledでこれを得た)
私はどのように進むかわからない、私はインク私はtasks
を保持する必要がありますがどのように?
それは単なるテストだったが、もともとは[instantiateViewControllerWithIdentifier self.storyboard:「TasksPageViewController」@] = 'TasksPageViewController *作業でした。十分な' – jturolla
は、公正、私は本当に絵コンテそれほど使用していない私は、主に好奇心 – wattson12
のおかげでした出来た。私は変更可能な配列を作成し、すべての 'tasks'をその中に追加しました。 – jturolla