Search Results

Search found 6 results on 1 pages for 'pau senabre'.

Page 1/1 | 1 

  • Getting Notifications in Background Mode iOS?

    - by Pau Senabre
    I'm trying to get Notifications in Background Mode by running a method every minute to see if there are new notifications. This works great in Active Mode, but I saw for background mode it is restricted to 7 keys. I enabled the Background Mode with the option Background Fetch, but seems like the method is being called but it's not complete. In AppDelegate I'm calling: - (void)applicationDidEnterBackground:(UIApplication *)application { //This has a Timer to execute every minute [self GetNotifications]; //This executes a NSMutableURLRequest *request //giving back the JSON data with the notifications } I would like to do something like Facebook does for Notifications. Any idea how to do this?

    Read the article

  • Why this code does not do what I mean?

    - by Mike
    $w = 'self-powering'; %h = (self => 'self', power => 'pau?', ); if ($w =~ /(\w+)-(\w+)ing$/ && $1~~%h && $2~~%h && $h{$2}=~/?$/) { $p = $h{$1}.$h{$2}.'ri?'; print "$w:"," [","$p","] "; } I expect the output to be self-powering: selfpau?ri? But what I get is: self-powering: [ri?] My guess is something's wrong with the code $h{$2}=~/?$/ It seems that when I use $h{$2}!~/?$/ Perl will do what I mean but why I can't get "self-powering: selfpau?ri?"? What am I doing wrong? Any ideas? Thanks as always for any comments/suggestions/pointers :)

    Read the article

  • Detecting a Dispose() from an exception inside using block

    - by Augusto Radtke
    I have the following code in my application: using (var database = new Database()) { var poll = // Some database query code. foreach (Question question in poll.Questions) { foreach (Answer answer in question.Answers) { database.Remove(answer); } // This is a sample line that simulate an error. throw new Exception("deu pau"); database.Remove(question); } database.Remove(poll); } This code triggers the Database class Dispose() method as usual, and this method automatically commits the transaction to the database, but this leaves my database in an inconsistent state as the answers are erased but the question and the poll are not. There is any way that I can detect in the Dispose() method that it being called because of an exception instead of regular end of the closing block, so I can automate the rollback? I don´t want to manually add a try ... catch block, my objective is to use the using block as a logical safe transaction manager, so it commits to the database if the execution was clean or rollbacks if any exception occured. Do you have some thoughts on that?

    Read the article

1