我想在xcode中创建一个应用程序。我做了一个名为myApp.m
和.h
xcode与IBAction
类在我.m
我的代码
- (void)loadApp
AlarmItem *item1 = [[[AlarmItem alloc] initWithTitle:@"TEST2"] autorelease];
NSMutableArray *items = [NSMutableArray arrayWithObjects:item1, nil];
RootViewController *rootController = (RootViewController *) [navigationController.viewControllers objectAtIndex:0];
rootController.items = items;
,并在我的RootViewController的这些行我有这个方法:
- (IBAction)RefreshMyApp:(id)sender {
MyApp *myApp2 = [[[MyAppalloc] init] autorelease];
[myApp2 loadData];
}
我是什么试图做的是从myApp类调用该方法并显示在tableView中,但我总是得到一个空单元格。
任何帮助表示赞赏。
myApp只是无效的方法,我可以称它加载。 – user993074
我需要的是从该方法重新加载数据,以便它可以显示在我的单元格中。 – user993074
您的写作如下:MyApp * myApp2 = [[[MyApp alloc] init] autorelease]; MyApp子类是什么类? – jbat100