How can I allow the user to style font in NSTextView using interface buttons in xcode? - objective-c

In short:
I am trying to find information about text styling inside an NSTextView. Bold, italics, indentation, making a word completely uppercase and setting backdrop colors to certain lines.
Any and all info is welcome. I've been looking around the web for docs on the subject and only managed to find a few things that seem to be part of an iphone framework. I'm sure there must be something out there and that I'm just searching for the wrong words.
A few details:
I am not a developer. I am a motion graphics artist and screenwriter. I do know html, php, javascript, css and several scripting languages (all very similar to javascript) used by different graphics apps.
I am not very proficient in objective-c but I've taken up writing a screenwriting app as a bit of a side project. I've been teaching myself objective-c from a book call Cocoa Programming for Mac OSX and using the code I've created from the examples in the book to create my app using Xcode. Styling text was not covered and I am at a loss as to how to approach it.
Screenplays have very specific formats. Using css I could create this format easily so my first thought was to find out if text inside a NSTextview can have css applied to it. I've not found anything that could answer this. Of course I am probably way off with this approach.
Again, any help or anyone who can point me in the right direction would be extremely appreciated.
Thanks!
-Omar

You can't do this because it only accept one style.
You have to deal with UIWebView Tutorial for this and use your CSS.
Or you can use some code like EGOTextView. I do not test this but I think it will be the easiest way for you.

Related

How to develop/create a GUI for a QuickLook plugin?

I saw lots of QuickLook plugins (like BetterZip Quick Look Generator) coming together with their nice and tidy interfaces...I tried to design the GUI of my own one using HTML and JQuery, but I don't think that it's a good solution (plus, on top of that, Xcode 5.1 doesn't allow you anymore to include or open files from other directories with the <src> attribute).
I'll never thank enough Jelle Vandebeeck for opening my mind with his beautiful and helpful post, but unfortunately there's nothing on the internet regarding this topic (I think that there might be something on The Big Nerd Ranch Guide, but it won't be out before October).
So, I was wondering if anybody of you:
OPTION A - Knows the title of a guide that can explain how to develop/create a GUI for my QuickLook plugin in a "didactic" way (like a text book, step-by-step);
OPTION B - Could write down in the answer a couple of code lines to insert a button and a text field with the usual "Hello World!".
I have a sub-question related to the main one: is it possible to keep the semi-transparent white/grey background colour that a QuickLook window (like the one that appears when you select -for example- an audio file) usually has?
Thank you so much in advance!
In terms of a guide, there's the QuickLook Programming Guide over in the documentation. It goes over the architecture of QuickLook and walks you through the various steps of building a QuickLook plugin, including one that returns rich HTML content.
Related to this are a couple of pieces of documentation on how to integrate QuickLook into your own app, but it sounds like you're more interested in the plugin aspect.

Animation/Transition-Creator for iOS/Objective-C?

Together with an illustrator I want to create some screens with lots of animations/transitions (moving sprites). I need the illustrator to do the animation. He knows how to use AfterEffects so best would be some kind of timeline-tool to create the transitions/scalings/alphas etc.
My question is now: Is there some kind of tool out there that could be used to create animations and then export the used parameters to objective-c to import it to xcode?
Thanx!
To my knowledge: No.
We spend some time a couple of months back trying to find something similar to Expression blend, just for iOS, but without luck.
If you however are planing to make your app for MacOS and not iOS you can take a look at quartz composer. For iOS you could also take a look at storyboard (here is a link to fairly good tutorial), but I'm afraid your needs will not be met by the features of storyboard.
I found Flash2Cocos2D and I think this is the best solution available right now.
Also promissing: cocosbuilder!

Text reading experience in iOS app

I want to implement a great text reading experience in my app, similar to "Pocket", that would look a lot like this:
Basically, I'd like to have control over the text font size and font family while loading local HTML files in a UIWebView.
Could anyone point me to the right direction? Are there any frameworks or libraries out there that provide the base for such experience?
Thanks in advance.
A simple answer is: don't. Instead load it into a UITextView. You can easily change the font size with it, as on HTML you would have to modify the file instead of calling 1 line of code.

Adding tables to UITextView, whats the best approach?

I have been looking into the supported features of UITextView and its accompanying library Core Text. Under MacOSX you have NSTextTable which allows you to add tables to your text only. Sadly enough, this class is not supported under iOS. Now my question is what is the best approach to support this under iOS?
Just want to make a simple table with five columns. If I understood it correctly I might be able to do something by creating custom attributes for NSAttributedString. Only I am not sure what the best approach is? The objective is that I can create a text document with one table which I can export to RTF. For the latter I would need to write my own RTF exporter class that shouldn't be a big problem. As the RTF format is quite well documented on the Internet. My major problem is how to get the table shown in my text view.
Or should I just go for a UIWebView instead?

Very confused by a binding issue between a Cocoa app and a Movie Loader patch in Quartz Composer

I've been programming for a while, but just recently decided to start developing for Mac OS X. I feel like I've come to grips with the basics of Objective-C and Cocoa development over the past week. I'm planning on making graphics apps, and as such am currently in the process of learning how to control Quartz compositions through a Cocoa app. I went through the tutorial that apple offers (with the Mac Engravings composition), and was able to create that just fine. In order to make sure that I truly understood what I learned, I decided to create my own composition and link it to a slightly more complicated Cocoa application.
Essentially, I have a composition that loads a movie or image through a Movie Loader patch, at which point it applies various filters to the frames before outputting it. In my Cocoa app, I've written code (or rather copied and pasted from other apple examples) that lets a user pick a file using an NSOpenPanel object. The filepath of the file they pick gets placed in a text-box that I placed in the app's window using Interface Builder. I binded the value of said text-box to the "Movie_Location" key in my composition, which is a published input in the Movie Loader patch that I'm using. However, no matter what I do, movies and images aren't loaded into this composition no matter what I try. The only thing that gets displayed is the default image that I have saved in that input from Quartz Composer (or nothing if I leave it blank before publishing).
I've added a Clear Color patch to the composition and binded that to a colorwell in my UI, and that successfully changes the color in my display, so I know that the composition and my Cocoa app are communicating. I've spent numerous hours at this point trying to figure out what's going on, and I've just about given up. Does the Movie Loader have any weird behaviors that I'm not aware of, or is there something obvious that I seem to be missing? I'd really appreciate any help or advice from anybody.
Thanks for reading through this...
Best,
Sami
There are two things I can think of as reasons why it is doing this:
The file path isn't formatted incorrectly. Try checking backslashes, colons, etc.
The box isn't updating the value. Try literally clicking in the text field and hitting enter.
That's all I can think of without seeing your quartz composition and/or code.
EDIT:
Check the other continuous box, in the general properties.
I figured this out yesterday. spudwaffle's second idea is what was going on. If I were to type a filepath in and hit enter, it would work just fine. I got this to work properly by just removing the bind and instead using the setValue:keyInPath: function that a patch controller offers. That said, is there some way to force a text-box to update? I remember seeing a "continuously update" or something like that button within the bind sub-menu in the inspector, but my code didn't work with that checked either.
Thanks to those of you that tried to help me! I really appreciate it.
Best,
Sami