objective-c

Image from WebView dragged onto IKImageView

I have WebView where I load content of webarchive. In the same view I have IKImageView outlet. Image drag n drop from web view onto image view doesn't work for me. What is weird, it works when I drag photo e.g. from iPhoto onto the same image view. Also, I can drag image from my web view onto NSScrollView (which creates a link to the im...

uint8_t to float in objective C

How to convert 4 uint8_t array elements into float in Objective c? I tried the shift operator and it doesn't seem to work:( ...

How to create a Finder alias in an application

What is the code necessary to create a Finder alias from a Cocoa application? Are there any differences between that code in Mac OS 10.4, 10.5, and 10.6? ...

Creating a ZIP archive from a Cocoa application

Are there Objective-C classes that are equivalent to the ones contained in the Java package java.util.zip? Is to execute a CLI command the only alternative? ...

Class object in Objective C

I am coming from Java to Objective C, and the idea of a class object has me wondering about similarities with Java. From the Objective C guide in Apple documentation: A class definition's information is compiled and recorded in data structures made available to the runtime systems. The compiler creates just one object, a class object...

IKImageView zooming controlled by an NSSlider.

What's the best practice for setting zoom factor of an image within IKImageView via NSSlider? I was able to bind a slider either to zoom in OR zoom out action of an IKImageView. Obviously, what I'd rather see is a single slider controlling both those actions. Best, if image is refreshed after each change of the slider (continuously, eve...

Problem initializing an object with init in Objective-C

Hello, I have an object that i intalize it's propertis with call to an init function, it works fine, when i tried to add another object and intalize it the first object didn't get the properites, how do i initalize it to more then one object with diffrent or the same properties? - (void)viewDidLoad { pic1 = [[peopleAccel alloc]...

UITableViewCell reorganize subviews when the 'delete' button appears

Hi everyone! Does anyone knows any method to resize subviews(I.E. UILabelView) when Delete button appears. There could be two methods: 1.Capture a notification, if there's one, when the button appears in the UITableViewCell 2.Tell the framework re-arange it automatically. ...

Selecting A Row In An NSTableView Programatically.

I want to Select A Row in my table view programatically, I believe I would use selectRowIndexes:byExtendingSelection: (is this a delegate method?). The other thing is how would I use that method to select the second row (in programming terms row 1)? ...

iPhone coding - How to add a rotation to the touch event?

Ho can i add a rotation to the object addition to the dragging ? i dosen't have to be multi touch. code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; currentTouch = [touch locationInView:self.view]; CGFloat dx = currentTouch.x - carMove.position.x; CGFloat dy =...

NSInvocationOperation Memory Problems on iPhone

Hi, I've been experiencing memory problems (the app will run for a couple of iterations, then receive low memory warning and finally be terminated) while working with NSInvocationOperation in a method called repeatedly by a NSTimer. The method will be called every 1/4 of a second and I've narrowed down the source of the problem to the ...

How can I override a getter on a propery when using Core Data?

I want to be able to override the getter on a string property on one of my core data models and inside the getter I need to find out what the value is for that property. @interface LabTest : NSManagedObject { } @property (nonatomic, retain) NSString *status; @end @implementation LabTest @dynamic status; - (NSString *)status { NSS...

UIDatePicker graphical glitch

I'm experiencing a bad looking graphical glitch with UIDatePicker, and I'm wondering if anyone else has seen and/or resolved it. It is something non-deterministic, because every once in a while it goes away and looks normal. Check out the highlight and shadow bars are shifted... I have tried removing all other graphical elements. I...

String identifies iVar to update

I have a series of 5 iVars. (highscore01, highscore02, highScore03, highScore04, highScore05) I want to update a particular iVar with an integer value. The iVars are defined as ints. The iVars are in a Class called HighScores. The particular iVar to be updated is the one with the lowest current value stored in it. I want to replace the ...

NSZombie on a distributed application

Is there any danger in compiling an application for distribution with NSZombie still enabled? I generally leave it turned on for all of my apps while developing because of how useful it is, but I don't understand the full ramifications and potential issues related to enabling it and leaving it on indefinitely. Thanks! ...

Drawing text in a NSButton subclass

How would I add the text from the title of the button in my NSButton subclass? ...

iPhone app crashing with objc_msgSend when combining pushViewController and presentModalViewController

Hi all Here's the scenario: On my iPhone app (OS 3.1.2), I've got "view 1" which navigates to "view 2" using a pushViewController call. Then, on "view 2", the user can optionally call "view 3", which is displayed using presentModalViewController and an animation (flip horizontal transition). I can switch view 1 <-> view 2 back and forth...

Encoding issue: Cocoa Error 261?

So I'm fetching a JSON string from a php script in my iPhone app using: NSURL *baseURL = [NSURL URLWithString:@"test.php"]; NSError *encodeError = [[NSError alloc] init]; NSString *jsonString = [NSString stringWithContentsOfURL:baseURL encoding:NSUTF8StringEncoding error:&encodeError]; NSLog(@"Error: %@", [encodeError localizedDescripti...

Cocoa HUD window - how to turn off topmost?

I've wrote some small cocoa app and it's main window has HUD style. The problem is - when I set HUD style Interface Builder automatically also sets Utility style - which make the main window topmost (always visible over every other windows). Is there a way to get HUD style panel/window but without making it topmost? ...

resignFirstResponder

Hi, I have a litle problem resigning the keyboard. I have a table with two sections. In the second section, I load the class "stationenStartCellNumber" which has a UITextField. When I press anywhere outside of the UITextField, I want the keyboard to resign as first responder, and thereby closing the keyboard. It works perfectly inside...