10

I am working on the ZBarReader and getting an error

Unknown class ZBarReaderView in Interface Builder file

[UIView setReaderDelegate:]: unrecognized selector sent to instance 0x6859f20

Please look at an attached image at here or below so that you can picture what I am doing so far :-

enter image description here

In the storyboard, I do have a view and its custom class is ZBarReadView. I also wire it with IBOutlet in header file. In m file, I do

viewReader.readerDelegate = self;

and the error is shown after right after that.

Can anybody please point out what I have screwed up....

Kanan Vora
  • 2,124
  • 1
  • 16
  • 26
tranvutuan
  • 6,089
  • 8
  • 47
  • 83
  • I have the exact same problem. Trying to solve it right now... – Morothar Apr 12 '12 at 18:11
  • I found a easier solution, you can find it here: http://stackoverflow.com/questions/12819779/cant-see-iboutlets-when-using-storyboard-with-zbarreaderview/13037464#13037464 – lolol Oct 23 '12 at 19:12

4 Answers4

34

I found the solution in a thread over here

You need to add the following code in your applicationDidLaunch in your AppDelegate:

// force view class to load so it may be referenced directly from NIB [ZBarReaderView class];

Should be running fine after that.

Morothar
  • 1,123
  • 9
  • 8
  • // force view class to load so it may be referenced directly from NIB [ZBarReaderView class]; it doesn't work for Xcode 4.4 any other solution? –  Aug 24 '12 at 20:34
1

you can also try to download 64bits ZbarSDK.

Ned
  • 1,378
  • 16
  • 28
0

It looks like you actually added a view in interface builder and tried to call it a ZbarReaderView for IB to hook up. Correct me if I'm wrong but in this instance I don't think Ib is going to know what you mean by ZBarReaderView.

I'm Also assuming you haven't actually implemented the delegate method in your .m file.

Kanan Vora
  • 2,124
  • 1
  • 16
  • 26
Michael
  • 1,241
  • 1
  • 13
  • 25
0

I think the solution should be to add -ObjC flag to "Other Linker Flags" section in your Build Settings. If you can't do this, e.g. you are using Parse Framework that doesn't allow you to set this flag, you will probably have to use the provided solution of Morothat: Set in your AppDelegate the following:

[YOURCLASSNAME class];
jomafer
  • 2,655
  • 1
  • 32
  • 47