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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:05:37+00:00 2026-06-04T07:05:37+00:00

I have written a method (shown below). The project is compiled using ARC, but

  • 0

I have written a method (shown below). The project is compiled using ARC, but the file the method is in has to be compiled with the -fno-objc-arc switch because of a third party library dependency.

The leak inspector is telling me that there is a leak on

return [fragments componentsJoinedByString:@" "];

I can’t see it – could I ask for another pair of eyes to point out the error of my ways?

Many thanks

-(NSString *)trimAndTidy:(NSString *)aString
{
    NSCharacterSet *nsc = [NSCharacterSet characterSetWithCharactersInString:@"\r\n \t"];
    NSString *fragment;
    NSMutableArray *fragments = [NSMutableArray array];
    NSScanner *scanner = [NSScanner scannerWithString:aString];
    do
    {
        if ([scanner scanUpToCharactersFromSet:nsc intoString:&fragment])
            [fragments addObject:fragment];
    }
    while (![scanner isAtEnd]);
    return [fragments componentsJoinedByString:@" "];
}
  • 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-06-04T07:05:37+00:00Added an answer on June 4, 2026 at 7:05 am

    The leak inspector tells you where a leak was allocated and not where the leak was caused.

    To find the cause, you have to find the extra retain or missing release call.

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

Sidebar

Related Questions

I have written the code shown below. my problem is that I can't touch
For one Model called Email.rb, I have a method shown below called new_todos. This
I have written a method to calculate a given percentile for a set of
i have written a method in java like this public boolean ADD(String ID,String Name,String
I have written this clone method for when the parent of the Employee class
I have written an extension method for string manipulation. I'm confused what should I
I have a written a method to get all the records and return in
I have a method written in VB.NET. It looks like this: Shared Sub SomeMethod(ByVal
I have written a login form, in this I have used, form and method
I am writing some unit tests for an extension method I have written on

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.