I have a PDF document that is created by creating NSImages with size in 72dpi pts, each has a single representation which is measured in pixels. I then put these images into PDFPages with initWithImage, and then save the document.
When I open the document, I need the resolution of the original image. However, all of the rectangles that ...
I'm looking for the right way to handle "mouse held down in one spot" events in my NSView subclass.
I am familiar with Cocoa's mouseDragged: event, but it is only triggered when the mouse moves. If the mouse stays in the same position, no drag event is triggered. Similarly, mouseDown: is only fired when the button is first pressed. My v...
I have a C++ application using the QT framework. I'm trying to add an option for the user to be able to set the program to start automatically on startup.
My development machine is running OS X 10.6.
As my main Mac reference, I'm using this Apple documentation. According to the documentation, there are two recommended ways of doing thi...
I could not really find this in the documentation ...
I'm writing some unit tests and one of the tests that is supposed to fail is [NSURL URLWithString: @"cow"]. Because cow is not a valid URL.
However, it is happily parsed by NSURL with no errors at all. It does not return nil and it does not throw an exception. Calling [url absoluteS...
I'm new to iPhone development, and I've just run my iPhone app throught the Intruments Leaks tool for the first time, and discovered a leak with my ListViewController dataArray method.
When I click on the listing it shows the code, and a few lines have percentages next to them. Presumably they're the lines that are leaking memory. I've ...
There are two classes, let's call them Class A and Class B.
Also, in class B, there's a NSMutableArray called arrayB.
@interface A {
// for reference functions in B
B *obj;
}
@property (assign) B *obj;
- (void) addObject: (id) objectB;
And I access B by calling:
obj = [[B alloc] init];
Here's definition of B:
@interface B...
I've got a CIImage with an alpha channel. Big portions of it are fully transparent. I'd like to find the minimal axis-aligned bounding box containing the full nonzero-alpha region, and crop the image to this bounding box. Similar to the "auto-crop" feature in GIMP.
How should I proceed?
...
When I was reading about the new 4.0.2 iOS update I wanted to know what hackers do or try doing with a buffer overflow, which after some wikipedia'ing got me interested in playing with malloc and thus creating my own "NSObject".
I am not actually planning to use this in any of my applications, its only for learning and playing around wi...
I am currently working on a project build for OSX 10.5 and up.
First of all, the 10.6 users do not see this; only 10.5 users have this issue.
You are not able to reproduce this on 10.6.
In short: when placing an custom extended class of NSView with an overload implementation of - (void)mouseUp:(NSEvent *)theEvent the mouseUp doesn't get...
I am creating a delegate view controller and presenting it to the user to perform an action but I would like to change a NSString on the delegate view controller based on the originating view controller. For example if the delegate view controller is a delegate of viewControllerA, then display Foo, but if its a delegate of viewControlle...
Ok, I'm totally new to obj-c + cocoa, so this is probably obvious, but here goes:
I've been moving from command line apps to cocoa apps in learning how to work with objective-c in Xcode. One thing I don't really understand is the role of the AppDelegate and how it connects to main.m
It seems like you could put your entire program in th...
Hi all,
Cocoa app, SnowLeopard
I have a WebView in to which I'm loading HTML (essentially for application UI purposes).
In the html, I've added:
<body onselectstart="return false" ondragstart="return false">
This prevents text from being selected, which is what I want for this job.
However, whenever the cursor is moved over any te...
I have a connection request working using the stringWithContentsOfURL:encoding:error: method from NSString. I want to be able to retry the connection if it fails the first time. I was going to rewrite the function to use the timeout functionality of NSURLRequest, but I think I'd really like to use multiple retries before failing out.
As...
Hey all, I have a project that I am working on and I have noticed that my NSRect that I draw at a certain x, y coordinate that would be the center for the resolution I am working on, is not the center if the resolution changes. I understand how it all works.
The Issue is that my project is going to be displayed on multiple resolutions ...
After switching to SDK4 Cllocation updates behave strange. Before, the delegate was calles twice or sometimes even 3 times a second if the signal was good. It didn't matter if we were moving or if the movement stopped.
Now, the delegate stops to be called as soon as the movement stops. There might be one or two more calls but thats it.
...
here is a good question
but I just wonder the difference between "bundle display name" and "bundle name" in cocoa application's info plist.
...
Maybe i'm just too blind to RTFM but what is the method to call to reverse the zoom (maximizing of a window) and bring the window back into the old state.
...
Is it possible to badge a dock icon and have the icon persist when the application is quit? iCal does this, but I have not seen it anywhere else.
...
I am definitely a beginner when it comes to Objective-C! Any help would be hugely appreciated.
This code works for me, but I really feel like it will certainly blow up on me in the future. For example, what if someone calls autorelease drain in the middle of a for loop. Also, what the heck is the difference between itemPtr and stackbuf?...
Whenever I set a body on a mutable request with the method set to anything other than POST, the body is not included in the request and I get a kCFErrorDomainCFNetwork error 303 (kCFErrorHTTPParseFailure) when the server replies. Changing the method to POST is all it takes for the request to go through with no error. Is there any way to ...