Mac Savepanel the GUI code to save the file

Source: Internet
Author: User

Move the recorded temporary file to a user-specified location (video file stored procedure, according to user selected path and file save name) Nssavepanel *savepanel = [NSSa Vepanel Savepanel]; [Savepanel Setallowedfiletypes:[nsarray Arraywithobject:avfiletypequicktimemovie]; [Savepanel Setcanselecthiddenextension:yes]; [Savepanel beginsheetmodalforwindow:[self Windowforsheet] completionhandler:^ (nsinteger result) {Nserror *error = nil;if (Result = = Nsokbutton) {[[Nsfilemanager Defaultmanager] Removeitematurl:[savepanel URL] Error:ni L];  Attempt to remove file at the desired save location before moving the recorded file to that locationif ([[Nsfilemanager Defaultmanager] Moveitematurl:outputfileurl Tourl:[savepanel URL] error:&error]) {[[Nsworkspace sharedWorkspace] Openurl:[savepanel URL]];} else {[Savepanel orderout:self];[ Self presenterror:error modalforwindow:[self windowforsheet] delegate:self didpresentselector: @selector ( Didpresenterrorwithrecovery:contextinfo:) contextinfo:null];}} else {//Remove the temporary recording file If it ' s not being Saved[[nsfilemanager Defaultmanager] Removeitematurl:outputfileurl error:nil];}}]; 

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvy2h1yw55axr1b2t1/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center " />


Mac Savepanel the GUI code to save the file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.