cocoa

How do I actually use Authorization Services?

I've been searching and experimenting for nearly four hours now, so I'm gonna just ask straight up: How can I correctly use the Authorization Services API to show the user a system-level authorization window, the same one you see when you click a lock icon in System Preferences? From what I can tell, there is no way to do it using Coco...

disconnect to wifi progammatically

Could i disconnect to wifi progammatically in cocoa ? ...

Cocoa Core data filename?

I followed Apple's example for creating a managed object which btw was great... http://developer.apple.com/cocoa/coredatatutorial/index.html However I now want to know what "name" (filename) the user saved his data as. Does anyone know how to pull the filename from the core data object. something like this would be great... NSLog (@...

Changing window title color

Hi, How can i change the window title color of a Window. I want to change the default black color text to some other color. ...

Get application icon from ProcessSerialNumber

I would like to get the application icon for all foreground applications running on my Mac. I'm already iterating over all applications using the Process Manager API. I have determined that any process that does not have the modeBackgroundOnly flag set in the processMode (as retrieved from GetProcessInformation()) is a "foreground" appli...

Converting NSData to an NSString representation is failing

Hi there. I have an NSData object which I am trying to turn into an NSString using the following line of code: NSString *theData = [[NSString alloc] initWithData:photo encoding:NSASCIIStringEncoding]; Unfortunately I am getting the following result, instead of my desired binary output (can I expect a binary output here?); ÿØÿà I'd...

Objective-C Charting Framework

I'm in urgent need of an Objective-C/Cocoa/Cocoa Touch framework to handle simple charting; pie chards, histograms etc. The only thing that comes close is: http://code.google.com/p/gchart-objc/ But it seems to be quite an early release and not maintained. Has anyone created or used such a framework or library. ...

Problem upgrading eclipse rcp app from 3.3 to 3.5 on Mac OS

I previously had an eclipse rcp app based on eclipse 3.3 pugins deployed on both windows and mac OS X 10.4. i'm now trying to port the app to java 1.6 and eclipse 3.5 (Build id: 20100218-1602) plugins on Mac OS X 10.5.8 (Leopard). I can launch the product from eclipse 3.5 on windows but not on Mac OS X. I have the 64bit cocoa eclipse ID...

iPhone/Cocoa Coding Standards

Are there any generally-accepted coding standards (naming, casting etc) that apply specifically to iPhone/Cocoa/Objective-C? I know Microsoft has published similar standards as they relate to .Net and C# but haven't run across anything related to the iPhone world. ...

Problem using decodeObjectForKey?

I am trying to learn how NSCoding works, but seem to have come accross an issue when I try and unachive a previously archived object, this is what I am doing ... // CREATE EARTH & ADD MOON Planet *newPlanet_002 = [[Planet alloc] init]; [newPlanet_002 setName:@"Earth"]; [newPlanet_002 setType:@"Terrestrial Planet"]; [newPlanet_002 setMas...

Class level attributes in Objective-C (remove warning)

Hi, I've read somewhere that Objective-C doesn't have class level attributes, but that the same can be achieved by declaring something like this (before the class interface): static NSInteger initCount; I'm initializing the variable to zero with the initialize method: // interface + (void) initialize; // implementation + (void) ini...

How to load object after saving with encodeWithCoder?

EDIT_002: Further rewrite: if I save using the method below how would the method to load it back in look? (moons is an NSMutableArray of NSNumbers) // ------------------------------------------------------------------- ** // METHOD_002 // ------------------------------------------------------------------- ** -(void)saveMoons:(NSString ...

Filter entire NSDictionaries out of NSArray based on multiple keys

Hi, I have an NSArray of NSDictionary objects which I would like to be able to return a new array of NSDictionaries from, where every NSDictionary has "Area == North" (for example). The closest example I have found so far is http://stackoverflow.com/questions/958622/using-nspredicate-to-filter-an-nsarray-based-on-nsdictionary-keys but ...

Referencing to objects from anywhere in Cocoa

What's the best way to reference to a dynamically allocated object (particularly interface elements) so I can access them from everywhere in the current class? @synthesize? declaring the object in the interface section? anything else? ...

Cocoa multi window drag and drop example

I am looking for a cocoa example that illustrates how to drag an image from one window to another. If not I would like to see an example that shows dragging an image from a source and destination in the same window. If anyone has a link to any such examples I would greatly appreciate it. ...

popUpButton is setEnabled:YES but doesn't allow click...

my popUpButton is in a window with a group of popUpButtons. If I try to click the 2nd of 4 vertically aligned buttons then the popdown menu will not appear. If I select the 3rd or 4th then the 2nd will now be selectable. throughout my code the setEnabled on that popUpButton is :YES. ideas on where to look in my controller? This is a...

Localizing concatenated or dynamic strings

I'm familiar with using NSLocalizedString() to localize strings, but the problem I have today requires a little more finesse. My situation is like this: NSString *userName; //the users name, entered by the user. Does not need localized NSString *favoriteFood; //the users favorite food, also entered by user, and not needing localized ...

Drawing a PDF Right-Side-Up in CGContext

I'm overriding the drawRect: method in a custom UIView, and I'm doing some custom drawing. All was going well, until I needed to draw a PDF resource (a vector glyph, to be precise) into the context. First I retrieve the PDF from a file: NSURL *pdfURL = [NSURL fileURLWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathCom...

displaying mac address in right format

Hi, I am obtaining the mac(hw) address of an interface using CWNetwork. Now OS X gives me this mac address in the xx:xx:xx:xx:xx:xx format. But if the first digit is 0, OS X will output the address as 4:aa:dd:ee:34:40, instead of 04:aa:dd:ee:34:40. Now I am trying to take this string 4:aa:dd:ee:34:40 and convert it to 04:aa:dd:ee:34:40 ...

Saving CFPropertyLists To Users Folder

I'm trying to save a CFPropertyList to a location in the user's home folder. Using the code below I'm getting errorCode = -10 (unknown error). CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("~/testfile.txt"), kCFURLPOSIXPathStyle, false ); SInt32 errorCode; Boolean status = CFURLWriteDataAndPropertiesTo...