cocoa

Persist and rearrange the order of Core Data records

I followed the Core Data tutorial at http://macresearch.org/cocoa-scientists-part-xxiii-itunes-ifying-core-data-app The finished application displays data in an NSTableView. Is the ordering of the data persistent as well? And is there a way that you can allow drag and drop rearrangements to the order of the records? I am thinking ab...

How to activate (bring to front) in RubyCocoa?

How can I bring my RubyCocoa application to the front? Basically I want to acheive the same result as the applescript line: tell application "Whatever" to activate ...

Send An Action Cocoa - IBAction

I'd like to send an action to another object using cocoa. Ideally i would also like it to appear in the Interface builder. I've tried the apple documentation, but there is something i'm missing. Adding the following, the interface building only shows the action as a received one. - (IBAction)setTarget:(id)anObject; - (IBAction)setActio...

How can I solve this Problem with bidirectional dependencies in Objective-C classes?

Okay, this might be a very silly beginner question, but: I've got an ClassA, which will create an child object from ClassB and assign that to an instance variable. In detail: ClassA will alloc and init ClassB in the designated initializer, and assign that to the childObject instance variable. It's header looks like this: #import <Found...

How do you implement the Method makeKeyAndOrderFront: ?

I am making a new window open and would like to implement the method makeKeyAndOrderFront: for the window, i was wondering what code i would need to enter to do this. Here is some of the code I've already got to open the window: File 1 (The First Controller) #import "PreferenceController.h" @implementation PreferenceController - (i...

In which cases is it a good idea to relinquish using self when accessing instance variables?

This may be a really silly beginner question, BUT: If you have some nice instance variables in your class, such as an UIScrollview *scrollView2 for example, then why should you bypass the getter and setter by relinquishing a [self.scrollView2 addSubview:imageView]; , and rather doing a [scrollView2 addSubview:imageView]; ? I mea...

Why is App window only opening once and then not opening again?

I am creating a app from a tutorial in a book, but I noticed a problem, when the preference window i created is opened and then closed it won't open again, how can i fix this? Thanks. EDIT: I saw another post about this but was still un-answered, so i was wondering if you could answer this for me. EDIT: I am talking about a panel (use...

How to do a full text search in Cocoa?

I need something like Lucene to do an optimized full text search in Cocoa. I am working on an Iphone app to search through a database. Anybody has any luck with other databases. Any help is appreciated. So far, I can only find this. http://github.com/tcurdt/lucenekit/tree/master ...

Is there any way to get the "Me" card from iPhone Address Book API?

So I'm stumped on this one. In Mac OS X there is an easy way to get the "Me" card (the owner of the Mac/account) from the built-in address book API. Has anyone found a way to find out which contact (if it exists) belongs to the owner of the iPhone? ...

What's the difference between [NSNull null] and nil?

Here's a context where I have seen that: NSMutableArray *controllers = [[NSMutableArray alloc] init]; for (unsigned i = 0; i < kNumberOfPages; i++) { [controllers addObject:[NSNull null]]; } why not nil in that place? ...

Where does a Datasource object belong to? Controller or Model?

I'm implementing a datasource object for an UIScrollView. Is that part of the Controller, or part of the Model? I think Controller, but not sure. It delivers the data. But the data could be in sqlite3, files, from the net. So actually I would say it's not from the Data part, since it should be flexible to from where the data comes. What ...

When do you make an underscore in front of an instance variable?

I've seen this at Apple, inside UIPickerView.h: id<UIPickerViewDataSource> _dataSource; why's that underscore there? Does it have a special meaning? A Convention I must know about? ...

mac osx speech to text api How-to?

Hi Gurus, I have a program that receives an audio (mono) stream of bits from tcp/ip. I am wondering if the speech(speech-recognition) api in mac osx would be able to do a speech-to-text transform for me. (I don't mind saving the audio into .wav first and read it as oppose to do the transform on the fly) I have read the official docs on...

my NSDateFormatter works only in the iPhone simulator

I use a NSDateFormatter which works fine in the simulator, but I get a nil when I run it in the iPhone. I hardcoded the date to be sure of the format, but it fails anyway. NSString *strPubDate = @"Fri, 8 May 2009 08:08:35 GMT"; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior:NSDateFo...

lock the position of an nswindow

hey there, is it posible to lock the position of an nswindow? I'm not asking for setIgnoresMouseEvents. I need to prevent the user from moving the window, but he should still be able to use the nstoolbar. thx in advance --molter ...

What are your motivations for developing Software for Mac OSX?

I really like my Mac, and I am thinking about developing Software for it some time in the future. What are the reasons why you're making Mac Software? Because you think Mac is so cool? Or is the market so interesting? I think many of us would like to know, right? Well for me, as I said, it's the coolness of the Mac. I don't know anythin...

What's the name of the object, that has an delegate?

The delegate is something like the dog from the "master". I'm thinking about the name for an important instance variable that has to hold a weak reference to this "master" of the delegate. Is there any official name for this? ...

Cocoa: What NSTextView the insertion point is currently blinking in?

Hi! Given an NSApp object (aka [NSApplication sharedApplication]), how can I get the currently active NSTextView, where the insertion point is blinking right now (if there is one)? :-) I can go [[NSApp keyWindow] contentView] and try traversing the whole view hierarchy, but that seems too hard. Ideal code would be: [NSApp focusedTextVi...

How can I get all points in CGPath curve or quad curve

Hi, I have made a quad curve path using the method CGPathAddQuadCurveToPoint. I got the path perfectly. But, I want to know all the coordinate points which are participated in the path. Is there a way to retrieve all the coordinate points in a path? If not do u have any other solution for retrieving all the points in a curve mathemat...

[NSView setFrame:] not working?

Greetings all, I have a puzzling problem. I have a pointer to a vanilla NSView that was initialized in a nib. I message the nsview with [myNSView setFrame:NSMakeRect(0,0,816,1056)]; but when I step through the debugger, myNSView has a frame of {{0,0}, {801, 1041}}. The dimensions of the rectangle are 15 less than I've specified! Thi...