cocoa

Using core data, is the a way to automatically delete an entity when a to-many relationship falls below the min-count?

I have a core data model which includes an entity with a to-many relationship. I have set the relationship to non-optional and set the 'min count' to one. However, I can't work out a way of acting on this rule once it has been breached. Ideally I'd just like the entity deleted... but I can't figure out a way to do this automatically, or ...

Why does the row at the bottom of my outline view get deleted when I click the remove button rather than the one that is selected?

When I select a row in my outline view (connected to a NSTreeController) and click the remove button it doesn't delete the row that I have selected but actually deletes the row at the bottom of the table. For some more information here is my Connections for the Button: http://snapplr.com/t1hm and the Entity model: http://snapplr.com/k...

Index of the change in an NSArrayController

I'm programmatically observing the arrangedObjects of an NSArrayController and am having problem getting the index where something was changed. Is it at all possible to get the Index/IndexSet where the change occured. It seems like it should be, since NSKeyValueChangeIndexesKey is defined for the change-dictionary. When inspecting the ...

Why isn't my UILabel being changed?

Why isn't my UILabel being changed? I am using the following code, and nothing is happening: - (void)awakeFromNib { percentCorrect.adjustsFontSizeToFitWidth; percentCorrect.numberOfLines = 3; percentCorrect.minimumFontSize = 100; } Here is my Implemintation code: - (void) updateScore { double percentScore = 100.0 * va...

Using NSPredicate to filter an NSArray based on NSDictionary keys

I have an array of dictionaries. I want to filter the array based on a key. I tried this: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(SPORT == %@)", @"Football"]; NSArray *filteredArray = [data filteredArrayUsingPredicate:predicate]; This doesn't work, I get no results. I think I'm doing something wrong. I know th...

Cocoa Utility Class

I think I'm missing something pretty basic here. I have a Utilities class that has some functions that are called from a few different classes. I want to be able to include Utilities.h and just say [Utilities doStuff] and have the doStuff function in Utilities.m be executed, what's the easiest way to do this? ...

Files imported when importing <Foundation/Foundation.h> for Cocoa?

Just curious, what files are included when <Foundation/Foundation.h> or <Cocoa/Cocoa.h> is #imported? The framework and all the files in /usr/include? ...

Mac developing - building an application with toolbar

Hi, I am new to mac developing, and kind of confused. I am trying to create a program with a toolbar, but can't seem to get it working. Can anyone explain me the steps needed to do this? Beside, is there any control on the mac developing system similar to iPhones UITabBarController? Thanks, Hans Espen ...

How to draw your own NSTabView tabs?

Hi, I want to draw my own tabs for NSTabViewItems. My Tabs should look different and start in the top left corner and not centered. How can I do this? ...

Profiling Objective-C binary image size

I'm looking for tools and approaches to determining what parts of of my Cocoa and Cocoa-Touch programs are most contributing the the final binary image size, and ways to help reduce it. I'm not looking for a "magic bullet" compiler flag. I'm looking for profiling techniques for evaluating and reducing image size waste in the same vein as...

Declare String then open string from Path with Cocoa

I've Declared a string Like so NSString* fileName = [files objectAtIndex:i]; NSLog(fileName); NSImage* imageFromBundle = [[NSImage alloc] initWithContentsOfFile:fileName]; and want to use that filename to open a file in a different directory. I came up with this NSImage* imageFromBundle2; imageFromBundle2 = [[NSImage alloc] i...

Why does linker complain about missing symbols?

Why am i getting this weird error? Any Ideas? implementation: #import "VideoView.h" #import <MediaPlayer/MediaPlayer.h> @implementation VideoView @synthesize player; - (void)playVideoWithURL:(NSURL *)url showControls:(BOOL)showControls { if (!player) { player = [[MPMoviePlayerController alloc] initWithContentURL:url]; ...

Launch window from NSView subclass in cocoa

Is it possible to launch a window in an NSView subclass by clicking a NSRect? I have tried makeKeyAndOrderFront but this doesn't work. ...

How would you make the text in a checkbox cell be able to be edited?

How would you make the text in a check box cell able to be edited like in a text cell instead of it just checking the Checkbox? The thing is that the Checkbox is Boolean in the Core Data Model and the Text is a String, so I don't know how I would make this work. ...

How would you make The Dock Icon show a window when clicked?

This Is Similar To One Of My Earlier Questions That Never Got Answered. I would like the Dock Icon to use the method makekeyandorderfront to open the Main window after it has been closed. I have done this with a button opening a Window but I don't know how to do it with the Dock Icon because you can't make a connection to it in interface...

Xcode : Garbage Collector Setting

I just realized for my cocoa application I can set the garbage collector setting for the target but also for the project. My app did crash since I activated GB only in the project properties not in the target properties like I used to do. Changes in the project settings did not apply to the target settings. What use is the Garbage Coll...

How do I get Mac system icons, as in the Finder?

I want to set the images in my outline view to the system icons, just like on the left in the Finder. I want to get icons like Application, Documents, Desktop, etc. How do I do this? ...

OSX Audio Hijack style audio recording from other applications (cocoa)

Hi basically I am lost in apples documentation and not sure where to start on this. I need to record the audio from applications running on my system, similar to audio hijack and wiretap studio pro, but I am unsure where to start with the audio captuer. I see reference to quicktime capture documentation but it is not clear how to achei...

Add media from iphone (outside of iPod library) into iTunes

Is there a way for my iPhone app to add media (mp3s) not in its iPod library to iTunes once the user plugs/syncs to a desktop such that the media will get sync'd back into the iPhone's iPod library? I know the question is rather general, but if it is indeed possible, can anyone nudge me in the right direction? ...

Get text field info out of loaded webpage - Mac OS X Development

Hi, I am a newbie in the Mac world. I need to create an app that is able to extract information entered on a web page, from text fields. My app will load a webpage hosted somewhere, and within the webpage there will be a a series of text fields and a submit button. Once the button is clicked, I must be able to read the information ente...