In AppDelegate I check if user session list then move to user home(display two buttons) else to login page. Form login page after login sending to user home.

LoginView is `UIViewController`
UserHome is `UIViewController`

When I click "Get Report " on UserHome I want to display some report in table
ReportView is `UITableViewController`

Here is the application code

**AppDelegate**

```
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    let mainStoryboard:UIStoryboard = UIStoryboard (name: "Main", bundle: nil)

    let isUserLoggedIn:Bool = NSUserDefaults.standardUserDefaults().boolForKey("isUserLoggedIn")

    if(!isUserLoggedIn){
        let loginVC = mainStoryboard.instantiateViewControllerWithIdentifier("loginvc") as!  LoginVC

        window!.rootViewController = loginVC

        window!.makeKeyAndVisible();

    }else{

let userhome = mainStoryboard.instantiateViewControllerWithIdentifier("userhome") as!  UserHomeViewController

            window!.rootViewController = userhome
            window!.makeKeyAndVisible();

 }

    return true
}

```

**LoginView**

After succes response from rest service 

```
let userhome = self.storyboard?.instantiateViewControllerWithIdentifier("user home") as! UserHomeViewController
                    dispatch_async(dispatch_get_main_queue()) {
                        self.presentViewController(userhome, animated: true, completion: nil)
                    }

```

**On Get Report I have**

```
@IBAction func getReport(sender: UIButton) {

    let reportview = self.storyboard?.instantiateViewControllerWithIdentifier("reportvc") as! ReportViewController

    //Excepetion
    self.presentViewController(reportview, animated: true, completion: nil)

    //nothing happens
    //self.navigationController?.presentViewController(reportview, animated: true, completion: nil)
}

```

**ReportViewCOntroller is just has noting. Base methods implemented**

```
class FSMSOListTableViewController: UITableViewController {

var soList = [String]()

override func viewDidLoad() {
    super.viewDidLoad()

    soList = ["E7677","E7678","E7679","E7680"]

    self.tableView.registerClass(UITableView.self, forCellReuseIdentifier: "cell")

        }

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

// MARK: - Table view data source

override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 1
}

override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return soList.count

}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier(
        "cell",
        forIndexPath: indexPath) //make the cell

    cell.textLabel?.text = self.soList[indexPath.row]

    return cell
}

```

**Exception is** 

> 
> 2016-04-09 12:26:19.415 AkunaConnect[13163:943688] **\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'must pass a class of kind UITableViewCell'
>  \*** First throw call stack:
>  (
>  0 CoreFoundation 0x0000000102cf9e65 **exceptionPreprocess + 165
>  1 libobjc.A.dylib 0x0000000104a39deb objc\_exception\_throw + 48
>  2 CoreFoundation 0x0000000102cf9d9d +[NSException raise:format:] + 205
>  3 UIKit 0x0000000103662b01 -[UITableView registerClass:forCellReuseIdentifier:] + 285
>  4 AkunaConnect 0x0000000102ad783f \_TFC12AkunaConnect28FSMSOListTableViewController11viewDidLoadfS0\_FT\_T\_ + 623
>  5 AkunaConnect 0x0000000102ad78f2 \_TToFC12AkunaConnect28FSMSOListTableViewController11viewDidLoadfS0\_FT\_T\_ + 34
>  6 UIKit 0x00000001036acf98 -[UIViewController loadViewIfRequired] + 1198
>  7 UIKit 0x00000001036ad2e7 -[UIViewController view] + 27
>  8 UIKit 0x0000000103e57f87 -[\_UIFullscreenPresentationController \_setPresentedViewController:] + 87
>  9 UIKit 0x000000010367cf62 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 133
>  10 UIKit 0x00000001036bfc8c -[UIViewController \_presentViewController:withAnimationController:completion:] + 4002
>  11 UIKit 0x00000001036c2f2c -[UIViewController \_performCoordinatedPresentOrDismiss:animated:] + 489
>  12 UIKit 0x00000001036c2a3b -[UIViewController presentViewController:animated:completion:] + 179
>  13 AkunaConnect 0x0000000102ad688d \_TFC12AkunaConnect17FLMViewController9getReportfS0\_FCSo8UIButtonT\_ + 621
>  14 AkunaConnect 0x0000000102ad69ea \_TToFC12AkunaConnect17FLMViewController9getReportfS0\_FCSo8UIButtonT\_ + 58
>  15 UIKit 0x0000000103518194 -[UIApplication sendAction:to:from:forEvent:] + 92
>  16 UIKit 0x00000001036876fc -[UIControl sendAction:to:forEvent:] + 67
>  17 UIKit 0x00000001036879c8 -[UIControl \_sendActionsForEvents:withEvent:] + 311
>  18 UIKit 0x0000000103686af8 -[UIControl touchesEnded:withEvent:] + 601
>  19 UIKit 0x000000010358749b -[UIWindow \_sendTouchesForEvent:] + 835
>  20 UIKit 0x00000001035881d0 -[UIWindow sendEvent:] + 865
>  21 UIKit 0x0000000103536b66 -[UIApplication sendEvent:] + 263
>  22 UIKit 0x0000000103510d97 \_UIApplicationHandleEventQueue + 6844
>  23 CoreFoundation 0x0000000102c25a31 \_\_CFRUNLOOP\_IS\_CALLING\_OUT\_TO\_A\_SOURCE0\_PERFORM\_FUNCTION** + 17
>  24 CoreFoundation 0x0000000102c1b95c \_\_CFRunLoopDoSources0 + 556
>  25 CoreFoundation 0x0000000102c1ae13 \_\_CFRunLoopRun + 867
>  26 CoreFoundation 0x0000000102c1a828 CFRunLoopRunSpecific + 488
>  27 GraphicsServices 0x000000010730fad2 GSEventRunModal + 161
>  28 UIKit 0x0000000103516610 UIApplicationMain + 171
>  29 AkunaConnect 0x0000000102ad96cd main + 109
>  30 libdyld.dylib 0x000000010554292d start + 1
>  31 ??? 0x0000000000000001 0x0 + 1
>  )
>  libc++abi.dylib: terminating with uncaught exception of type NSException
>  (lldb) 
> 
> 
>