cocoa

OCUnit problem: DevToolsBundleInjection error loading octest bundle

Hi, this is a cross-post of this question @ the ADC forum. Here's the messages I'm getting: /Developer/Tools/RunPlatformUnitTests.include:273: note: Running tests for architecture 'x86_64' (GC OFF) objc9727: GC: forcing GC OFF because OBJC_DISABLE_GC is set 2010-07-14 16:07:42.893 TestXMLDataApp9727:903 Cannot find executable for CFBu...

Cocoa Application Template - MainMenu.xib - Main Window

Hey there, When you create a new application in Xcode, it automatically creates a AppDelegate and a MainMenu.xib. The latter also contains the application main window, which is linked to the AppDelegate as an IBOutlet. What I tried to do is, use a MainWindow from a different xib-file. However, there's absolutely nothing I can do to pre...

CAAnimation that calls a method in periodic animation-progress intervals?

Say I want to animate a ball rolling 1000 pixels to the right, specifying a timing function in the process – something like this: UIView *ball = [[UIView alloc] initWithFrame:CGRectMake(0,0,30,30)]; CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; anim.toValue = [NSNumber numberWithFlo...

error dialog non selectable if thrown when focus is directed elsewhere, osx

I have a finalcut plugin, I can get it to throw an error dialog that normally is closable if I do not bring the focus away from the plugin. If I for example, start the process, switch to Chrome, I see the error get thrown in the background and then click the error's frame,NOT the OK button on the error, the dialog will get stuck behind ...

Cocoa: while(index >= 0) continuing, even though index == -1...

Once again :) I've got the following code: -(void)removeFilesWithPathIndices:(NSIndexSet*)indexSet { NSInteger index = [indexSet firstIndex]; while(index >= 0) { [self removeFileWithPathIndex:index]; index = [indexSet indexGreaterThanIndex:index]; } } Which should iterate through an NSIndexSet. However, th...

Why doesn't NSPasteboard's -types return the union of the contained NSPasteboardItem's -types?

The documentation for NSPasteboard's -types reads: Return Value An array of NSString objects containing the union of the types of data declared for all the pasteboard items on the receiver. The returned types are listed in the order they were declared. Despite this, I have an NSPasteboard with only one NSPasteboardIt...

string manipulation with objective-c

I have a string like this a web url "http://stackoverflow.com/questions/3260091/databases-and-deep-copy" how can i get the second to last section of the url? 3260091 ...

Where to start making an application like ACDsee

Hi I am new to Cocoa, but I would like to give a shot to a project for my college course in programming. Basically what i am trying to achieve is a simple cocoa app that is able to read into a directory, make thumbnails of the supported files, and display the files when double clicked. Basically if you have ever seen ACDsee you know wh...

Animate CALayer hide

I'm trying to hide a CALayer after a few microseconds and I'm using CABasicAnimation to animate the hide. At the moment I'm trying to use [aLayer setHidden:YES]; CABasicAnimation * hideAnimation = [CABasicAnimation animationWithKeyPath:@"hidden"]; [hideAnimation setDuration:aDuration]; [hideAnimation setFromValue:[NSNumber numberWithB...

Do you need to call willChangeValueForKey: and didChangeValueForKey: ?

I thought home-cooked @property setters were supposed to look like this: -(void) setFoo:(Foo *)newFoo { // Safeguards // ... [self willChangeValueForKey:@"foo"]; // Switcheroo // ... [self didChangeValueForKey:@"foo"]; } But I see a lot of code in blog posts by people who've been doing Cocoa a lot longer than I have, wh...

Failing to parse JSON... is the encoding messed up?

I am trying to parse the JSON returned here: http://www.waterwayguide.com/map/php/bridge.php?ll=25.514339,-80.076164 However, I can't parse it as I normally would it seems: NSData *jsonData = [[(ASIHTTPRequest*)[data objectForKey:@"request"] responseString] dataUsingEncoding:NSUTF32BigEndianStringEncoding]; NSLog(@"this prints as expe...

How to remove th COPY UIMenuItem in UIMenuController

Hi Guys, I am developing an iPhone application and worked with UIWebViews. I planned to customize the UIMenuItems thats popped up when i highlight strings in UiWebView (Copy, Select All, Cut, etc.). I tried removing those menuItems but i cannot remove the COPY menu item. I need your help guys. Thanks, ZaldzBugz ...

Negotiating TLS with ESMTP over sockets

I have a simple SMTP client, to which I am attempting to add TLS support. I am unsure as to what occurs after the client issues the 'STARTTLS' command. Most sources (including the RFC itself) describe it as the negotiation of a TLS session, but this is not particularly clear. How does one go about doing this? My client is written in ...

Cocoa Touch - Landscape View

How can I keep my app ONLY in landscape when its using the tab bar templete? ...

Cannot adopt WebKit protocols

#import <WebKit/WebKit.h> @interface MyClass : NSObject <WebFrameLoadDelegate> { WebView *webView; } cannot find protocol declaration for 'WebFrameLoadDelegate' ...

Window list ordered by recently used

I'm trying to create a window switching application. Is there any way of getting a list of the windows of other applications, ordered by recently used? ...

How do I set the picture in a UIImageView

I need to set an image view to display an image here. else if (n == 2) { gamestatus.text = @"The Card is A Two."; // I Need to set my imageview to a picture here. } ...

Accessing IP Address with NSHost

I am trying to get the IP Address using NSHost. With the NSHost object I can use the addresses method to access an array of objects one of which is the IP Address. I fear though that the IP Address may change position in the array from one machine to the other. Is there a way to access this information in a universal way? There was an a...

What can cause a subset of NSResponder action messages to be ignored?

I have created a tiny project that consists of an NSWindowController subclass which opens its window during the app delegate's applicationDidFinishLaunching: method. There are no custom NSWindow or NSView subclasses. I'm trying to override various NSResponder action messages. Some work, some don't. My window controller has the methods ...

Clear example and best approach to NSCollectionView

Hi there. I looked for this on the web, but I could not find any clear tutorial on how to successfully implement an NSCollectionView. How should I proceed? In Interface Builder, I can drag an NSCollectionView to the main view, and I see that there are two other new views in the documents window: I suppose one is the actual NSView insi...