Colors in Objective-C

With this post I start annotating some basic tips on Apple programming, as most newbies do.

We want to change the text and color of a label:

MyName.text = [[listNames objectAtIndex:i] uppercaseString] ;
[MyName setTextColor:[UIColor colorWithRed:22.0/255.0f green:150.0/255.0f blue:22.0/255.0f alpha:1.0]] ;

Continue reading

OS X “Can’t connect to wifi” because of USB 3.0 HD

With a 2015 MacBook retina I was experiencing a frustrating issue with home WiFi: it couldn’t join any router.

I was transferring data from one external drive to another, and both of them were USB 3.0… so after a while I realized that I didn’t burn the Airport card, but rather experienced the known issue of USB 3.0 drive interfering with Wi-Fi connection.

To add more fun to this, the issue is being addressed by router manufacturers themselves (routers themselves carry USB ports to connect drives…).

Solution: simply disconnect the drive 🙂

 

Remove duplicate items from “Open with…” menu in Mac OS X (10.5 to 10.8)

ImageWhen your “Open with…” menu in Mountain Lion becomes weirdly crowded by duplicated items (can be MUCH worst than the picture) open the Terminal (it’s in the Application folder, or just type “terminal” in SpotLight), then paste the command below and hit enter (note that there is NO space before “Frameworks”:

/System/Library/Frameworks/CoreServices.framework/ Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

DMG 2 ISO via Terminal: no need for any tool

If you downloaded a Mac image (.dmg file) and you need to open or burn from a Windows/Linux machine, you can easily convert it to the very common .iso format. Open the terminal and type this command:

 hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso

Note that this tool appends an extra .cdr extension to the file, but just rename it – even via terminal with:

mv /path/to/savefile.iso.cdr /path/to/savefile.iso

and you are done!

Threats for Mac OS X, as for any other system

Screenshot of malware detected by an antivirus for Mac OS X

Every system has it weak point, usually located between the monitor and the chair. When a user downloads a program and executes it he’s giving to that program full access of the computer.
This is the case when you download a known program from less “official” sources (e.g. Torrent,…): it could hide inside the program a malware that steals your informations…

Even Mac crashes

Kernel panic Mac OS X Snow Leopard This picture is something you, Mac users, could never see in your entire life. But it happens.

This is a “kernel panic“, a tremendous crash you can only turn the computer off to continue… It’s rare and when happening should scare: maybe something is going wrong with the hardware… as most fan-boys say.

And this is the truth: even Windows often crashed because of poor hardware quality (failing motherboard, RAM etc.) and I think that if all Windows users had hi-quality hardware as Macs are, their crashes would be rare too.

But a non-crashing-windows is still boring 🙂