xcode - Error: Failed to connect outlet from ... to (NSTextField): missing setter or instance variable -


why code:

if note1math.stringvalue == "" {                  txtfilled = 0          }else{          txtfilled = 1      } 

give error?:

2015-06-18 20:20:17.633 office[41763:430750] failed connect (note1) outlet (office.viewcontroller) (nstextfield): missing setter or instance variable.
fatal error: unexpectedly found nil while unwrapping optional value (lldb)

this part of message:

2015-06-18 20:20:17.633 office[41763:430750] failed connect (note1) outlet (office.viewcontroller) (nstextfield): missing setter or instance variable.

does not come code. comes loading of nib or storyboard. presumably, had named outlet note1 @ 1 time, connected in nib or storyboard, , renamed note1math in code without fixing nib/storyboard.

then, later, when accessed note1math, nil (because not connected in nib/storyboard). caused second message:

fatal error: unexpectedly found nil while unwrapping optional value (lldb)

the solution go nib or storyboard, disconnect outlet old name, , reconnect outlet.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -