ios create sqlite db and xcdatamodel - sqlite

I wish use nsmanagedobject to use a sqlite database into my project..
I downloaded CoreDataBooks sample but there's something that I don't understand right...
for example... where is the link between the tables and xcdatamodel?
i tried to change the sqlitedb with my db and change xcdatamodel but doesn't work
can you help me?
thanks

Hmm, the way it works is this:
Create a data model in the editor in xcode.
Tell xcode to generate classes to represent the data model.
Write your app, adding in the setup code for core data to instantiate a Managed Object Context, etc.
Add the code to create and save data model objects to the managed context.
some time later ...
Modify the model in xcode's editor to represent changes to you app.
Regenerate associated model classes.
From your description it sounds like you are trying to edit the database directly and manage the classes that represent it yourself. I suspect this is possible, but using xcode's tools is easier and everything its taken care of for you.
Does that help?

Related

Using external SQLite database with SwiftUI

I am writing a SwiftUI app that needs to read an external SQLite database. I just need to open the database, query the database, copy values into an array and close the database. Then I need to load the text from one variable in the array to the buttons in a view. I am using the SQLite.swift library but I'm not sure how to do it.
I don't have any code yet but I have loaded the SQLite.swift package and just need to write my DatabaseHelper class and then run it when the View is opened. If anyone can help please reply! :)
Bear in mind that I haven't actually done this, but will have to in the near future. You are going to have to accept the fact that you need to take baby steps and throw out half your work, perhaps multiple times, until you get a satisfactory solution.
I would start by opening your db outside swiftui, probably in the app delegate class. Then stick all your values into the environment object and attach that to your content view
let contentView = ContentView().environmentObject(your_stuff_here)
Down in Swiftui you can extract the details from the environment object and add them to your button.
That should at least get you going.

Can I do data visualization with Drupal?

Basically i want it to import data from a SQL database and Display it as graphs. Having said that i also want it to be dynamic,responsive as in the users should have filtering options. Any leads would be definitely helpful.
Please note that i am just a beginner with drupal.
Yes, But I recommend you to work on your own framework. Or even you can use some data visualization framework
Maybe this one is useful for you if you want to do it on your own:
http://www.sitepoint.com/twelve-javascript-libraries-data-visualization/
Why do you need Drupal for that?
I would make some PHP script which would read SQL and generate image out of that data, by using GD or ImageMagic lib. I guess you know that PHP can shoot out image file header and dynamically generate image, on fly. That PHP script could also read filter parameters to have influence on generated image.

How do I create a Treemap and depict it through flex?

So basically what I'm trying to do is make something like this:
http://store.kapit.biz/demo/treemap/prod/index.html#
I've searched long and hard to find a site that would show me some pseudocode (at least) or an algorithm as to how to implement this type of application. But everything I find are only applications that take in data and do all the work for me to create the graph. I need to actually create it for myself, just a simple one for now. Does anyone know where I can find this? What I want it to do is take data from a database and use it to create the treemap, then express it in a GUI like in the link above. If any specifics are needed I can provide it. I'm trying to do this in Flash Builder using Flex and using ColdFusion as the backend. Thanks!
Check this out
Axiis is a open source library based on Degrafa that enables you to make complex data visualizations.
Cheers

ASP.NET UI Generation

I'm Looking for some samples (will be better if they are open source) that enabling Programmer to Generate UI from Database.
I want to review them for the framework that i want to develop for myself.
Already i reviewed ASP.NET Dynamic Data and Nettiers.
Also i welcome your suggestions , tips , comments.
Have a look at a project I'm about to release, CodeGenerator. There is a sample project which illustrates how you can use CodeGenerator to quickly generate an entire administrative site. Have a look and let me know your thoughts.
BTW, this is just a small example of what CodeGenerator can do.
While perhaps not directly what you may want, have a look at Entity Framework Code First to let the code drive the DB model and it works well with existing databases.
Then with MVC you could use MVCScaffolding to generate your views but in this case it uses the Models not the DB directly.
It's a slightly different way than you might be looking for but it is still worth a look to help you as you look at this.

Core Data Pre-populated SQLite issue, z-metadata

I have this issue with Core Data. I am creating a core-data-based application, for one of the tabs, to populate a UITableViewController. Basically, I have read somewhere that there is an issue with providing a pre-populated sqllite file to be used to load up the data. I created a pre-populated data file and at first had issues with Z_METADATA and other anomalies like that. If we are creating our own sqllite file, is there somethign we have to include, such as certain table names etc?
Note, I didnt create teh application with use core data for storage ticked at beginning, so im not sure if that makes a difference.
Doron, take a look and A Blog On Tech for a really great example of how to get what you are trying to do. Basically it's best to let Xcode create the base SQLite DB for you, copy it to your code directory, pre-populate your data there and then finally add it to the project through Xcode.
So while it is possible to work a Core Data application that you haven't created from the beginning in Xcode it is much easier to start from there.

Resources