I have a Dictionary of Dictionaries which is being returned to me in JSON format
{
"neverstart": {
"color": 0,
"count": 0,
"uid": 32387,
"id": 73129,
"name": "neverstart"
},
"dev": {
"color": 0,
"count": 1,
"uid": 32387,
"id": 72778,
"name": "dev"
},
"iphone...
Hi,
How can I get the POSIX path of the Finder window that is currently at the top of its window list?
Preferably with some kind of Cocoa framework but I am open for anything.
Background:
I would need this because I want to make a selection of files matching a regex pattern, starting recursively from this path. The idea is to use
[[...
I want to use a focus ring animation as an indicator of incorrect data in field. So I'm sending becomeFirstResponder: to field and want focus ring to fade from red to default color.
I'm wrestling with Core Animation but still have not found any way to do it. Is it possible?
...
I'm coding up various routines and I'm trying my best to keep it neat and refactored.
Methods I'm creating are starting to look similar to this code:
-(IBAction)buttonPress:(id)sender {
// Create Document Shopping List with this document
[self doSomething:&error];
if(error) {
[NSApp presentError:&error];
re...
I created a label using Interface Builder, and now I want to set the background color of the label using code instead of IB's color picker. (I want to do this so that I can define the color using RGB and eventually change the colorspace for the label.)
I'm in cocoa. How do I edit the attributes of an IB object using code?
My code lo...
Hi all,
I am using a singleton backbone in my application to handle accuring errors. They will be handled inside the singleton and broadcast a notification throughout the app when the error has been fixed. Anyways this is not what my question is about but when I pass a new error to the singleton object like this
[[SingletonErrors share...
I want to set the background color of a label using HSV instead of RGB. How do I implement this into code?
Code:
//.m file
#import "IBAppDelegate.h"
@implementation IBAppDelegate
@synthesize label;
{
self.label.backgroundColor = [UIColor colorWithRed:1.0f
green:0.8f
...
Is it possible to get a list of applications installed on the users computer that could be used to open a file (in my case an image), similar to the list shown through the Finder's "Open With..." menu?
...
I'm trying to implement some rudimentary tabs in a Cocoa editor I'm working on. I am using an NSSegmentedControl and adding segments to it as tabs. I'm using a custom NSSegmentedCell subclass for the tabs to draw a little 'x' icon next to the text for closing tabs and so far it's been going pretty smooth.
However, I cannot figure out ho...
This seems awfully basic but here goes. If you are keyboard-oriented you get used to using Command-W to close windows all the time in OS X. I'd like to add that capability to the dialogs I am creating in Interface Builder for my program. I can see how to add a keyboard equivalent to a button action but what if I don't have a button?
Sh...
The short version:
Why are the subviews of NSView objects not sent a release message when a Cocoa application terminates?
Is there a way to override this behaviour?
An example:
The MyView class shown below is nothing more than an NSView subclass that reports to the console when it is created and destroyed. I have tested it out and ...
For PDT, I would want "-0700".
I'm getting a date in the past to determine how long ago something happened.
NSDate *then = [NSDate dateWithString:@"1976-04-01 12:34:56 -0700"]; // Note the hard-coded time zone at the end
I'll be constructing the date string elsewhere but I don't know how to access the local time zone.
I read the App...
Hello
I've got three entities in my application so far: tag, feed and story
A tag has got a to-many relationship to feeds and feeds has got a to-many relationship to story.
I've got an NSArrayController for each entity, one named tags, one named feeds and one named stories.
They all share the same 'managedObjectContext' which they ge...
Can u pls show a good example on how to use Google Toolbox for Mac for UI unit testing.
And every time do i need to have a master image to compare with.
Can i use it for testing whether pressing a button has called the right action??
Thank you
...
If I subclassed a UIView from interface builder, and now need an instance of that subclass in my app controller, how would I get that reference (To the subclass and not the UIView)?
...
I am fairly new to OSX development, so this may be easy but google has not been helpful.
I am trying to bind an action to the media keys you find on newer Apple keyboards (Play, Pause , etc). It appears that you cannot bind to these keys using the regular hotkey API but it must be possible since iTunes clearly manages. Is there some tr...
When I use GLUT, I can provide a callback function that gets called once per frame to generate or animate the frame content.
How do I do the same thing with Cocoa?
I understand there's setNeedsDisplay, but I don't know how to avoid calling it more than once per frame. What I need is an event or other callback that tells me when to draw...
Hi All, I am very new to the iPhone SDK and have read many threads on RESTful service integration with the iPhone. However I am none the wiser. Can you help?
I have some PHP and a MySQL database string on a server. I POST 3 pieces on information from the iPhone to the PHP which then does some thinking and chatting to the database.
It t...
I'm working on a Cocoa project with some C in it (I know, objc contains C...) and am trying to understand NSNotificationCenters. Here's the situation:
I have a struct declared as typedef struct {/*code here*/} structName;
In my - (id)init method, I have
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(selName...
Hey guys, I'm running the following code on my phone, where 'object' is a Cat, which is a subclass of Animal. Animal has a property 'color':
NSLog(@"Object: %@", object);
NSLog(@"Color: %@", [object color]);
NSMethodSignature *signature = [[object class] instanceMethodSignatureForSelector:@selector(color)];
NSInvocation *invocation = [...