Re: Is it possible to read a file icon from iOS file system?
Re: Is it possible to read a file icon from iOS file system?
- Subject: Re: Is it possible to read a file icon from iOS file system?
- From: Brad Stone <email@hidden>
- Date: Mon, 10 Dec 2012 21:23:59 -0500
Answered my own question.
UIDocumentInteractionController
@property(nonatomic,readonly) NSArray *icons
Discussion
This property contains an array of UIImage objects containing the available icons for the given file. The images in the array are sorted from smallest to largest, with the smallest image located at index 0. The returned array always contains at least one image.
The images themselves are provided by the system and determined by the UTI of the file. Apps can register custom icons for their associated files by including the appropriate meta information in their Info.plist file. If no custom icon exists, the images in this property represent the generic document icon.
On Dec 10, 2012, at 5:34 PM, Brad Stone <email@hidden> wrote:
> In iOS is there a way I can get access a file's icon?
>
> I use [NSWorkspace iconForFile] in OS X. I looked a lot yesterday and I don't **think** there is a way in iOS. My OS X app has an iOS client and the files will be synced using iCloud. My app's document structure is a file package with a core data database and user files in it (Excel, for example). When they open the package with my client in iOS they see a table view with the file names and I want them to see the icons.
>
> I'm trying to read the icon from the file as a work-around because the icon is stored as an NSImage in the core data database. I thought if I could avoid modifying my core data model by reading the image from the file and I'll just remove the attribute form the iOS model. To make the image work in iOS will require me to change all the thousands of NSImages in the OS X world which is where I'll probably end up.
>
> Thanks
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden