cocoa

PDFs not showing, Other URLs do.

I am having difficulty with a UIWebView which shows http URLs correctly, but not bundled .pdf files. I have also read alternative solutions such as using QuartzCore framework, however this does not seem to support multiple pages in PDFs. Here is the code that works (for google dot com) - (void)viewDidLoad { [super viewDidLoad]; NS...

Cocoa Touch - Send Messages to Xbox 360 Friends

For my new app Im working on I want to be able to send messages on the app to xbox 360 friends . I Know its possible since they have them on the app store but how would I do it? Thanks for any ideas/code! ...

Quartz 2D Drawing String in Rect, how can I get an ellipsis?

[infoText drawInRect:CGRectMake(10, 10, 310, 40) withFont:infoTextFont lineBreakMode:UILineBreakModeWordWrap]; Any suggestions on how to produce an ellipsis when the text exceeds the size of the rect? ...

How do I add a custom UIMenuItem to the UIMenuController in a UITextView?

I'm trying to add a menu item next to the "copy", "paste" items in a UITextView. I've created a subclass of UITextView and copied the example from apple's docs here: http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadProgrammingGuide/Text/Text.html#//apple_ref/doc/uid/TP40009370-CH8-SW28 I simply created a ...

Validating NSToolbarItem with View against FirstResponder

I've got a toolbar item that contains a view (an NSButton) and the view's target is set to nil, so it'll look up the responder chain when triggering the action. I'm having trouble trying how to validate against the first responder, though. I've subclassed NSToolbarItem and implemented -(void)validate. The references that I've found say ...

Shadow and CCSprite

Hi! Is there way to do the shadow for CCSprite? Thanks, Yakov ...

Creating a GUI for a command-line utility using Cocoa

I'm looking for a way to create a GUI (using Cocoa) to make a command-line utility more accessible to some of my colleagues. If you use NSTask to execute/start the utility, can you then simply use another NSTask to execute the next command (using the utility launched in the previous step)? Does it use the same session, in other words? I ...

Can I use the Cocoa-touch onscreen keyboard in a regular Cocoa application?

I currently have a program written in Cocoa and I would like it to have an onscreen keyboard as I am thinking of using a touch-screen monitor and would like to not have a keyboard for this particular piece of software. I know there is an onscreen keyboard in Cocoa-touch, but as far as I am aware, that can only be used on the iPhone, iTo...

Where did the icon come from?

Is there a unix tool to which I can pass a file and have it tell me where the icon for the file is coming from? What I am looking for is something like this: $WhoProvidedIcon /Path/To/file.myex UTI: com.myapplication.document PLIST: /path/to/myapplication.app/Contents/Info.plist ICON: /path/to/myapplication.app/Contents/Resources/B...

Simple Cocoa modal window dialog on Mac OS X

I am porting a plug-in from 32-bit to 64-bit which is actually in C++. Since Carbon is no longer supported on 64-bit, I have to port some code to Cocoa. The only Cocoa help I need is how to create a simple modal window (not a sheet) that has two buttons, OK and Cancel, and gives me a string input from the user. I created a Cocoa nib, but...

-drawWithFrame:inView: invocation on NSButtonCell subclass

To implement a custom button I've subclassed NSButtonCell and overridden -drawWithFrame:inView: as suggested in Cocoa documentation. Everything's working fine, but why is the method -drawWithFrame:inView: invoked 3 times everytime it needs to draw or redraw the cell? ...

NSFetchedResultsController returning objects with null indexPaths

Details are in the comments. The following code: // Perform the fetch... NSError *error = nil; if (![[self fetchedResultsController] performFetch:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } // Confirm that objects were fetched by counting them... NSLog(@"Number of Objects = %i", [[fe...

Objective-C : Why is my retain count not 1?

I have this very simple program where I just create an object and look at the retain count. #import <Foundation/Foundation.h> #import "GeometryCalculator.h" int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; GeometryCalculator *calculator = [[GeometryCalculator alloc] init...

Get bitrate of video stream with Cocoa.

Hi, I'm trying to get the bitrate of a video stream with Cocoa. Not the bitrate of the overall file but just the stream. I've looked at QTKit's documentation but I couldn't find anything to do this.. ...

CoreData and DataBindings with cocoa

Hi all, I'm developping a little DB book management Mac OSX app with CoreData and DataBindings. I have a TableView with all the book authors. I would another TableView that rapresent all books written by the author selected in the previous table... The both tables are managed with two ArrayController in IB. My problem is that I don't kn...

How To Create a iPhoto Like Interface

Hello, I'm trying to create a iPhoto like application, where using an array of objects I want to display a thumb along with a title at the bottom of each thumb. How do I display objects like iPhoto does? ...

How do I switch out Views in a Cocoa application?

So I'm beginning to learn how to use Cocoa. I think I've pretty much got it but I'm hung up on creating and switching views. I'm rewriting a game I made a little bit ago for practice. All I want is one window (preferably not resizable) and I want to be able to switch out views for different screens in the game. First, I have the main me...

How to have a NSViewController who's view's content depends on the way it's initialized?

This is actually a two part question, hope my explanation is clear: I have an NSViewController which can be configured to show a different custom view on part of its view. For example, its view can show either CustomViewA or a CustomViewB. I was able to make this work by creating an NSViewController for each of the custom views and ini...

How to stop mouse drag events from moving entire window? [cocoa]

I think this should be a very easy one, but I cant find the answer on the docs. I want to stop mouse dragging events which are in (or start in) my custom nsview subclass from causing the window to be dragged around the screen. How can I tell the window to stay still so i can interact with the view instead of dragging the whole window ar...

Is ConnectionKit still usable?

I'm writing a Cocoa app that will need access to multiple file transfer protocols, such as FTP, Amazon S3, etc, and I was planning on using the ConnectionKit framework to implement them. However, even though I managed to get it compiled (which is quite a feat itself), it seems to be missing a number of it's header files, such as the S3 p...