Tasks Explorer 1.1
Tasks Explorer 1.1 has been released. This is intermediate release version and it doesn't have any new big features. Application was ported to 64bit, the optimization of GUI part was made and auto-updating (Sparkle framework has been used) was added.
Features:
Bug-fix:
Download Tasks Explorer 1.1
Tasks Explorer 1.0
During last month I have been working hard developing Tasks Explorer application. This project became my first experience in Mac OS X development. As a whole, Mac OS X development made a dual impression. On one hand, GUI development with Cocoa is very simple tasks. On another hand, low-level development is difficult because of lack of XNU level documentation and low number of professional Mac OS X communities, forums, web sites. As a result, I spent about 160 man-hours on development of the first version...
How to obtain processes list
There are two ways for processes list obtaining on Mac OS X (at least, I know two ways).
Let's start from the first way, which is easier but potentially has bugs. In BSD part (it is BSD part which manages processes in Mac OS X) of XNU kernel there is kinfo_proc structure that contains a lot of processes information including such information like process’ PID and name.
XNU documentation
I've been using MSDN for ages and after that Apple documentation included in Xcode made me disappointed. Although I got used to the new documentation format soon, I was upset with absence of system functions’ description (for example, try to find mach_msg function documentation). As I found out later, Apple had placed Mach subsystem documentation into the separate HTML documents, which could be downloaded only with XNU sources.
Прочитать остальную часть записи »
Debugging the application as root within Mac OS X
Xcode cann't run the debuging application as root by default, but it's not a problem in most cases. Nevertheless, root rights are nesessery in a few isolated instance. The simplest way is to run Xcode as root.
sudo /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Although I think this is one of the worst decisions that had been ever made.
The Unix Way is possible; the application should be run within GDB as root… It isn’t elegant solution too, debugging within Xcode is the best way.
Blocks
A new, very helpful data type, blocks, has been added into GCC for Mac OS X 10.6. Blocks' declaration and behavior are similar to functions declaration and behavior:
blockReturningIntTakingChar = ^int (char arg) { return arg*10; }; int n = blockReturningIntTakingChar('a');
If new type is used a source code may be simplified. For example sorting with use of blocks could be written as follow:
#include <stdio.h> #include <string.h> #include <stdlib.h> int main (int argc, const char * argv[]) { char *strings[4] = {"Masha","Vasya","Dima","Petya"}; qsort_b( strings, 4, sizeof(char*), ^(const void* l, const void *r) { char *left = *(char**)l; char *right = *(char**)r; return strncmp( left, right, 1 ); }); return 0; }
Apple has presented that extension for the C standards working group’s consideration as N1370: Apple's Extensions to C. I hope blocks will be available for non Mac OS X platforms too.
Mac OS X as VMware Fusion guest OS
Mac OS X should running only on Apple labeled devises officially. Accordingly, virtualization is not allowed officially with the exception of Mac OS X Server. As I understood, Mac OS X virtualization is supported with VMware only and it virtualizes Mac OS X Server exclusively. Of course, there're several communities solving issues with Mac OS X installation on non Apple labeled devices. However, Maс OS X installation is a difficult task even if information from OSx86 community is used. And I got added evidence of this.
Objective C singleton pattern
On the process of reading iPhone OS official documentation, it produce the illusion that there are 2 designed patterns: Model View Controller and Delegate. In general I agree with this way, because a lot of patterns descriptions disorient, especially in new domain. None the less, I like to use suitable and habitual approaches in new platform too.
I got enthusiastic about implementing...
Objective C & Windows
Objective C is the main Mac OS X programming language and it isn't used beyond Mac OS X. However, I'd like to look over that language in Windows. The only Objective C compiler for Windows is included in GCC, that's why Cygwing or MinGW should be installed. An IDE for Objective C is more complex issue.
Прочитать остальную часть записи »
Memory leaks detection using CRT
BoundsCheker is the most popular and widespread tool for memory leaks detection. Unfortunately, its price is very high and the product quality is going from bed to worse in latest versions. The interesting point is that a very simple and free memory leaks detection tool exists, and there are not mach software developers who know it. Below I'll describe memory leaks detections with Microsoft CRT debugging futures.
