objective-c

How to get OS X to set initial location of NSWindow

How do I get OS X to place NSWindows in a reasonable default tiled-like location? Like when I open TextEdit and create 10 documents, I see all the windows as having the same size, but somebody is smart enough to place them offset from each other a bit. I'm sure that the app isn't doing this itself in code. (I need a code-based, not NI...

How to add extra cells in a UITableView in editing mode?

Do you know how to have some cells appear in a table view after the table goes into editing mode? Just like the "Contacts" iPhone app does when you edit a contact. Maybe I'm wrong, but when editing the contacts, it looks like a grouped UITableView is used. I tried this: [self.tableView setEditing:YES animated:YES]; [self.tableView ins...

How to register new schema in cocoa/objective-c?

Hi guys, I am looking for a simple tutorial (framework?) that will explain me basic steps that I have to do to register new schema and handle it with my app written in objective-c and cocoa. Explanation: Some apps like Adium, has registered schemas. Schema for the user is an URI like "adiumxtra://www.adiumxtras.com/download/6636". So, ...

Creating an instance of a Class?

At the moment I am just learning Objective-C, one thing that I have noticed is two different notations for defining an instance of a Class. (i.e.) EngineClass *engine; engine = [EngineClass new]; AND EngineClass *engine; engine = [[EngineClass alloc] init]; are they essentially the same? cheers -gary- ...

Multithreaded use of Core Data (NSOperationQueue and NSManagedObjectContext)

In Apple's Core Data documentation for Multi-Threading with Core Data, they list the preferred method for thread safety as using a seperate NSManagedObjectContext per thread, with a shared NSPersistentStoreCoordinator. If I have a number of NSOperations running one after the other on an NSOperationQueue, will there be a large overhead c...

Can I setup the tires array below as an NSArray?

I have looked on the web but can't find anything that might help. My question is can I write the tires[x] array as an NSArray, if so what would be the syntax to both declare and allocate the tire Class instance objects? @interface CarClass : NSObject { EngineClass *engine; TireClass *tires[4]; } . @implementation CarClass -...

Audio recording using iPhone

Hi All, I am currently using AVAudioRecorder file, to record an audio. But in between i need to insert an another audio into that recoded audio file. How can i make it possible? If so please give me a suggestion ! Any help would be greatly appreciated. Suresh ...

Making the Text in a Text Cell change color when the Rows Checkbox has been checked.

I have a NSOutlineView and I want to make the text for a row change color when the rows check box has been checked. The Outline View looks like: _ _________________ |_| |____TEXT CELL____| _ _________________ |_| |____TEXT CELL____| _ _________________ |_| |____TEXT CELL____| (CHECKBOX) How would I do this. ...

iphone singleton instance in the LocateMe sample code

Can anyone explain why a singleton instance of the MyCLController class is used in the sample iphone app LocateMe found here as well as the overriding of retain, retainCount, release, and autorelease? Any help would be very much appreciated!! ...

objective-c object not getting dealloc:ed

I've got an issue with an object not being deallocated in objective-c. I'm pretty certain this is because it is being retained somewhere, but I don't know where (checking retainCount where it ought to be 0 returns a 1). I've gone through my code many times but fail to see what's retaining it that I don't release. Might even be a bug in t...

Using Calender Store.

Is there a good example app or tutorial on using the Calender Store, possibly with an NSTableView being used to add Events/Tasks? ...

Drill down rss reader iphone

Hi everyone, I have made a simple rss reader. The app loads an xml atom file in an array. Now I have added categories to my atom feed, which are first loaded in the array What is the best way to add drill down functionality programmatically. Now only the categories are loaded into the array and displayed. This is the implementation c...

Modifying an iPhone animation container view before starting animation

I am adding some basic animation to a card game I'm working on. (My first iPhone app.) I am creating a custom UIView class "AnimationContainer", which flips from image1 to image2, while moving from rect1 to rect2. My ultimate intention is to have up to four of these containers doing their transitions simultaneously. The problem I'm hav...

Iphone: Unable to load modal view from UITabBarController

I want to be able to present a modal view with an instance of a UIViewController. I have no problem doing this when presenting it from a standard UIViewController (the root view). I have set up a delegate to make the presenting root view close the modal view. This is according to Apple best practice. When I try to make the same root vie...

How do I detect a HTTP response, parse the xml and save to a NSString?

I've been trying to figure this out for weeks and i still get nothing. I am using the ASIHTTPRequest and ive successfully sent the data to a server and now I need to get the response XML,parse it and save the elements to each labeled NSString so I can post it to the server. Does anyone have an idea on how to do this? ...

Hiding the Keyboard when losing focus on a UITextView

So I have a UITextView that I'm using to allow the user to submit some text. My problem is, I can't seem to figure out how to allow the user to 'Cancel' by tapping away from the UITextView. ...

NSTextView with tokens

How can I add tokens, like NSTokenField, to a NSTextView? ...

NSTableView, multiple cells and bindings

I'm trying to create a view that's similar to Motion's properties views (screenshot). Each of my property objects contains a definition of the kind of cell it wants to display as. But at the same time, I'd like to use bindings so that values are automatically updated as they can be changed elsewhere. I've tried a few different approach...

How to keep Cocoa bindings working after replacing the target object's instance with another instance of the same type?

I would like to be able to use bindings to keep my GUI synchronized to a dynamically loaded object, but as soon as I replace the object in question with another one of the same type the bindings break and the GUI stops updating. Here's some code to help you understand what I mean: In my interface I have an instance variable to hold the ...

Creating a Cocoa radio button programatically

I need to make a Cocoa radio button programatically, can anyone explain how this might be done or post a good link that shows how to do this well. ...