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 7047781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:48:46+00:00 2026-05-28T02:48:46+00:00

Sorry to ask something that others have already asked. But when I use the

  • 0

Sorry to ask something that others have already asked. But when I use the published fix, my program bombs

Original that works but gives the NSString deprecated message:

textFromFile = [NSString stringWithContentsOfFile:filePath];
tempArray=[NSMutableArray arrayWithArray:[textFromFile componentsSeparatedByString: @"||"]]; 

The reported fix:

NSString *textFromFile = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
tempArray=[NSMutableArray arrayWithArray:[textFromFile componentsSeparatedByString: @"||"]];

Bottom one bombs. What else about the fix am I missing?

(I am using NSString *textFromFile at the top of the file. My (beginner’s) intuition is that I am declaring it twice, but if I don’t put it at the top of the file, I get undeclared variable error messages. I know I’m not grasping something. Any words of wisdom would be appreciated.)

  • 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-28T02:48:46+00:00Added an answer on May 28, 2026 at 2:48 am

    I have found the problem with my situation. Here it is for anyone else who runs into the same issue.

    In the text file which was read into the string textFromFile, I had used || to separate the items that were then to be transferred into the tempArray.

    The old deprecated way worked. The new, officially preferred method, with that extra encoding parameter, bombed.

    When I switched the separators to jj instead of ||, the new method worked.

    I now have no warnings about using deprecated syntax.

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

Sidebar

Related Questions

I'm really sorry to have to ask this, but I clearly don't understand something
I'm sorry to have to ask something like this but python's mechanize documentation seems
I'm sorry to ask this question but I have spent hours trying to understand
i am sorry to ask again since i asked something similar to this earlier,
Sorry to ask this, but with previouse reading, re-reading of doc and all the
Sorry to ask such a noob question, but the NDK documentation is wrong (r7b):
Sorry to ask this question again but I tried several solutions on stackoverflow and
I am very sorry to ask such a basic question but I am new
I'm sorry to ask a question but I am useless when it comes to
Sorry but I am not sure how to ask this question but I am

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.