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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:58:05+00:00 2026-06-06T20:58:05+00:00

Apple now require all future apps to be sandboxed and so I followed the

  • 0

Apple now require all future apps to be sandboxed and so I followed the instructions to sandbox an app. The build succeeded but then my system(rm -rf ~/.Trash/*) command stopped working. Nothing happened. What I find confusing here is why this system command does not work with App Sandboxing/Entitlements on. Here is are my entitlement settings:

Entitlements: Checked

App Sandboxing: Checked

And here is my current code:

- (void)viewDidLoad {
[self emptyTrash];
}

- (void)emptyTrash {
system(rm -rf ~/.Trash/*);
}

Thanks for your help!

  • 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-06T20:58:06+00:00Added an answer on June 6, 2026 at 8:58 pm

    Take a look at documentation.

    Mac OS X path-finding APIs, above the POSIX layer, return paths
    relative to the container instead of relative to the user’s home
    directory. If your app, before you sandbox it, accesses locations in
    the user’s actual home directory (~) and you are using Cocoa or Core
    Foundation APIs, then, after you enable sandboxing, your path-finding
    code automatically uses your app’s container instead.

    you can use

    struct passwd *getpwuid(uid_t uid);
    struct passwd {
    char    *pw_name;       /* user name */
    char    *pw_passwd;     /* encrypted password */
    uid_t   pw_uid;         /* user uid */
    gid_t   pw_gid;         /* user gid */
    __darwin_time_t pw_change;      /* password change time */
    char    *pw_class;      /* user access class */
    char    *pw_gecos;      /* Honeywell login info */
    char    *pw_dir;        /* home directory */
    char    *pw_shell;      /* default shell */
    __darwin_time_t pw_expire;      /* account expiration */
    }
    
     #include <pwd.h>
     #include <sys/types.h>
     char *HomeDirectory = getpwuid(getuid())->pw_dir;
     NSLog(@"%s", HomeDirectory);
     system([[NSString stringWithFormat:@"rm -rf %s/.Trash/",HomeDirectory] UTF8String]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently use Authlogic in a web-app to handle user authentication, but have now
Submission to the Mac App Store since Lion requires all apps to specify code
it appears that the Apple site now only provides download for Xcode 3.2, that
I have a text file apple banana Now you watch closely there is blank
I am a Apple developer that used to work with UIImages and photography. Now
I have a signed Java applet. And it works fine. But now I have
Apple describes the architectural pattern used by iPhone apps as MVC. However, virtually no
So there are a few apps on the app store that implement access to
We found that your app does not comply with the Apple iOS Human Interface
Howdy all. I'm working on a project that will (ideally) require the rendering of

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.