Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
How To Open Node.js Command Prompt/Terminal in Mac
How to open node.js command prompt in mac
JavaScript is revered as one of the leading programming languages across the globe. As it is built into the majority of web browsers, web designers and programmers use JavaScript to add new designs and...
How to convert .AIR file to .EXE?
Hi Developers,
How to convert .AIR to .EXE?, How to silently install the .AIR file on windows desktop when the system does not have pre-install Adobe AIR?, it's a basic problem faced by every flash developers when working on windows deskto...
How to copy image in NSPasteBoard
To copy the image on NSPasteBoard following code can be used:
- (IBAction)paste:sender
{
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
NSArray *classArray = [NSArray arrayWithObject:[NSImage class]];
...
How to print an NSImage
The following code prints an image stored in a file:
-(void)print:(id)sender
{
NSImage *image = [[NSImage alloc]initWithContentsOfFile:[imageEdWindowController getImageLocation]];
[image scalesWhenResized];
NSImageView *	...
How to send email in mac os
Following code can be use to send email in mac os:
-(IBAction)sendEmailClicked:(id)sender
{
NSString *recipient;
NSString *mailsender;
NSString *mailsubject;
NSString *mailmessage;
recipient = [reciever stringValue];
...
How to convert NSImage to NSImageRep
You can convert NSImage to NSImageRep by using the following method:
- (NSImageRep*)bitmapImageRepresentation:(NSImage*)image
{
NSArray *ret =[image representations];
for(NSImageRep *rep in ret)
if([rep isKindOfClass:[NSIma...
How to convert NSImage to CIImage
To convert NSImage to CIImage following function can be used.
-(CIImage*)fromNSImage:(NSImage*)image
{
NSData * tiffData = [image TIFFRepresentation];
NSBitmapImageRep * bitmap;
bitmap = [NSBitmapImageRep imageRepWithData:tiff...
How to convert CIImage to NSImage
You can convert CIImage to NSImage by using the following function:
-(NSImage*)fromCIImage:(CIImage*)ciImage
{
NSCIImageRep *imageRep = [NSCIImageRep imageRepWithCIImage:ciImage];
NSImage *_image = [[NSImage alloc] initWithSize:[ima...
How to redirect console logs to a file
To redirect the log statements to a file instead of console call the following function at the start of function applicationDidFinishLaunching.
- (void)redirectConsoleLogToDocumentFolder
{
NSArray *paths = NSSearchPathForDirectoriesInDom...
Use of NSSharingServicePicker
The NSSharingServicePicker class presents a list of sharing services, so that the user can choose a service to share an item. When a service is chosen, the picker automatically executes it, which presents the sharing window.
+ (NSMenu *)menuFo...
To setup custom webroot for Apache in Maverick
Apache by default serves files from the Document root i.e.
/Library/WebServer/Documents/
But what if you want your custom folder to serve webfiles. This tutorial walks you through the complete process.
Create a new folder at the root lev...
NSSplitView delegate for controlling minimum and maximum sizes of views
NSSplitView have delegate methods where we control the minimum and maximum sizes of sections and which views expand or collapse by what amount.
Constraining the coordinates in the splitView:constrainMinCoordinate:ofSubviewAt: sets the minimum ...
NSSplitView delegate for priority based resizing
The default resizing mechanism in NSSplitView is proportional resizing in which if the NSSplitView changes size, each column resizes by an equal percent. But it is not successful in case where the columns in a split view are used to separate a si...
Cut image through code in mac os
Method to cut image in Objective-c/cocoa (OSX)
-(IBAction)cutItem:(id)sender
{
hasBeenDragged = NO;
NSImage *_sourceImage = [self image];
float width = selectedArea.size.width;
float height = selectedArea.size.height;
...
Crop image in mac os
If you want to crop the image without changing its quality in Objective-c/cocoa (OSX) then you can use the following method
-(IBAction)crop:(id)sender{
hasBeenDragged = NO;
NSImage *_sourceImage = [self image];
float width = sel...
How to open OpenPanel in mac os
static NSArray *openFiles()
{
bookmarkMode = 0;
NSOpenPanel *panel;
NSMutableArray *extension=[[NSMutableArray alloc]init ];
[extension addObject:[[NSUserDefaults standardUserDefaults]objectForKey:@"ImageExtension" ] ];
...
Open zip file through code in mac os
Method to open zip file
-(void)unZipImages:(NSArray*)arguments
{
NSTask *unzipTask = [[NSTask alloc] init];
[unzipTask setLaunchPath:@"/user/bin/unzip"]; //this is where the unzip application is on the system.
[unzipTask setC...
How to rotate image in mac os
-(NSImage*)rotateImage:(CGFloat)degrees
{
NSImage *_image = [YourImageController image];
NSRect imageBounds = {NSZeroPoint, [_image size]};
NSBezierPath *boundsPath = [NSBezierPath bezierPathWithRect:imageBoun...
View Hidden Files and Folders In Macintosh
I just love to work on Mac but sometimes a small task can become a herculean task in no time.
Ever wondered where is the option to view hidden files and folders on Mac just like Windows has ? Frisking through all the options I realized that the...