Monday, 15 August 2011

arrays - UIFIleSharing populating UIPickerView -



arrays - UIFIleSharing populating UIPickerView -

i'm new site , newer app development, i'm learning slowly.. lol

so nail first big snag, i've researched on over web , can't find i'm looking for, here go.

i'm creating app calls upon user inputted files can , alter on occasion. i've added uifilesharing alternative users can upload files via itunes.

there 3 different types of files need used, a .opt, .pkg, , .txt.

is there way can take files directory, read them, , based off file extension pull them , utilize them in uipickerview wheel? i'm new @ please forgive me when inquire specific.

my assumption in few steps, first read files , sort them , place them in array based on extension, utilize said array populate picker, , count number of rows etc..

i guess sec 2 parts pretty simple figure out, setting picker utilize array, need know if possible build array based on user loaded files.

thanks in advance,

chuck

you'll need utilize uidocumentinteractioncontroller class.

simple illustration

uidocumentinteractioncontroller * controller; nsurl *fileurl=[nsurl fileurlwithpath:[self getfilepath]] controller = [ uidocumentinteractioncontroller interactioncontrollerwithurl: fileurl ];

// how file document directory

-(nsstring *)getfilepath{ nsstring *documentpath= [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes)objectatindex:0]; homecoming [documentpath stringbyappendingpathcomponent:@"your file name"] }

arrays uipickerview

No comments:

Post a Comment