Make a video from an NSArray of NSImages - objective-c

I know this has been asked before, but the only answers I have found use UIImages. I need to make a 25 fps video from an NSArray of NSImages in Objective-C. Could somebody give me a link to the documentation dealing with this (if there is any), or tell me how I can do it?
NOTE: I will also need to know which frameworks to use if there is no documentation on this. And, before you ask, I have done lots of searches for the documentation.

You can do this with QTKit by creating a movie and adding images as frames. See the "Creating a Single Frame-Grabbing Application" section. Step 13 specifically demonstrates how to add an image (and have it last a specific duration in the movie ... should probably last more than a single frame for, say, stop-motion stuff).

Related

WatchKit: Video Duration

Is there a way to determine the duration of a video currently set to WKInterfaceInlineMovie? I need to implement a circular progress bar displaying a current progress.
I have a URL of the file initially downloaded from network. It plays well, but I haven't found any way to determine its length (actually, nor questions asking that which is strange).
Of course, I can ask the backend server to send this info, but I'd like to avoid such complications if possible.
OK, it seems I overcame the WKInterfaceInlineMovie API limitation by the help of AVFoundation and CoreMedia.
I create AVAsset object using a movie URL from a shared folder (AVAsset(url:)). Then I get CMTime duration from the AVAsset's duration property (which is a CMTime object).
Actually, I was very surprised to find out that it works. I'm still testing it, because it's too good to be true and I'm expecting to run across some pitfalls. I'll update the answer if anything else's found.

XCode RSS Feed Won't parse properly

I followed a tutorial (which I'll link at the bottom) that I got from an old StackOverflow answer to parse an RSS feed into a UITableView. The tutorial is a bit outdated, but only a few methods were deprecated, and I replaced them with (what I hope are) the appropriate newer methods. However, I'm running into some trouble, not with the replaced methods, but with the parser not starting the parsing process. There are some NSLogs sprinkled throughout to give clues as to what is going on, and my parser isn't calling parseDidStartDocument:, it's just running and returning the last two NSLogs ("All Done!" and "stories array has %d items"). If someone could take a look at the code and tell me why it's not parsing, I would be very grateful. If you need to see some of my code, just let me know which parts you'd like to see, and I'd be happy to edit it in.
http://gigaom.com/apple/tutorial-build-a-simple-rss-reader-for-iphone/
oooh that tutorial is way out of date - written in 2008!
Try this tutorial, written for iOS5 instead.

How to create documentation for instance variable and methods in Xcode?

I'd like to be able to Alt-Click an instance variable (or a method) as part of the program i created and read what it's purpose is.
The fact that Xcode is telling me the class variable is declared at - is nice but not enough. In this case i'd like to see custom text i typed to describe what an asset really is. Additionally type of the ivar would also be useful to know.
How can this be done? In this case, i wonder what exactly did i mean by assets
I specifically wonder if this information can be viewed from inside Xcode, similar to how Eclipse shows JavaDoc content.
You would need to create a documentation set for your project and install it in Xcode. appledoc can help you with this. This is a command-line tool that can generate documentation in Apple's style from specially formatted comments in your headers. You can also integrate this into your build process with a run script build phase, so that documentation is always up-to-date.
For small projects, it's usually not worth the effort though and you're probably better off just adding comments to your header files and jumping there with Cmd-click (Ctrl+Cmd+left-arrow to go back to where you came from).
You'll probably want to take a look at Apple's documentation on Documentation Sets as well as their article on generating doc sets using Doxygen. The latter is based on Xcode 3.x, so how relevant it is is somewhat questionable, but it'd be a good idea to take a look nonetheless.
That said, if you decide to use Doxygen (alternatives like HeaderDoc can be used for documentation, but I'm not sure what's available to you as far as creating doc sets goes), it looks like the main point is you'll want to throw GENERATE_DOCSET=YES into your Doxyfile (or whatever you decide to call it). After that, you'd just throw the results into ~/Library/Developer/Shared/Documentation/DocSets (according to Doxygen's documentation). I don't know whether this works in Xcode 4.x - it's worth a shot though, and it'd be nice to hear back on it.
Note: most of this was based on this answer by Barry Wark. Figure credit is due there, since I wouldn't have bothered looking into this were it not for his answer.

What is the best way to save/retrieve array in iOS PG

i have an array of results based on calculation of other arrays of texts entered by the user.
i want to save the array as user clicks on "save results" button.
So i want to know what is the best way to do this.....NSUserDefaults or Databsase, or PList or
and how to save the array by that way.
Actually i have to use NSUserDefaults for that according to my project need
Please help me..
Look into Core Data. It's performant, typically uses less memory than other options, gives you persistence for free.
There are lots of references on line that can help you get started. Try this article by Ray Wenderlich as a start:
http://www.raywenderlich.com/934/core-data-tutorial-getting-started
A Google search can give you many more.
I usually just write the array to file
using
[array writeToFile:myOutputFile atomically:YES];
Here is a reference link.
http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/20000137-BABCGEFF
you can also load them from file with
[array initWithContentsOfFile:myInputFile];
here is another reference link
http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/20000137-CBHBDFEE
just make sure that the output file is located in a writable location for your application.
Note
Normally a good starting point on an object is to get a brief overview of the functions for that object so you know what that object can accomplish.
Hope this helps.

iPhone Number Text To A Full Currency Equation [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Struggling with currency in Cocoa
Re-Apply currency formatting to a UITextField on a change event
I have been all over the web and either examples are no longer valid or people didn't really know what they were doing.
So i have come to you guys for help,
I need to get a a textbox(TextField) to Display when they click into it a "$"...that was Easy lol
but i also need from the dollar sign to $0.00 then $0.01, $0.10 and so on.
And save an instance of it without the Symbols.
I am very new to Objective C and would like maybe a simple explanation or even a good blog to read about it. "only if you just recently read it and its not outdated"
You want to use NSNumberFormatter to accomplish this. The NSNumberFormatter documention from Apple is very good (I've just re-read it and it's not outdated). Specifically, look at the section on Configuring the Format of Currency. This should be enough to get you started.
Another good place to look if you prefer examples to documentation, is to read through the section on Number Formatters from Apple's Data Formatting Guide. This goes through examples of how to set up currency formatters to your specifications with concrete examples.
Finally, in order to integrate this with a UITextField, you will want to use the delegate method
– textField:shouldChangeCharactersInRange:replacementString:
This allows you to validate and update characters as the user types them in.