Hi,
In relation to question an eralier question of mine, I have tried and failed to create a class with a NSMuttableArray member variable holding CALayerRefs. Can someone please guide me on how to do that. What I want to do is basically create CALayerRefs or CGLayerRefs or whatever, push them into my layers variable, and then, when I nee...
I am trying to automatically load an image full screen after the application is launched but it looks just a little bit funky. The outside edge of the image view can be seen - how do I eliminate that? My code looks like this:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSImage *imageFromBundle = [NSIma...
I am writing an app that automatically has an image load full screen immediately after the app is launched. When this happens, it seems that the only way for the user to get out of this full screen mode is to CMD-Q and quit the app. How can I set my own custom key stroke combination so the user can exit full screen mode and edit the ap...
I'm creating an application which should show a progress bar in the dock icon. Currently I have this, but it's not working:
NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 10.0f, 20.0f)];
[progressIndicator setStyle:NSProgressIndicatorBarStyle];
[progressIndicator setIndet...
I have very simple circular (or self-reflecting) relationship core data model in my iPhone word game.
Entity Word has one-to-many relationship to/with itself which points to related words:
I use NSPersistentDocument Core Data Mac OS X template application to import words to Core Data sqlite database.
After importing data I can see al...
Specifically, I want my "New" menu item to respond to both Cmd+N and Cmd+T since it will open a new document in a tab.* How can I do this either in Interface Builder or programmatically?
* I can explain the reasoning further if needed, but I'm hoping to avoid a discussion of the merits and rather focus on how to do it, not why to do it....
Hello,
I am trying to create a simple framework with a nib that has a button on it which can be customized (selector wise and title wise.) for this, i did the following:
I added a property:
@property (nonatomic,retain) NSButton*accessoryButton;
and connected it to my outlet:
@synthesize accessoryButton = littleButton;
I then shar...
In a Cocoa app generally we can install a plugin bundle in one of a number of places. If for example the app is called "MyApp" you'd be able to install the plugin at:
/Applications/MyApp.app/Contents/PlugIns
~/Library/Application Support/MyApp/PlugIns
/Library/Application Support/MyApp/PlugIns
/Network/Library/Application Support/MyAp...
Hi! In Cocoa Fundametals I found following code:
@interface ValidatingArray : NSMutableArray {
NSMutableArray *embeddedArray;
}
@end
@implementation ValidatingArray
- init {
self = [super init];
if (self) {
embeddedArray = [[NSMutableArray allocWithZone:[self zone]] init];
return self;
}
@end
But I don't understand this l...
I'm writing an Objective-C wrapper for a C library and having problems accessing the references of my ivars.
The C library requires that I specify a function pointer that handles events, I specify it during the initialization of my Objective-C class.
- (id) init {
[super init];
RegisterClient(
return self;
}
The C librar...
I have an application that will play a series of radio stations by choosing them from a drop down menu. Ideally I'd like to add some code, so that a spotlight search that would return any of the items in the dropdown and open the application as if you did this from within the application itself.
The spotlight documentation gives no clue...
Hi,
How can I create a brown noise generator using Cocoa?
BTW Brown noise is similar to pink and white noise and has nothing to do with "The brown note" or anything silly. See http://www.mediacollege.com/audio/noise/brown-noise.html
...
How would I be able to run an IBAction based on another event? For example I could use a piece of code to run an IBAction.
What I'm trying to do is have two different buttons run one or more IBActions.
...
I've overridden an NSOpenGLView to handle keyboard events. The event detection is working fine, but every time I press a key I hear and annoying bump sound. How can I tell my view to chill out?
Here's what my keyUp: method looks like:
-(void) keyUp:(NSEvent *)theEvent
{
NSString *characters = [theEvent charactersIgnoringModifiers...
I want to override initWithContentRect on a subclassed NSWindow, as I've seen done in Obj-C, in order to create a borderless window from a nib.
If I try this:
class GroupWindow < NSWindow
def initWithContentRect(contentRect, styleMask:windowStyle, backing:bufferingType, defer:deferCreation)
super.initWithContentRect(
conten...
I am implementing drag and drop in a cocoa application and I am using the following method from the NSDraggingSource Protocol:
- (void)draggedImage:(NSImage *)draggedImage movedTo:(NSPoint)screenPoint{
The NSPoint is given in screen coordinates and I need it in window or view coordinates. If the method was called with an NSEvent I cou...
Hi,
I am trying to make a custom transparent bordered window(without tittle bar) to capture a part of the screen.This window should be resizeable from the bottom right corner area,and could be moved by dragging any of the border lines.This window should be such that, it could also be moved over the apple menu.
I am very new to Cocoa, C...
Hi, I want to write all frames to disk using QTKit.framework for camera input. But all the images I get are half transparent and without some colors, maybe colorspace problem? ;(
They seem good in the preview View but when I write them "something" happens.
I wonder what it that.
-(void)savePNGImage:(CGImageRef)imageRef path:(NSString *)...
I want to include a secret key into an iOS app so that the app can "prove" to a certain server that a request is coming from the app itself and not some other system. I know that simply hardcoding a secret key into the code itself is very vulnerable as anyone can jailbreak their phone and attach GDB to my app's process to get the key. ...
I have the Apress "Learn Cocoa" book (published in 2010 BTW) and I am getting a deprecation error on one of the lines. The code is:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
self.villain = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Lex Luthor", kName, @"Smallville", kLastKnownLocation, [NSDa...