0

I'm building a web application with the Cappuccino framework, and I'm using the new Xcode integration through the XcodeCapp-Cocoa listener. When I place an NSPredicateEditor into a nib file (like MainWindow.xib), and allow it to be converted into a cib (for Cappuccino), the predicate editor is empty, and all that remains is a border and background colour where the CPScrollView is. I have tried modifying the predicate row templates, but have had no luck... Any suggestions?

Xcode/Interface Builder NIB file

Cappuccino Application when run

Luke Fletcher
  • 348
  • 2
  • 12

3 Answers3

1

As stated in my comments on @Luke Fletcher's reply to the question, my first attempt to add [aPredicateEditor setObjectValue: aPredicate] to the code didn't work.

Here's why: I was calling it from within my initWithCib:bundle: method. It seems the settings you change on your CPPredicateEditor in this function are overwritten by the settings in your cib as entered in IB. To get around this, I moved the code to awakeFromCib and it worked fine.

However if you use bindings, the CPPredicate object you reference in the binding will automatically be updated by the CPPredicateEditor when making changes, while I had the problem this wasn't the case when using the setObjectValue: method. To retrieve my changes there, I had to collect the objectValue of the CPPredicateEditor object.

RDM
  • 4,986
  • 4
  • 34
  • 43
1

I discovered the answer. You actually need to give the CPPredicateEditor a predicate before it will show anything at all.

Luke Fletcher
  • 348
  • 2
  • 12
  • Im facing the same problem in a cappuccino project using the same xcodecapp setup and can't figure out how to give the CPPredicateEditor a predicate... I would expect it to work with data source methods but since it doesn't I'm kind of at a loss. Can you maybe post the part of your code where you pass a predicate to the editor? – RDM Apr 05 '12 at 09:54
  • [aPredicateEditor setObjectValue:aPredicate]; – Luke Fletcher Apr 19 '12 at 00:13
  • I did this but it didn't work. Connecting the CPPredicateEditor with a binding through IB did the trick though. Thanks anyway :) – RDM Apr 20 '12 at 07:08
  • I found out why it failed... going to make a post about it – RDM Apr 20 '12 at 12:13
0

I suggest posting the question to our mailing list. The guy who wrote that particular component frequents there, but I dont think monitors SO.

Alternatively you could do it all in code.

Me1000
  • 1,760
  • 1
  • 12
  • 14
  • I ended up figuring it out, but thanks @Me1000! Great job on your TimeTable app and CPTableView implementation btw! Exceptional work! – Luke Fletcher Dec 27 '11 at 09:14