Eureka: TextRow & TextFloatLabelRow issue

Created on 11 Oct 2016  路  9Comments  路  Source: xmartlabs/Eureka

Hello,
When I click on TextRow or TextFloatLabelRow field I get this error

fatal error: unexpectedly found nil while unwrapping an Optional value

Even if I use $0.value = "a value" the app still crash when I click en textField row

  • Environment: Eureka 2.0.0 beta 1 ; Xcode 8 ; and iOS 9 and 10
    screen shot 2016-10-11 at 12 12 16
custom row FieldRow awaiting response 2.0.0-beta.1

Most helpful comment

When overriding viewWillAppear from MasterViewController you must call super implementation.
Seems you forgot to call it.

//
//  MasterViewController.swift
//  sample
//
//  Created by Ahmed K on 17/10/16.
//  Copyright 漏 2016 Prium. All rights reserved.
//

import UIKit
import Eureka

class MasterViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        print("didLoad MasterViewController")

        self.initForm()
    }

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

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated) // <<< ---ADD THIS LINE
        //
        self.tableView?.tableFooterView = UIView()

    }

    public func initForm() {
        LabelRow.defaultCellUpdate = { cell, row in cell.textLabel?.font = UIFont(name: "Helvetica", size: 15)! ; cell.height = { 50 }  }
        ButtonRow.defaultCellUpdate = { cell, row in cell.textLabel?.font = UIFont(name: "Helvetica", size: 15)!}
        print("initForm MasterviewController")
    }
}

All 9 comments

Stack trace please...
Which was the dependency manager used to integrate the library?

Cocoapods
pod 'Eureka', '~> 2.0.0-beta.1'

it's weird since the example project also contains these rows i couldn't make it crash.

I just created a cocoapods project from scrach and seems to work fine.

This is my podfile...

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'SimpleApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for SimpleApp
  pod 'Eureka', '~> 2.0.0-beta.1'
end

@chlebta Could you please upload a project having the issue so i can take a look...?

@mtnbarreto Even me, I can't repreduce the issue on sample project, also I can't push my project to public.

I've delete all pods and re-install but always same issue with textRows.
screen shot 2016-10-17 at 09 49 24 2

screen shot 2016-10-17 at 09 51 04 2

I've reproduced the issue :
sample.zip

After debugging I think it's subclassing issue, because if my class ViewController inherit directly from formViewController then it works fine but if inherit MasterViewController I get the crash

When overriding viewWillAppear from MasterViewController you must call super implementation.
Seems you forgot to call it.

//
//  MasterViewController.swift
//  sample
//
//  Created by Ahmed K on 17/10/16.
//  Copyright 漏 2016 Prium. All rights reserved.
//

import UIKit
import Eureka

class MasterViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        print("didLoad MasterViewController")

        self.initForm()
    }

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

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated) // <<< ---ADD THIS LINE
        //
        self.tableView?.tableFooterView = UIView()

    }

    public func initForm() {
        LabelRow.defaultCellUpdate = { cell, row in cell.textLabel?.font = UIFont(name: "Helvetica", size: 15)! ; cell.height = { 50 }  }
        ButtonRow.defaultCellUpdate = { cell, row in cell.textLabel?.font = UIFont(name: "Helvetica", size: 15)!}
        print("initForm MasterviewController")
    }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedwo picture sedwo  路  3Comments

jaylyerly picture jaylyerly  路  3Comments

iBearKh picture iBearKh  路  3Comments

pteasima picture pteasima  路  3Comments

JonathanImperato picture JonathanImperato  路  3Comments