Hello,
when I create an xCode project with the 'Command Line Tool' c++ stdc++ template, i am able to include and compile opencv headers and run some code.
But i want to use OpenCV in a 'Cocoa Application' context. When created with that template, i got compile errors when I include the OpenCV headers in main.mm. (I already changed mai...
There appears to be zero documentation about the SUBQUERY keyword from Apple and I can't find a simple explanation about it on SO or on Google. It's a conspiracy! ;)
Please, could someone from the inner-circle please just provide a quick explanation of its syntax so I can use it?
SUBQUERY(Bs, $x, $x IN %@)
Thanks
...
What’s the rationale behind the Cocoa exception policy - or why use exceptions only for programmer errors?
I understand that exception used to be rather expensive so one would not want to overuse them. But that changed with the modern runtime and it’s zero-cost exceptions. I also understand that the use of exceptions to do general contr...
Hey,
I'm using CoreData in my application and depend on the NSManagedObjectContextObjectsDidChangeNotification. I have already subclassed NSManagedObject for all my Entities and created the properties and @dynamic accessors. Is it possible to exclude some properties of specific entities from the notification? If so, how would I do it? :...
I'm trying to write Boolean to a plist file. My code is:
NSString *filePath = [self dataFilePath];
if (filePath)
{
if (check)
{
NSLog(@"Clear");
[item setObject:[NSNumber numberWithBool:NO] forKey:@"check"];
[item writeToFile:filePath atomically: YES];
}else{
NSLog(@"Green");
[item setObject:[NSNumber numberWit...
I have a layer-hosting NSView (-isFlipped = YES) with three layer-hosting subviews. The subviews are a header, a content area, and a footer. The header has a disclosure triangle which will collapse the content view and just show the header and footer stuck together.
I can accomplish this pretty easily with Core Animation, but there is...
Is there a way to convert a unicode character to a Mac virtual keycode? (without building my own table?) It looks like on Windows there is VkKeyScanEx, but I'm not aware of a similar function for Cocoa on OS X.
I'm actually trying to do this for the iPad. I want to convert character taken from the keyboard and convert them into key code...
Hello,
I woudl like to send raw data (a void*) using SBApplication sendEvent
Unfortunaltly I've found no documentation about this.
Do you have any idea to achieve this?
Thanks in advance for yoru help,
Regards,
...
Hello,
I need to have a high performance communication between 2 applications. I tried AppleEvent but it is not really a good option. I thought to use a named pipe but I do not know how to use them in COCOA.
Thanks in advance for your help :)
...
I'm enconding this data with this line:
NSString *authString = [[[NSString stringWithFormat:@"%@:%@", email, password] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
for a basic HTTP Authentication
It works quite perfect but i'm getting this warning:
warning: 'NSData' may not respond to '-base64Encoding'
is there ...
Is there a method, like containsObject: for NSMUtableArrays to check if an object exists in there without having to loop through the whole array and check each element? What's the best way to check if an object exists in an NSMutableArray?
...
I started out with some items as NSWindows but my GUI is evolving and these elements would be better suited as NSViews. Is there a way to convert an NSWindow NIB into an NSView NIB?
...
Hello,
I have two applications:
1) A multithreaded cocoa gui app.
2) A unix command line tool.
I need to be able to launch the command line tool from cocoa app and capture everything it sends to stdout. The usual approach with fork/exec does not work - cocoa application crashes with "fork in multithread" exception. Any ideas?
Thank...
I just read this article on how to create global hotkeys using Carbon events. In the comments the author mentioned, that he wouldn't probably use this technology anymore because it's the 'way to deprecation'. So far, so good.
Now I'm looking for the Cocoa pendant. Does anyone have a hint where to search for it? I tried to google it for ...
I have a plist file which contains an array of dictionaries. Here is one of them:
Fred Dictionary
Name Fred
isMale [box is checked]
So now I am initializing my Person object with the dictionary I read from the plist file:
-(id) initWithDictionary: (NSDictionary *) dictionary {
if (self = [super init])
self.name =...
Here's what I've done so far:
I have created a class that contains an NSNumber.
I instantiated this class in my nib by dragging this object in the document window.
I brought an NSObjectController into the document window to manage this object. I changed the class and keys in the attributes window. I dragged a connection from this obj...
Here's my setup:
myTextField is bound to a key in the Shared User Defaults Controller. The user can only enter numbers in the text field.
Each time my application loads, I load default preferences (from the app's Resources folder) using [[NSUserDefaults standardUserDefaults] registerDefaults: ... ].
myMenuItem's title is bound to the s...
UPDATED
I have this method:
-(NSDate*)roundTo15:(NSDate*)dateToRound {
int intervalInMinute = 15;
// Create a NSDate object and a NSDateComponets object for us to use
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSMinuteCalendarUnit fromDate:dateToRound];
// Extract the number of minutes ...
Is there a method to return the identifier string for a given element's numerical value? For instance, logging a UITouch's phase returns an int, but having the actual string value would be easier to read.
I suppose I could write my own switch statement to do this, but I'm hoping there's a built-in means.
...
If you can't get an object with objectAtIndex: from an NSSet then how do you retrieve objects?
...