Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 520955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:11:58+00:00 2026-05-13T08:11:58+00:00

I have a language file downloaded from a web service located in my resources

  • 0

I have a language file downloaded from a web service located in my resources folder of the project. The file name is “no.properties” and I need to load the file into a string to make further use of it..

The content of my file is displayed like this:

CMD_EXIT = Avslutt

CMD_PAUSE = Pause

CMD_SCAN = Skann

ect…..

Here is my code of loading the file into a string:

NSString* path = [[NSBundle mainBundle] pathForResource:[defaults objectForKey:@"language"]  
                                                 ofType:@"properties"];

NSString* content = [NSString stringWithContentsOfFile:path 
                                              encoding:NSUTF8StringEncoding 
                                                 error:NULL];

The problem is that the “content” string is null even though the file contains a lot of data. Anyone know what might be the problem?

note: I´ve checked that the value received from userdefaults equals “no”. I have also tried to rename the file to “no.txt”, but still the “content” string is null.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:11:58+00:00Added an answer on May 13, 2026 at 8:11 am

    First, you could try to pass a NSError object to stringWithContentsOfFile:::.
    You should receive a Cocoa error number, that (hopefully) tells you more about the problem.

    NSError* err = nil;
    NSString* string = [NSString stringWithContentsOfFile:path encoding:NSUTF16BigEndianStringEncoding error:&err];
    

    As you seem to work with language files, I suspect that you are specifying the wrong encoding when reading in the strings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i have to download a simple .txt file from web in c language.
I have downloaded a MetaTrader MQL4 language .mq4 source-code file from here and I
I have a function in PHP language to create an xml file when requested.
Hello I need to have multiple language support of my django admin application.I can
i downloaded this class http://www.codeproject.com/file/VersionInfo.asp i use it to get the file information from
I'm getting this error Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
I have a page that I use to pull a file from the database
I have an aspx site: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Download.aspx.cs Inherits=ATP.Management.Web.Download %> <!DOCTYPE html
I have download the code for OpenFileDialog (File Upload function) from Silverlight tutorials website.
I have a desktop program I downloaded and installed. It runs from an .exe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.