简体   繁体   English

***由于未捕获的异常'NSInvalidArgumentException'而终止应用,

[英]*** Terminating app due to uncaught exception 'NSInvalidArgumentException',

i am newbie to iOS and i want to implement a splash screen and load the data from database then transmit to another view controller to display data in a UITableView here is my code 我是iOS新手,我想实现一个启动画面并从数据库加载数据,然后传输到另一个视图控制器,在UITableView显示数据这里是我的代码

#import "SplashViewController.h"
#import "DataLoader.h"
#import "UISessionTable.h"
@interface SplashViewController ()  

@end
@implementation SplashViewController

@synthesize sessionsDataFromDatabase;





-(void) viewDidLoad{
    [super viewDidLoad];

   double  currentTime = [[NSDate date] timeIntervalSince1970];

    dispatch_queue_t downloadQueue = dispatch_queue_create("session data loader", NULL);
    dispatch_async(downloadQueue, ^{
        //code to load session into array

        self.sessionsDataFromDatabase = [DataLoader getSessions]; 
        dispatch_async(dispatch_get_main_queue(), ^{




            double differance = 5000.0 - ([[NSDate date] timeIntervalSince1970] - currentTime) ;


            differance = differance<0? 0:differance;

            [[NSTimer scheduledTimerWithTimeInterval: differance target:self
                                                              selector: @selector(pushToSessionTableViewController:) userInfo: nil repeats: NO]fire];

                    });
    });
    dispatch_release(downloadQueue);


}
-(void) viewDidUnload{
    [super viewDidUnload];
    self.sessionsDataFromDatabase = nil;
}
-(void) pushToSessionTableViewController{


    UISessionTable * obj = [[UISessionTable alloc]init ];

    [obj setSessionsData:self.sessionsDataFromDatabase];


    [self.navigationController pushViewController:obj animated:YES];



}
@end

i got the following error when run 运行时出现以下错误

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 
'-[SplashViewController pushToSessionTableViewController:]: unrecognized selector sent 
to instance 0x6e45740'

any suggestion ??? 任何建议???

The colon at the end is for methods that receive parameters, yours doesn't receive anything. 最后的冒号用于接收参数的方法,您的方法不会收到任何参数。 That's why it can't find the method (it assumes it is another undeclared method). 这就是为什么它找不到方法(它假设它是另一种未声明的方法)。

Replace 更换

pushToSessionTableViewController:

with

pushToSessionTableViewController

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “因未捕获的异常而终止应用程序&#39;NSInvalidArgumentException&#39;” - “Terminating app due to uncaught exception 'NSInvalidArgumentException'” 由于未捕获的异常&#39;NSInvalidArgumentException 4而终止应用程序 - Terminating app due to uncaught exception 'NSInvalidArgumentException 4 由于未捕获而终止应用程序 &gt; 异常“NSInvalidArgumentException” - Terminating app due to uncaught > exception 'NSInvalidArgumentException' 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,NSUserDefaults? - Terminating app due to uncaught exception 'NSInvalidArgumentException', NSUserDefaults? 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序, - Terminating app due to uncaught exception 'NSInvalidArgumentException', 由于未捕获的异常NSInvalidArgumentException而终止应用程序 - Terminating app due to uncaught exception NSInvalidArgumentException 由于SDWEbImage中未捕获的异常&#39;NSInvalidArgumentException&#39;而终止应用 - Terminating app due to uncaught exception 'NSInvalidArgumentException' in SDWEbImage 是否由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序? - Terminating app due to uncaught exception 'NSInvalidArgumentException'? 由于未捕获的异常&#39;NSInvalidArgumentException&#39;错误而终止应用程序 - Terminating app due to uncaught exception 'NSInvalidArgumentException' error iOS - 由于未捕获的异常&#39;NSInvalidArgumentException&#39;而终止应用程序 - iOS - Terminating app due to uncaught exception 'NSInvalidArgumentException'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM