cocoa

Delegate methods not invoked for nssplitview present on top of another nssplitview

I have a horizontal NSSplitView which sits on top of right sub view of another vertical NSSplitView. I have delegate methods to constraint the left sub view from resizing. But the same delegate methods are never invoked for the horizontal NSSplitView sitting on top. What can be done to achieve this? ...

Cannot get Length of a NSString - unrecognized selector sent to instance

What I'm trying to get is to search for the Anime Titile's ID, compare the length and perform some action afterwards. Here is what I get in the debugger: 2010-08-09 14:30:48.818 MAL Updater OS X[37415:a0f] Detected : Amagami SS - 06 2010-08-09 14:30:48.821 MAL Updater OS X[37415:a0f] http://mal-api.com/anime/search?q=Amagami%20SS 2010-0...

Mac/Cocoa weirdness: NSImage projects at 1x0.6 its width !

I load an image. The image loads fine (140x40) I create a window (700x500) I create a subView (700x40), located at the top of the window. when i draw the subview, i checked with a debugger. the dirtyRect is indeed 700x40 in size. I draw the image onto that rectangle, but it draws only as (~530x40), not the 700x40, leaving the top right ...

Performance speed of KVO and NSNotifications?

Should I be afraid of using Key-Value Observations (KVO) and NSNotifications? I'm beginning to use them in my app, but I'm a little unfamiliar with the concept of something that could possibly be triggering an appwide call or automatically doing stuff, and a little afraid of the performance hit that such overhead could bring. Are my con...

How do I create an outline of an image (with transparencies) in a UIImage

Hi! I'm making a game where you can select some NPC's each NPC is an UIImage, and the png that is inserted in that component has transparencies, what I want to do is create an outline of a different color (say blue) of that NPC when it's selected. Thanks in advance!! (By the way I'm a newbie so, if you can post examples even better!!) ...

Is there a preferred way of organizing your source files in a Cocoa app?

Initially, I've just been sticking with the default generated application structure of my Cocoa app: /Classes for all source files (.m and .h) /Resources for Nibs and other obvious resources However, as my application is growing, I'm finding that it's less organized then I'd like in the Classes folder with everything at the root leve...

how to programmatically send email using objective C / cocoa

Hi I am new to MAC OS development and I want to send an email programmatically trough an application, but without using Mail app like in SBSendEmail from apple's site. I dont want to attach any attachments, just a plain text email. What is the best and easiest way to do this? is it possible to use the basic functionality from SBSendEmai...

How to change startup window locations in Interface Builder

Every time I open a .xib file the View window is partly covered by the Library panel, so I have to drag it to a different location. Is there a way to setup the locations of where windows appear when IB starts? ...

CALayers not showing when drawn the first time

I've been struggling with a strange problem which has arisen in using the CorePlot framework, but which I suspect isn't an error in the framework itself. I'm hoping somebody here will have seen something similar, and can point me in a productive direction. I have a tabbed view in which graphs are shown. The tab that is initially activ...

Objective-C getting User fullpath

Hi guys, im learning Objective-C with XCode. Im tying to get the User full path directory, im getting "good" return, but without the user full path (/User/Asinox), just im getting NSPathStore2. I was trying with NSHomeDirectoryForUser() and with StringByExpandingTildeInPath and the result was the same (NSPathStore2). Im using XCode 3....

"Collection was mutated while being enumerated" on executeFetchRequest

Hi guys, I'm stuck on a problem for hours now and having read everything about this on stackoverflow (and apply every advices found), I'm now officially in need for help. ;o) Here is the context : In my iPhone project, I need to import data on the background and insert it in a managed object context. Following the advices found here, ...

Closing the NSPanel issue

very unusual problem i'm getting if i press the close button of panel, panel closes but when i press a custom button and calls this close function panel doesn't close. If i mark a breakpoint in close function and continue with execution then panel gets close...i'm confused. why panel doesn't close on normal execution but closes when i ma...

Cocoa Simulating mouse event

Hi, I am able to simulate mouse click event using the following code-snippet. CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); CGEventRef theEvent = CGEventCreateMouseEvent(source, type, point, button); CGEventSetType(theEvent, type); CGEventPost(kCGHIDEventTap, theEvent); CFRelease(theEvent); ...

Creating a custom Image gallery that looks like Safari's "Show Top Sites" in Cocoa

Hi All, I am trying to create a view which shows similar the way of Safari's "Show Top Sites" option. I have bunch of images to be displayed in that gallery view. Any idea or suggestion to create this in my cocoa application. Thanks in advance. ...

NSTimer selector calling

Can someone explain to me how exactly the NSTimer behavior is? Basically I want to know if there is a way to always have the NSTimer event happen. Event if there is currently something executing. For example, in: NSTimer* testTimer = [NSTimer scheduledTimerWithTimeInterval:.01 target:self selector:@selector(testMethod) userInfo:nil re...

What's the most Cocoaish way to show that a text field is invalid?

I have a text field which is validated whenever it loses focus. I want to be able to indicate that the value invalid during input so the user has the opportunity to correct their mistake before explicitly moving focus away from the box and triggering validation. I have seen various implementations, including placing a red border round t...

access a variable of another class via a property

hi all, I have two classes,In classA I create a variable that I need to use in classB , should i use property ? is there anyone to explain me easier ,how to set StringValue of variable in one class to the textfield of another class? thanks ...

How to change flash drive name using cocoa on Mac OS X

Hello, as stated in the subject, I am looking for a way to change a Flash Drive name/label which is appear on the desktop when the volume is mounted. I have tried different ways: 1) Disk arbitration 2) Just rename as a File using NSFileManager Thanks in advance, Vladimir ...

fast album art thumbnail handling like iTunes?

Im working with a few guys on trying to develop an app that requires some thumbnail scrubbing to handle album and tv show / movie art work in a grid view.. Much like iTunes does! But were having some trouble with getting the grid view to match the speed and agility of iTunes. Anyone have suggestions on what to use in Cocoa UI world to...

What's the code equivalent to the autoresizing mask anchoring options in IB?

How can I get a NSTextField (or any object) to respect the autoresizing options below via code? I want to add new objects to the view dynamically, but when I increase the height of the view, they are anchored to the bottom left, as opposed to the top left as shown, and so new textfields are dropped on top of the old ones. Is this even p...