views:

219

answers:

3

My application has the data models a little bit complicated. I need to debug a fetch request with different predicates.

Is there any fast way to see different results for different predicates? I am tired with changing only one predicate and I have to start again my navigation application with nearly 10 steps before.

An example of these predicates that I would like to see the results:

item = %@
item = %@ AND quantity = %@
item = %@ OR (startdate >= %@ AND enddate <= %@)
etc...

As using Core Data, I can not see the database with its' values to do some SELECTs.

A: 

I'm not sure if it is any help, but if you want to quickly see the return results, go into gcc command line and write

po <name of array with results>

so if the array is items

po items

Will give all the returned results printed nicely in the console

Ron Srebro
but I can not dynamically change the Predicate to test the new one, right?
sfa
Not as far as I know. You can however build the manipulation in your app, say using a text field to enter the predicate format string.
Ron Srebro
+3  A: 

You can add logic in your code to change the predicate and fetch again (maybe add a temporary button to trigger this and cycle through your various predicates).

You may also be interested in viewing the data in your SQLite file. Check out this answer to How view data stored in Core Data?

gerry3
oops, these are two commercial products :D Thanks anyway for your suggestions ;)
sfa
Can I assume that you will be giving all of the software that you develop away for free?
gerry3
What I mean is you have to convince your boss to spend the money to buy a commercial product.
sfa
A: 

To view your data inside of SQLite for free, just get FireFox. Then install SQLite Manager.

Cheers.

-RoLYroLLs

http://iphone.rolyrolls.com

RoLYroLLs