Hey there, so I've got an NSObject subclass sending out a message via the notification center, and I'm sending out my notifications out to the object nil but the only object that can receive notifications is the one sending them
I've got two notifications being sent out at the same time (to test if it is a threading issue)
[[NSNotif...
Hi all,
I am trying a simple drag and drop application:
I am creating a CameraIconView (subclass of NSView, containing some image views, text fields and a pop-up button), at run time.
This view is enclosed within CameraIconEnclosingBox (subclass of NSBox)
Requirement is: user should be able to drag CameraIconView at some other locatio...
I'm trying to bind a bare esc key press to an NSMenuItem that toggles full screen (currently just a stub function). Manually selecting the menu item sends the desired IBAction. When I set the NSMenuItem's Key Equiv. in Interface Builder to an arbitrary bare key (eg. w) that key command sends the desired IBAction. When I set the Key Equiv...
I've got a simple test app with a custom view (set up in Interface Builder) with its origin at (20, 20). When I get a mouse event at the lower left most point in the view, the event's location is being reported as (20, 21) and the converted point at (0, 1). I'm using pixie to make sure I'm clicking right at the lower left corner. (If I...
I am sure it's something easy, and I am not looking to the right documentation.
I need to get information about the application that handles the active window. The code I need to write needs to intercept some custom gestures, and return to the application an event that depends from the application itself.
...
I'm writing code in AppleScript to glue an Obj-C Cocoa app to some other stuff. I'm very unfamiliar with AppleScript on also learning Cocoa, so of course I have all kinds of bugs in my code to work out, and I need at least some logging.
However, output from the AppleScript 'log' command doesn't seem to end up in XCode's debugger consol...
I'm trying to calculate the median of a (small) set of NSNumbers in an NSArray. Every object in the NSArray is a NSNumber.
Here is what I'm trying, but it's not working:
NSNumber *median = [smallNSArray valueForKeyPath:@"@median.floatValue"];
...
How would one go about creating a 15 second countdown timer..I've seen NSTimer but was wondering if their was an easier way.
Thanks!
...
I've got a Hybrid Cocoa/Webkit application that has extensive Javascript usage, and seems to break every time Apple updates the Safari browser (or the underlying webkit framework in OSX). I understand it will probably mean a much bigger binary, but is there a way to force my application to use an older, bundled WebKit framework vs. the ...
I need to take the contents of an NSView and put them in an NSImage, for an experimental project. Is this possible? I did some Googling, tried two methods that I found - but they didn't really work. Any suggestions?
...
Let's say I have a method that takes a class, which is called like so:
[registry registerClass:[MyClass class]];
How do I interrogate the class inside -registerClass:?
-(void) registerClass:(Class)typeClass {
// Verify that instances of typeClass confirm to protocol / respondsToSelector
// ?
// Do stuff
// ...
...
I'm working on a Mac app that uses a toolbar in it's main window. In the menu there is an item that allows the user to show or hide the toolbar. In Interface Builder this menu item is connected to the toggleToolbarShown: method of First Responder in my MainMenu.xib. FWIW, my main window is in a different xib and toggleToolbarShown: is co...
We're working on a project using some custom views. We have the following hierarchy:
UIViewController -> UIScrollView (custom subclass) -> UIView (custom subclass)
We are presenting a grid of buttons that are dynamically generated. When a user taps one of the UIViews that belong to the custom scroll view we fire a method that looks lik...
Hi everybody. Is there a way I can change the color space of an NSimage or NSBitmapImageRep/CGimage or the like. I am open to any way. Preferably the way photoshop does it.
...
Suppose I'm calling class method + (NSStatusBar *)systemStatusBar:
NSStatusBar *sB;
sB=[NSStatusBar systemStatusBar];
My question is what's the best way to trace that class method call and find out what it is calling in terms of other methods and arguments?
Does this entail advanced disassembly beyond what XCode provides?
Thanks
...
Dear all,
I wrote the delegate of CPPlotDataSource like this:
-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index {
NSNumber *num = [[dataForPlot objectAtIndex:index] valueForKey:(fieldEnum == CPScatterPlotFieldX ? @"x" : @"y")];
if ([(NSString *)plot.identifier isEqualToStrin...
Hi,
I'm trying to create WebView object programmatically:
WebView *webView = [WebView alloc]; // referencing error
:(
Any ideas ?
Thnx!
...
Hi everyone.
In my app I add an CFMachPortRef (via CFMachPortCreateRunLoopSource) to a threads CFRunLoop
Now i was asking myself, can this be done using GCD? Let's say instead of spawning my own NSThread and add the created CFRunLoopSourceRef to its run loop via CFRunLoopAddSource, add the event port to a dispatch's runloop?
I think t...
I'm trying to subclass NSScroller in order to draw my own scroller knob. To do this, I've subclassex NSScrollView and usex the following code to instantiate my custom NSScrollers:
- (void)awakeFromNib;
{
NSRect horizontalScrollerFrame = [[self horizontalScroller] frame];
NSRect verticalScrollerFrame = [[self verticalScroller] fr...
I'm trying to disable the CMD+Tab application switcher, so that my application can register that hotkey. I'm looking for something that applications like Witch and LiteSwitch X are able to do (i.e. allow users to use CMD+Tab as the hotkey for my application).
How are they able to do that?
...