Building a document based application in Xcode 5 [closed] - objective-c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to Xcode 5 and I want to create a document based application that loads my file (a basic text file with the extension .rt) into an NSTextView and allows me to save the contents of the NSTextView to the file
Is this the right way to set it up?:
Will I need to use the functions
-(NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError;
-(BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError;
3.Are there any basic tutorials that show how to do this in Xcode 5? Most of the tutorials that I have found show how to do this in 10.4<

That looks fine so far as it goes.
You'll need to provide some way to store and retrieve the document's data. -readFromData:of type:error: is one way, but there are also methods that read from a file wrapper or an URL that yo can implement instead.
I don't know of any off the top of my head, and questions seeking resources are generally off topic here. However, Apple's documentation is pretty solid. If you have trouble understanding how to do something, why not ask a question about how to solve that problem rather than searching for step-by-step instructions? Also, Xcode is just a development environment -- most of the information in tutorials written for Xcode 4 should be pretty easy to map to Xcode 5 if you understand what they're trying to accomplish rather than just following the pictures.

Related

Embed XCode(8) editor for Swift [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am creating an application which besides everything else must display Swift (and ObjectiveC) source code, with code highlighting, inspections, compiler warning and errors.
Is there a way to reuse the XCode functionality which does that? Any internal APIs which are stable enough?
Note that since XCode v8 there are no XCode plugins according to WWDC 2016.
Unfortunately, what you want doesn't exist — there are no system APIs (private or otherwise) that will let you embed Xcode functionality in the way that you want. However, you can take a look at tools like SourceKitten (a wrapper around the SourceKit service that does the syntax highlighting and semantic parsing for Xcode) to replicate some of that yourself.
Depending on what you're looking for and the type of IDE that you want to implement, there are embeddable versions of other editors (say, vim, via the embeddable frameworks that projects like vimr provide) which can provide syntax highlighting and some compilation, but then you're coupling yourself to those editors, how they work, and the features they provide.

Windows version of Mac App [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a Mac App that uses the NSKeyedArchiver to save persistent data and it all works fine, but thinking ahead ideally I would like to be able to create a windows version. The current App is all in objective-c using cocoa as I did not think of portability when I first started writing it. I would be happy to make a windows version from scratch but obviously the two need to share data. I am a complete beginner when it come to cross-platform apps. What should I do?
Thanks in advance.
You either need to find (or write) code/a library to read NSKeyedArchiver plists on Windows, or you need to release an update to your Mac app that converts the keyed archives to something more generic, like a JSON- or XML-based format.

Can a .m be exported from an iPhone app? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
We recently deleted a .m from an iphone app in XCODE under development. We have a few phones around the office running the app. Is there a way to recover the .m file from the phone or is it not possible from the compiled app?
It's not possible from the compiled App. The .m file is a source file and is never sent to the phone.
Indeed, you're not going to get the .m back. You can use something like otool to get the symbols exposed to the runtime (Objective-C being as reflective as it is) and the ARM assembly that comprises each individual method, from which you could in theory reconstruct something but it'll look nothing like your original code.

Making with Objective-C a database in which the user could add information to it [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'd want to create a growing database in which the user could add new info in this case different integers and I don't really know how. I've started a "Master Detail" application but when I add different elements to the table they to be mutable and different. So I want the code to do that.
Sounds like you really need to start with the basics; the introduction to Objective-C followed by intros to iOS or Mac OS X development. Work through the basics first.
Then grab yourself a guide to Core Data.
Would you mid giving me a tutorial or something to learn it
A bit broad of a question for StackOverflow. I'd suggest you start at either of the Getting Started guides specific to iOS development or Mac OS X development, as you fancy.
In terms of cars, your question would translate to "How do I add a turbocharger to my engine?". If you don't have a solid foundation in how to maintain and build cars, any answer someone might give will be impossible to understand.

AddMusic example Ipod library access [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to use the addmusic example that apple have created for the IPod library access and be able to play the music in MY application; I however dont know which files to copy and how to combine the two... can someone please tell me what to do?
I already have created a button in MY application which will then upon click do the same thing that the button in the AddMusic example does to open up the Mediapicker thing.
Any help will be greatly appreciated.
You don't need to copy any specific files from the example, just some of the functions.
To pick the music you use MPMediaPickerController , look at AddMusicOrShowMusic in MainViewController.m to see how to instantiate that and what delegate methods you need to implement.
The important class you need to use to play the music is MPMusicPlayerController. In MainViewController.m you'll see the methods you need to implement and how to use it, see - (IBAction) playOrPauseMusic: (id)sender { for example.
Essentially you'll take the media items returned by MPMediaPickerController and call setQueueWithItemCollection on the MPMediaPickerController to queue up the music. After that it's really just a case of calling play/pause/etc and updating your interface.
The code you need is all in there, you just need to pull out the right bits.