RE: Storing and Retrieving Strings
RE: Storing and Retrieving Strings
- Subject: RE: Storing and Retrieving Strings
- From: "Kenny Millar" <email@hidden>
- Date: Thu, 19 Jan 2006 14:06:47 -0000
Yip,
Why not drop the large string into a file, include it in your resources and
then use seomthing like this...
NSBundle *mainBundle = [NSBundle mainBundle];
strPath = [mainBundle pathForResource:@"Large String Doc" ofType:@"txt"];
[strPath retain];
if(strPath)
{
NSString myString = [NSString stringWithContentsOfFile:strPath]; //
heres the interesting bit.
[myString retain];
}
-Kenny
> -----Original Message-----
> From: cocoa-dev-bounces+kennymillar=email@hidden
> [mailto:cocoa-dev-bounces+kennymillar=email@hidden]
> On Behalf Of Mike Abdullah
> Sent: 19 January 2006 13:55
> To: email@hidden
> Subject: Storing and Retrieving Strings
>
> I need to store and retrieve some strings in my app. I know
> how to do this for localisation strings, but this is
> different. I need the retrieved string to be the same
> regardless of the localisation.
>
> I could just hardcode the strings into my source code, but
> some of them are quite long, and some contain return
> characters, thereby making it quite awkward looking if I do this.
>
> Any suggestions?
> Mike.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden