Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

OSX Buddy

macrumors newbie
Original poster
Mar 14, 2014
5
0
Hello! I am new to Xcode Coding. And i wonder, how to make an app like text edit where you go to the menubar and press: File/Save or Save as
And file/open or open recent.
And it would make a file with your own extension (the text edit one is .txt)
Then the app could open that
How would I make that?

P.S Remember the code tags ;)
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,560
6,059
I'd like to point out that .txt isn't a file format unique to TextEdit, but a common file format used by numerous text editting programs on numerous platforms, including but not limited to:
TextEdit
Notepad
Notepad++
gEdit
Sublime Text
TextWrangler
BBEdit

Also, numerous IDEs and Word Processors can open them, including Xcode and Word.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
I'd like to point out that .txt isn't a file format unique to TextEdit, but a common file format used by numerous text editting programs on numerous platforms, including but not limited to:

It's not a format at all actually, .txt just indicates that the file contains plain text what ever that means.
 

OSX Buddy

macrumors newbie
Original poster
Mar 14, 2014
5
0
I'd like to point out that .txt isn't a file format unique to TextEdit, but a common file format used by numerous text editting programs on numerous platforms, including but not limited to:
TextEdit
Notepad
Notepad++
gEdit
Sublime Text
TextWrangler
BBEdit

Also, numerous IDEs and Word Processors can open them, including Xcode and Word.

Yeah but on some apps, it just has another extension like in ibooks author, it has an extension of .iba

----------

I think one of us is in way over their head, but for a TextEdit-like application, how about downloading and/or taking a look at the TextEdit source code?

https://developer.apple.com/library/mac/samplecode/TextEdit/Introduction/Intro.html

I can't find the save and load script :confused:
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Yeah but on some apps, it just has another extension like in ibooks author, it has an extension of .iba

.iba is a proper file format, and also a proprietary Apple format. txt is no format at all, the file contains nothing but content, just pure text.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
I can't find the save and load script :confused:

Not sure what you mean by "script", but the various menu and document actions are typically connected to methods that use NSOpenPanel and NSSavePanel to specify files to use to, well, open and save. The actual reading from and writing to a file would depend on the particular application and whatever document or data types and encodings it is using.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,560
6,059
.iba is a proper file format, and also a proprietary Apple format. txt is no format at all, the file contains nothing but content, just pure text.

I'm not sure that your argument makes sense... How is a text file different from a binary, if not by the format?
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
I'm not sure that your argument makes sense... How is a text file different from a binary, if not by the format?

Binary data can also be stored without any file format, in a raw form. A file format is an agreed upon standard on how data is stored and laid out in the file.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Which makes it a file format, just a very simple one.

I disagree because there is no information about locale and character encoding, if you compare to some other text formats, say csv, at least there is an idea of layout, or a script file with a #! which could be regarded as a form of "header".
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,560
6,059
On another note, the original poster isn't asking how to make a file save on Xcode, but how to make a program which saves files.

To which I ask, in which language and with what frameworks?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.