mac

Is it possible to embed a TTF or OTF font file in a C++ application?

Is it possible to embed a TTF or OTF font file in a C++ application so that application can use it without installing it on target machine? Any thoughts are welcome. (target platforms are going to be Windows and Macintosh). Purpose: Font is a private one and should not be available to the users. ...

Load NSImage into QPixmap or QImage

I have an NSImage pointer from a platform SDK, and I need to load it into Qt's QImage class. To make things easier, I can create a QImage from a CGImageRef by using QPixmap as an intermediate format, like this: CGImageRef myImage = // ... get a CGImageRef somehow. QImage img = QPixmap::fromMacCGImageRef(myImage).toImage(); However, I ...

Button is not visible at runtime(cocoa objective-c) ?

I am trying to load nib at run time. I am using Button control & binding it to one method & outlet. But problem is that when i load it run time it not display button. Also When i click on position where i placed button in interface builder, it executes binded method. I don't understand what is happening ? ...

TCP/IP RST being sent differently in different browsers.

On Mac OS X (10.6), if I start a YouTube video download and pull the Ethernet cable for 5 or so seconds, then plug it back in, I get varying results depending on the browser. With Opera and Chrome, after I plug the cable back in the video continues to load. But with Safari and Firefox, it never does. Using Wireshark to look at the traff...

How to efficiently get all instances from deeper level in Cocoa model?

In my Cocoa Mac app I have an instance A which contains an unordered set of instances B which in turn has an ordered set of instances C. An instance of C can only be in one instance B and B only in one A.   I would like to have an unordered set of all instances C available on instance A. I could enumerate over all instances B each time,...

Inconsistency in modified/created/accessed time on mac

I'm having trouble using os.utime to correctly set the modification time on the mac (Mac OS X 10.6.2, running Python 2.6.1 from /usr/bin/python). It's not consistent with the touch utility, and it's not consistent with the properties displayed in the Finder's "get info" window. Consider the following command sequence. The 'created' and ...

How to simulate Touch event in Linux/Mac/Windows?

I wanna to simulate touch event in Windows / Mac OS X or Linux (OS is not critical). ...

Remote access to apache2 server

Hi all, I'm trying to test my iPhone application on the device. I have a mac computer which stores my development environment. Right now I can only access PHP files using the http://localhost/PHPFileLocation which does not work when I try to test my app on real device. How do I configure apache2 to be accessible from outside? Is it pos...

Installing Eclipse and setting up Android ADT on OS X v10.6 Snow Leopard

Hi, I am trying to install Eclipse Galileo on my MacBook running OS X v10.6 (Snow Leopard) and set it up with ADT plugin. I downloaded 64-bit cocoa version of "Eclipse Galileo for JEE developers" and ADT v0.9.6 from the respective offical sites. When I try to add this new plugin-archive in Eclipse, I get the following error: Cann...

Is there a way to trigger gesture events on Mac OS X?

Hello, I want to trigger multitouch gesture events on Mac OS X. Is there a way to do this? Mouse or keyboard events can be triggered with CGEventCreateMouseEvent and CGEventCreateKeyboardEvent. Is there similar low level function for multitouch events? Rok ...

Nested factory methods in Objective-C

What's the best way to handle memory management with nested factory methods, such as in the following example? @interface MyClass : NSObject { int _arg; } + (MyClass *) SpecialCase1; + (MyClass *) SpecialCase2; + (MyClass *) myClassWithArg:(int)arg; - (id) initWithArg:(int)arg; @property (nonatomic, assign) int arg; @end @implem...

Crashes in Core Data's Inferred Mapping Model Creation (Lightweight Migration). Threading Issue?

I'm getting random crashes when creating an inferred mapping model (with Core Data's lightweight migration) within my application. By the way, I have to do it programmatically in my application while it is running. This is how I create this model (after I have made proper currentModel and newModel objects, of course): NSMappingModel *m...

how does vim's autoread work

Hi, i'm not sure how vim's set autoread works. The help says "When a file has been detected to have been changed outside of Vim and it has not been changed inside of Vim, automatically read it again." So after :set autoread I open a file with vim, I switch to an other editor, change the file, and wait to see the changes in vim as well...

Best practices for MacOS/iPhone library cross compiling

I've build a static library working nice in a Cocoa Touch environment. Now I'd like to compile it also for Cocoa.. Can I have a single XCode project with different sdk targets? Is there some resource out there able to give hints about best the practices in this (and other) sense? ...

Can't play wav file from Javascript in Firefox for Mac

I have the following html file that plays a wav file when the user hovers over the 'Play' anchor tag. It works perfectly on IE, Chrome, Firefox, Opera, Safari on both Windows and Mac - except for Firefox on the Mac which does not play the file. We know the file type is supported because if the autostart attribute of the embed tag is se...

Undocumented Mac Calls

I'm working on a couple of mac products, and in order to do what I need to do, I'm using some calls to undocumented methods on Mac Classes. Like IKImageView's doRotate:(id) and PDFDocument's (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate; How common is it for Objective C pr...

IOKit header assert.h gone? [answered]

I want to get the hardware address of my mac's ethernet card. In all samples I saw in include on IOKit/assert.h . Which doesn't seem to exist on my system. GCC throws an error saying he doesn't know the type IOEthernetAddress. Is assert.h necessary for my task? It would be great if someone coud give me a working sample. [edit] here's my ...

Can I access a Mac Numbers (.num) document from within R?

I know I can use the RODBC library for accessing excel (.xls) docs from within Windows, but is there something similar for the Numbers program that come with iWorks? If not, what other solutions are there for easily editing a spreadsheet (like a lookup table) and accessing it within R? I know there the is an internal R editor, but I d...

VPython in Eclipse - thinks it has the wrong architecture type.

Evening, So I've recently installed VPython on my MacBook (OS X, Snow Leopard) - and it works absolutely fine in IDLE and from the command line (interactive mode). However, eclipse has issues. Firstly it couldn't find it (which is a bit of an issue actually with all these 'easy install' python modules - when they don't tell you where t...

creating NSimage from NSbitmapRep from int* using NSData?

I have an int* of rgb data,width, height, and scanlinestride where i would like to create an NSImage. i have looked around and found that i need to use NSData? what is the ideal way of doing this? ...