Re: Build Settings for Release: App/Library is bloated
Re: Build Settings for Release: App/Library is bloated
- Subject: Re: Build Settings for Release: App/Library is bloated
- From: Miles <email@hidden>
- Date: Sun, 12 Apr 2009 14:19:35 -0700
OK, it's gradually making sense, but i still have some questions. I started
trying to do something like this a while back -- storing it all in one file,
then loading it, but I think after that is where I went wrong. I created an
array out of the contents and used it searched it way. I then decided to
split it into separate files to make the searching faster.
I am now trying to do what you are recommending, and I have the file loaded
with:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"dictionary"
ofType:@"txt"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
My questions are now about how to store the contents, because I don't think
a nsdata or converting it to an array is what I want. Googling with keywords
I've gathered from your emails have given me hints about using mmap, but
I've finding very little info on it or how to use it. Is that what I should
be trying to figure out? Searching "shared prefix matching" and similar
keywords aren't turning up much either, so i'm a little stuck. I'd
appreciate another boost or two if you wouldn't mind.
As usual, thanks a lot!
On Sun, Apr 12, 2009 at 1:30 PM, Kyle Sluder <email@hidden> wrote:
> On Sun, Apr 12, 2009 at 1:19 PM, Miles <email@hidden> wrote:
> > In the meantime if you have a good link handy about how to do this I
> would
> > appreciate it.
>
> If you put something in the Resources directory of the app bundle, you
> can use NSBundle's -pathForResource:ofType: and related methods to get
> their paths. Since you're working on iPhone, you need to be conscious
> of the tradeoffs of compressing resources on-disk (and taking the
> processor time to decompress them, either at startup or on load)
> versus leaving them uncompressed (and consequently consuming more disk
> space). Making them static arrays, however, is probably not a good
> idea.
>
> --Kyle Sluder
>
_______________________________________________
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