cocoa

How to draw a histogram chart in cocoa

Hi, As per My requirements i need to generate a histogram chart using cocoa framework and objective c. If any one knows the solution please let me know ASAP. Thanks, Ravi ...

Renamed methods with "Deployment Target" and weak-linking in Cocoa Touch

In the iPhone SDK 3.2, [CLLocation getDistanceFrom:] was renamed to [CLLocation distanceFromLocation:]. My project is compiled with 3.2 as the Base SDK and a "Deployment Target" of 3.0, meaning frameworks only available in 3.2 are weak linked so my app can still run on 3.0. If I change my calls to use the new name distanceFromLocation:,...

Drop down view in cocoa

I'm looking to create a 'drop down' view that falls in front of the main window. An example of this would be the window that drops down when you click 'Advanced' in System Preferences->Networking. If someone could point me in the right direction documentation-wise that would be great. Thanks in advance. ...

How to integrate AdBannerView in Cocos2d

Hello! I'm trying to integrate the new object ADBannerView in my Cocos2d game but the banner apears in vertical on the left of the screen when my game is in landscape. This is my code: UIViewController *controller = [[UIViewController alloc] init]; controller.view.frame = CGRectMake(0,0,480,32); //From the official iAd programming guid...

What is CodeResources in Cocoa Mac apps?

I see these CodeResources folders in some of the system Mac apps and some third party apps. What are they? ...

Detect when a Mac OS X window is resized or moved

I am writting an application which must know when a window is resized or moved. I had a look on notifications but it seems it does not do what I expected. Do you have any idea how I can achieve this? ...

I have an Xcode static library project, how do I add a test target to it so I can run it there? (Instead of in a project that links to it.)

I want to be able to test library code in the library target so I don't have to switch over to a separate project to run it. I see how to add a target, but I'm not sure how to set it up to run like the "Command Line Tool" project template does. I tried adding a new "Shell Tool" target, but I don't know how to make it run like one. What ...

Getting Custom NSCell with NSButtonCell instance to handle mouse click/mouse events

OK I'm really stumped on this one. I want to make a checkbox with a NSTextFieldCell combined together. It's important that the checkbox goes ON if the mouse hits the box, NOT the text. I've accomplished this, more or less, but the issue is receiving the mouse event because I click one checkbox in a row, but ALL of them turn to NSOnState....

What is the best way to create a "stop progress" button like in Safari's Downloads window?

The Apple Human Interface Guidelines say: In the Downloads window, Safari uses the free-standing NSImageNameStopProgressFreestandingTemplate image inline with a progress indicator to allow users to stop an in-progress download. The NSImage documentation says something similar. However, creating an NSButton using NSImageNameStopPr...

NSString *predicateFormat how to search two entities....

hello there and sorry for the stupid question but i think i might be missing something simple here and can t figure it out myself. i m trying to search a table view using the following code: - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { NSString...

Creating simple waveforms with CoreAudio

I am new to CoreAudio, and I would like to output a simple sine wave and square wave with a given frequency and amplitude through the speakers using CA. I don't want to use sound files as I want to synthesize the sound. What do I need to do this? And can you give me an example or tutorial? Thanks. ...

Cocoa: Get frontmost window of active application

How can I get the NSWindow object from the frontmost application? What I'm trying to do is a SizeUp, so from my app I could resize the frontmost window of any app. ...

Whats the maximum key length in NSDictionary?

Hey there, I'm currently working on an app which displays a bunch of files in a table, and you can add and remove them and whatsoever. To prevent duplicates in the table, I'd like to create a NSDictionary using the files full path as keys for another NSDictionary which contains all the file information, but I am a little concerned about...

Building two executables in one project

Hi, I've a project that must produce two executables: the main application and an executable that is called by a separate process. I've created the second file in Xcode and added a second target of type Cocoa Shell Tool. I can now build the second executable but when I try to build my project normally I get an error saying there's two ...

Help with pointers in Cocoa

I'm trying to make a simple calculator application in cocoa. The program hangs when I click on one of my buttons. I think I've traced the problem to the part of my controller that adds a digit to the end of the number currently on the display: - (void)updateNumber:(int)buttonClicked{ *self.activeNumberPointer = *self.activeNumberPoint...

Difference between [object variable] and object.variable in Obj-C?

I was working on a program today and hit this strange bug. I had a UIButton with an action assigned. The action was something like: -(void) someaction:(id) e { if ([e tag]==SOMETAG) { //dostuff } } What confuses me is that when I first wrote it, the if line was if (e.tag==SOMETAG) XCode refused to compile it, s...

Cocoa giving error: <Error>: doClip: empty path.

Coco gives error: Thu Jun 10 19:13:56 myComputer.local myApp[####] <Error>: doClip: empty path. But I don't have this function anywhere in my code (can't find by searching in frameworks / project)... Seems a lot of people complain about this because it goes into the console logs, but couldn't find any reason given as to what causes it...

Showing tokens in UITextField

Hi all, I want to get tokens appearance in UITextField as we have in NSTokenField ie. as soon as user enters some name in UITextField it gets enclosed within a token. We have this control in to-cc fields in mail in iPhone / iPod and I want to get similar feature in my application. Can anyone suggest me some solution for it??...

Passing a pointer to a function in objective-c

Hi, i've a stupid questiona about passing pointer. I've this: @interface MyClass : NSObject myobj* foo; -(void)doSomething:(myobj*)aObj; @end @implementation MyClass -(void)doSomething:(myobj*)aObj { cFuncCall(&aObj); //alloc memory and init the object } -(id)init { //init stuff... [self doSomething:foo]; // foo retun 0x0!!! } ...

Under what circumstances would [ [ UIApplication sharedApplication ] keyWindow ] return nil?

In some cases [[ UIApplication sharedApplication] keyWindow ] returns nil. On some devices it's happening pretty often but in general it's sporadic Anyone know the reasons it would return nil? ...