This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var ie = !!(window.attachEvent && !window.opera); | |
var wk = /webkit//(/d+)/i.test(navigator.userAgent) && (RegExp.$1 < 525); | |
var fn = []; | |
var run = function () { | |
for (var i = 0; i < fn.length; i++) fn[i](); | |
}; | |
var d = document; | |
d.ready = function (f) { | |
if (!ie && !wk && d.addEventListener) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Initalize new notification | |
NSUserNotification *notification = [[NSUserNotification alloc] init]; | |
//Set the title of the notification | |
[notification setTitle:@"My Title"]; | |
//Set the text of the notification | |
[notification setInformativeText:@"My Text"]; | |
//Set the time and date on which the nofication will be deliverd (for example 20 secons later than the current date and time) | |
[notification setDeliveryDate:[NSDate dateWithTimeInterval:20 sinceDate:[NSDate date]]]; | |
//Set the sound, this can be either nil for no sound, NSUserNotificationDefaultSoundName for the default sound (tri-tone) and a string of a .caf file that is in the bundle (filname and extension) | |
[notification setSoundName:NSUserNotificationDefaultSoundName]; |