Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't quite get what you want here; NSLog() is the standard function to output to the console - at least in debug mode, generally NSLog()'s are removed from release code. (a big generalisation I know, but generally correct)</p> <p>Is the user on your machine? Are you connected over a network.. etc There's a few questions you've left out.</p> <p>Furthermore, why are you giving the user the options to do stuff which break the rules? I think this should be the biggest point from your post. The user obviously has the functionality to break the rules; how about changing that functionality instead of spying on them?</p> <p>If I thought software I was using was being "logged" so the developer could see what I was doing, I would immediately begin looking at alternatives.</p> <hr> <p>Edit: This is what I am trying to explain in the comments of this answer. I'm not claiming this code to be compile-able, I'm merely trying to explain how such a solution should work. It may not be the best, nor the quickest - it will however get the job done. I still personally believe the user shouldn't have that kind of functionality if he has no reason for it, and seeing as you have the source code to the application it should be trivial to remove that functionality - even temporarily.</p> <p>PHP Script - This will mail you the error;</p> <pre><code>&lt;?php /* Get the specified incident */ $incident = $_GET['incident']; $app = $_GET['app']; $email = ''; //Your email address /* send it to $email, with a subject of $app, ** and the "incident as a message" */ if( mail($email, $app, $incident) ){ echo "SUCCESS"; } ?&gt; </code></pre> <p>Then, to call it in Objective-C - implement a quick wrapper function to use the functionality of NSString's stringWithContentsOfURL method. Like this..</p> <pre><code>-(BOOL) userRuleBreak:(NSString *)incident{ /* We need to generate a URL of http://xxxxxx/perm.php?incident=???&amp;app=???? */ NSUrl *alert = [NSUrl initWithString:[NSString initWithFormat:@"http://www.xxxxxx.xxx/perm.php?incident=%s&amp;app=%s", incident, @"APPNAME"]; NSString *status = [NSString stringWithContentsOfURL:alert, encoding:NSASCIIStringEncoding]; if( status != nil ){ return YES; } else { return NO; } } </code></pre> <p>Obviously, replacing the if statement at the end for something that will actually check the contents of the NSString. This code may, or may not compile - I haven't tried, but even if it does I advise you to code your own solution as that was written up quickly after a long couple of days with little sleep!</p> <p><strong><em>Look, The real issue with this application isn't the fact you're waiting for the user to do something he shouldn't - it's the fact that you're giving that user the ability to do something he shouldn't. If you don't want a user doing something - then don't give them the functionality. It's a poor idea to wait for an email after the user has already done something - by then, its too late. Stop it before it happens - don't give them the option to do it. Be pro-active and not reactionary, because if the user does something he shouldn't; its all fine and well saying "But I told you not to do that! You're not allowed" - but you'll be the one trying to undo the damage he's done.</em></strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload