Hello, I am very new to mac cocoa applications. I currently work on iOS programming. So i was interested in cocoa applications also. I followed few tutorials and got a core-data based cocoa application built. Its very simple. Add records to table view and removing them. Now i have started to compare .net application to cocoa application..is it right?i built C# applications in the past in my school. I used to get .exe files in those applications. I can use the .exe file on any of my PCs. I used archive to create an application to test now. So i saved it on my desktop. Now i open the application and work with it..add records, remove records. When i close the application, it asks me to save it in binary,sqlite or xml. How can i close the application to save it like a .exe file. Basically not to ask user to save..more questions coming. Thanks

@jared_kipe.Thanks. So is there a way i can build a cocoa application exactly like an .exe file with resources like you said. Like an application where i enter username, password. It connects to a web service. Validates those credentials and returns me true/false. I want to take that application and put it on my friends mac and he can put his credentials and check. But no saving option when we close the application. Very simple one. I must say again i am very new to cocoa.

@jared_kipe.Thanks. So is there a way i can build a cocoa application exactly like an .exe file with resources like you said. Like an application where i enter username, password. It connects to a web service. Validates those credentials and returns me true/false. I want to take that application and put it on my friends mac and he can put his credentials and check. But no saving option when we close the application. Very simple one. I must say again i am very new to cocoa.

Turn off core data and document-based application and you'll be able to make a simple program without asking you to save when exiting.

@jared_kipe.Thanks. So is there a way i can build a cocoa application exactly like an .exe file with resources like you said. Like an application where i enter username, password. It connects to a web service. Validates those credentials and returns me true/false. I want to take that application and put it on my friends mac and he can put his credentials and check. But no saving option when we close the application. Very simple one. I must say again i am very new to cocoa.

You don't understand, every time you build a Cocoa application you are building the 'like .exe with resources like I said'.

What is happening is that you made an application like TextEdit. You go into it, mess around, and low and behold, the application wants to save your progress.

If you want an application without any of that, start over with a pure view based applications, throw some IBOutlet text fields up there with a button to process the results. When you build it you can take that, zip it up and put it on your friends computer no problem.

If you want an application without any of that, start over with a pure view based applications, throw some IBOutlet text fields up there with a button to process the results. When you build it you can take that, zip it up and put it on your friends computer no problem

I followed like you said.Doing that will build me a iPad/iPhone application. I dont want an iOS application. A mac/cocoa app that one logs in and gets connected to a web service. A stand alone application.
Forgive me for this non-mac terminology.

@jared_kipe.I was also trying to do more on a core data cocoa app (TestApp) that i built. I made an archive->application and saved the file to my desktop. I had saved some data in that application. Saved it in binary info called "PlayerInfo". I launched the app on my desktop. I went to File->Open Recent and choose the binary info file "PlayerInfo". It open another instance of my app TestApp and showed the file info there. So coming back to one my earlier questions, when i double click and open the application can it retrieve the file info automatically?

I followed like you said.Doing that will build me a iPad/iPhone application. I dont want an iOS application. A mac/cocoa app that one logs in and gets connected to a web service. A stand alone application.
Forgive me for this non-mac terminology.

Sorry, I guess I just mean OSX->Cocoa Application, then don't check off 'Use Core Data'. This will give you a basic view based application.

----------

Quote:

Originally Posted by RookieAppler

@jared_kipe.I was also trying to do more on a core data cocoa app (TestApp) that i built. I made an archive->application and saved the file to my desktop. I had saved some data in that application. Saved it in binary info called "PlayerInfo". I launched the app on my desktop. I went to File->Open Recent and choose the binary info file "PlayerInfo". It open another instance of my app TestApp and showed the file info there. So coming back to one my earlier questions, when i double click and open the application can it retrieve the file info automatically?

There are a lot of ways to answer this. You could use a NSUserDefaults to save all of your data. You could use NSUserDefaults to store the last file saved. You could use NSBundle to save/load your data automatically inside your application bundle...

Sorry, I guess I just mean OSX->Cocoa Application, then don't check off 'Use Core Data'. This will give you a basic view based application.

Don't check off? Should i or should i not check the checkmark.? So in one of my iOS app, i check login for an employee. Then save the employee entity in core data. Next time if my app is launched i bring the saved values and use those values to check login. I tried to that here in cocoa, but it was not possible. I used managedobjectcontext to save like i did in core data in iOS application

So i parse an xml and save the values to an array "loginResultArray". I retrieve the same empID if it exists, but tmpArray is always 0. Then i save it using self.moc. I see the message "Save Successful".So whats happening to my data?

Don't check off? Should i or should i not check the checkmark.? So in one of my iOS app, i check login for an employee. Then save the employee entity in core data. Next time if my app is launched i bring the saved values and use those values to check login. I tried to that here in cocoa, but it was not possible. I used managedobjectcontext to save like i did in core data in iOS application

So i parse an xml and save the values to an array "loginResultArray". I retrieve the same empID if it exists, but tmpArray is always 0. Then i save it using self.moc. I see the message "Save Successful".So whats happening to my data?

A lot about this doesn't look particularly right (and wouldn't compile in its current state). At this point, I honestly don't know if/why you want to use Core Data. How much data you are storing, and where/how it is being store in CD.

Yes i want to use CD. Further down in the process of this application, i want to retrieve customer data from web service and store it in CD . Like a complete employee table with 5/6 fields. Customer table with 8/9 fields. So they could be 10000 records. So i will very much use CD in storing and fetching. This is a simple start up. Hope you get my point. Thanks.

Yes i want to use CD. Further down in the process of this application, i want to retrieve customer data from web service and store it in CD . Like a complete employee table with 5/6 fields. Customer table with 8/9 fields. So they could be 10000 records. So i will very much use CD in storing and fetching. This is a simple start up. Hope you get my point. Thanks.

If you want to continue using CD, then I already gave you a good solution. Use NSUserDefaults to store the path to where they saved their data. Then on launch of the application use it to load the data if that path is still valid.

This is how applications like iTunes and iPhoto know where to save/load their libraries. But if there isn't a library there it will prompt you to save a new one or load an old one.

Edit: Also sending the users password in plain text and as a url parameter is horribly insecure.

I dont know how the inManagedObjectContext got cut off here in my post..but in my code its like i wrote above.

Quote:

If you want to continue using CD, then I already gave you a good solution. Use NSUserDefaults to store the path to where they saved their data. Then on launch of the application use it to load the data if that path is still valid.

Can you give me an example. I used NSUserDefaults to store empid,asmx paths and stuff like that in settings bundle and a plist. But the actual core data was in sqlite DB. So its a little confusing.