In our multi - user application we are continuously interacting with database. We have a common class through which we are sending POST queries to database and obtaining xml files in return. We are using delegates of NSXMLParser to parse the obtained file. The problem with us is we are facing many crashes in it generally when application...
I am trying to write a small Cocoa application that helps me manage my time, I want it check on startup if already has a launchd entry and if not, add itself an entry.
What is the correct folder to write the launchd file, and/or is there a special cocoa method to retrieve what the correct folder is (ie in the same way you retrieve the u...
I am having a problem with calculating time difference between two timeZones.
If I am at location A I know the latitude and longitude and the current time.
I go to location B I know the latitude and longitude and the current time.
How to calculate the time difference between the two current points .. (in UTC)
...
These are fairly simplistic questions, but something that I wanted to get right in my head before continuing...
@interface BasicTire : NSObject {
}
@end
@interface SnowTire : BasicTire {
}
@end
When you call [SnowTire init] the included [super init] calls [BasicTire init] which in turn calls [NSObject init]? (i.e. a cascade running...
Is there a neat/easy way in objective-c/cocoa to track if a user is at their computer, ie I assume by detecting key presses and mouse movement?
(ie I want to fill out my timesheet automatically by detecting when I am at work and not at work)
...
I have a collection view that I've subclassed that allows me to reorder the collection view items via drag and drop. My drag code that sets up the pasterboard is currently in mouseDragged:
- (void)mouseDragged:(NSEvent *)aEvent {
if(!dragInProgress) {
dragInProgress = YES;
NSPasteboard *pboard = [NSPasteboard pasteboard...
I have a core data model with a variety of properties. For some reason the string properties are limited to 50 characters even though no max value (or default value for that matter) is set.
Interesting thing is that it was fine before I added fetch requests using the browser view of the data model.
Any thoughts? Thanks!
...
Does anyone know what are the types of UI objects used in Mac Address book to edit the address components? I have started my first Cocoa application and in many instances I would like to have this look and feel as opposed to simple table views.
...
I'm trying to do something similar to this code sample but in RubyCocoa. In particular, I'm having some trouble trying to build a SecKeychainAttributeList. I suspect I need to make use of Array#pack or something to build a suitable structure in Ruby. Any advice on how to build the equivalent of attributes in the following chunk of code w...
Hi,
I need a lock in cocoa that does not use one cpu when I try to lock it and it is locked somewhere else. Something that is implemented in the kernel scheduler.
...
I'm trying to translate some of the following sample code into RubyCocoa :-
SecAccessRef createAccess(NSString *accessLabel)
{
OSStatus err;
SecAccessRef access=nil;
NSArray *trustedApplications=nil;
//Make an exception list of trusted applications; that is,
// applications that are allowed to access the item withou...
I have NSTableView in my application. right now say is 8 columns by 48 rows.
I have a function that runs a specific a specific column to see wether or not the value in each cell is greater than a certain value. If it is I would like the application to highlight the row.
I did some reading and I am still looking for the functions calls ...
I am implementing a search field where the user can type in a string to filter the items displayed in a view. Each object being displayed has a keywords to-many relationship, and I would like to be able to filter the objects based on their keywords. Each keyword object has a name property, so I've set up an NSPredicate to do the filter...
The below code behaves as expected however the compiler keeps telling me this:
warning: 'StatusViewController' may not respond to '-beginLoadingThreadData'
How do I get rid of that warning and most important why xcode believes that is the case?
here is my code:
[self beginLoadingThreadData]; // called in the loadDidView block
- (void...
Hi,
I'm distributing two different versions of one product (like light and pro version). I don't know how to use the same MainMenu.xib if I can not change the placeholder NewApplication in a dynamic way. I would like to use the bundle name instead of "NewApplication".
I hope there is an official way to do this without hacking.
Thank yo...
My exact model is complicated to explain, so say that I'm modeling fruits and their seeds in Xcode's Core Data modeler. Here's some "psuedo-coreData-code":
abstractEntity Fruit
attribute sweetness
relationship Seed
abstractEntity Seed
attribute shape
concreteEntity Apple inherits Fruit
concreteEntity Orange inherits Fruit
concreteEn...
I'm using NSKeyedArchiver to write out an NSDictionary of my app's data to the filesystem.
NSMutableData *data = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver encodeObject:myAppsDictionary forKey:kDataKey];
[archiver finishEncoding];
BOOL success = [dat...
With an instance variable myArray:
@interface AppController : NSObject
{
NSArray *myArray;
}
Sometimes I see myArray initialized like this:
- (void)init
{
[super init];
self.myArray = [[NSArray alloc] init];
return self;
}
and sometimes I see it with a more complicated method:
- (void)init
{
[super init];
N...
This is probably a stupid question, but how can I execute a shell command from my Cocoa app?
I have the command as a string "command", but can easily manipulate data as needed.
There is no need to get a returned output value.
...
I have two NSArrays, what I'm looking to do is to compare two arrays which contain strings, find the similarities and create the first array again but so they have no similarities.
Just for an example something like.
Two Arrays:
NSArray *arrayOne = [NSArray arrayWithObjects:@"TD1", @"TD2", @"TD3", nil];
NSArray *arrayTwo = [NSArray ar...