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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:55:43+00:00 2026-06-03T19:55:43+00:00

I have several directories of 12 .caf files and am loading them programmatically: NSString

  • 0

I have several directories of 12 .caf files and am loading them programmatically:

NSString *soundToPlay = [NSString stringWithFormat:@"sounds/%d/%d_%d.caf", type, note, timbre];

If I want to, say, increment from 9 to 10 in one of those values, suddenly my string is an extra character long, which makes it harder to manipulate later with something like NSMakeRange. I’d like to keep all these %ds to a single character.

What I’d like to do is name my files using the digits 0-9 but then continue with A, B, C instead of 10, 11, 12. This would keep everything single-character. I’m hoping there’s an easy way to do this kind of thing, still allowing stuff like increment, +/-, and modulo. If so, what is it?

  • 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-03T19:55:45+00:00Added an answer on June 3, 2026 at 7:55 pm

    X is the hexadecimal format specifier:

    [NSString stringWithFormat:@"sounds/%X/%X_%X.caf", type, note, timbre]
    

    Alternatively you could always use two digit numbers. That would allow to select from more than 16 cases:

    [NSString stringWithFormat:@"sounds/%02d/%02d_%02d.caf", type, note, timbre]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several PHP files include()ing other files from several other directories. In one
I have a set of files in several directories which I would like to
I have a project that has components in several different directories and would like
I have several textboxes where users can enter information into them. This can include
I have to create a software that will scan several directories and extracts information
Let's say you have several bespoke C++ projects in separate repositories or top-level directories
I have several config files in my .net applications which I would like to
I have several directories representing subparts of a project, each with its own Makefile.
In a typical project of mine, I have several source directories, each with the
At the moment i have several catalina bases configured with the following directories, conf

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.