cocoa

NSURLConnection delegation and threading - iPhone

I have a class that updates two .plist files in the app documents directory via an NSURLConnection. The class acts as its own delegate for NSURLConnection. It works properly when I ask for a single file, but fails when I try to update two files. Does it look like I should start a new thread for each of the getNewDatabase messages? - ...

Unit testing Cocoa User Interface

Hi All, Anyone please let me know some links or examples for Unit testing user interface code. Is there a complete example app on that. Thanks in Advance, Bhanu ...

Making the Name of the App appear in the Menubar (top-left corner) when the App is LSUIElement.

How would I make the name of the app appear here ( like with a normal app )… … when the app is an LSUIElement. My Problem is that when the App is LSUIElement the name is not by default displayed in the menu bar like an normal app. Basically all I want LSUIElement to do is to hide the dock icon not the name in the menu bar. For those...

Fetched Properties, cross store relationships

Hi folks, I've got a store that is synchronized externally and a store that is unique to the application instance, so in order to cleanly differentiate the two I want to have some join entities between them and then resolve through to the entities between using Fetched Properties, as "discussed" in the Core Data Programming Guide: deve...

What are some of the different names of terms and concepts in Objective C as compared with Java?

I was hoping to make a list of some of the differences in terms between java and objective c to abate my confusion. It makes explaining my difficulties easier when I know what things are called. For example: null - nil this - self map - dictionary (not even quite sure about this one) What I'm looking for are similar comparisons or c...

Reverting a Python/Cocoa project to use the default OSX 10.5 Python (2.5)

Hi, I have installed the latest MacPython (2.6.2) on my Leopard OS X and started an XCode PyObjC project. When I finalized the app, I built the release version and sent it to a friend of mine to try if it runs with out of the box. It did not, because it expects the latest Python, as on my computer. No matter what I tried, I could not...

Best language suited for scanning many files for a keyword (called from a Cocoa app)?

I'm writing a Cocoa app for Leopard that, given a directory of text files, will scan through them, looking for a search pattern (let's pretend they're source files and I just want to find C comments). It will then present the results to the user. While I think I could certainly do this with Cocoa, it feels like it's really meant to be h...

NSColorWell subclass not getting mouseMoved events

I'm trying to implement a color picker in my Cocoa app. (Yes, I know about NSColorPanel. I don't like it very much. The point of rolling my own is that I think I can do better.) Here's a picture of the current state of my picker. The wells surrounding the color wheel are NSColorWell subclasses. They are instantiated programmatically ...

NSTableView switch column

Hi, I have an NSTableView hooked up to Core Data. Here is what I want to do. The table has two columns. When I finish editing the first column, and press tab to go to the next column, I want to programmatically populate the second column based on the first column's data. Is there a delegate method that can help me with this? Thanks ...

Adding attribute to entity in Core Data

I've created all of my Managed Objects after mapping out all entities/attributes/relationships in the data model. Now I have the problem of needing to add additional attributes/relationships I haven't thought of when I first designed one of my entities/classes. Is there a way to modify my existing NSManagedObject class with Core Data sho...

How high and wide will NSString write?

How do I work out how much large an area drawing an NSString will occupy, i.e. by using: [string drawAtPoint:p withAttributes:nil]; I ideally need to work this out before its drawn so I can space out the "areas" in which the strings are drawn appropriately. ...

How to use NSCollectionView and Outlets properly?

Hey there, I'm desperatley trying to connect controls of NSViews which will reside in a NSCollectionView using outlets. The collection view is feeded using an NSArrayController. I created the NSView in a seperate NIB file and in the implementation of NSCollectionViewItem I overwrote copyWithZone to load it: -(id)copyWithZone:(NSZo...

core data fetch results

With the below code I'm creating a fetch request. The problem I'm having is getting the fetch request data and doing something with it like putting it into a variable (like I'm trying to do below with the firstManagedObject variable). I.e., I don't understand what to do with my "result" NSArray that I've created (shown in below code) t...

Is there a shortcut to get to the /Resources/ folder in iPhone development?

Is there a shortcut method much like NSHomeDirectory() and NSTemporaryDirectory to get to the resources folder within your project? Is the /resources/ folder the best place to be storing a file? ...

Hiding the type tag/badge/extension in OS X thumbnails generated via Quick Look?

We are writing a Quick Look generator to create custom thumbnails for PDF files - not a preview of the document, but something else. These thumbnails display text that in Finder is currently partially covered with a "PDF" string (Type tag? Type badge? I don't know what it's called officially) and the turned corner effect, as can be seen ...

How do I pause a function in c or objective-c on mac without using sleep()

Hi I would like to pause the execution of a function in an cocoa project. I dont want to use sleep() because the function needs to resume after user interaction. I also want to avoid doing this with multiple calls to sleep. Thanks for your responses. Ok I started the code while waiting for some answers. I then realized that sleep or...

Reusing subview

Hi I have a UIImageView object that is just a plain black rectangle. This is what i use to select a button in the view. Problem is, I have 49 of these buttons in my view, and all of them can be selected at the same time. What I use for adding a subview to a button is: UIImageView* selectedSquareView = [[UIImageView alloc] initWithFra...

Model instantiation question when using Core Data

I'm slightly confused in one aspect of Core Data. That is, when do I use the rudimentary alloc/init routine vs created an object with core data and saving it into the current managed object context. I know that's a rather vague question, so let me give you an example. I have an application I'm currently working on that iterates through...

Why does Core Data create NSManagedObject's with properties but no accompanying instance variable?

Exactly as the title says, why does Core Data create instances of NSManagedObject with properties for each entity's attribute, but no accompanying instance variable? The problem is, I would like to use some of my 'Entities' in a typical alloc/init style fashion in some parts of my code. Not using Core Data's fetching/context to create/st...

Retaining an object created in an NSThread

I have the following method which is spawned by a call for a new thread (using NSThread): - (void) updateFMLs { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray *temp = [[NSArray alloc] initWithArray:someArrayFromAnotherProcess]; [self performSelectorOnMainThread:@selector(doneLoading:) withObject:temp...