Custom bitmap representation

2009-10-12 Thread Kelvin Chung
I have this "nonstandard" image format which I want to convert into a more "standard" image format (say, PNG). I'm having difficulty on how to use NSImageRep to do so. This "nonstandard" format can be converted into a bitmap, so I thought that using NSBitmapImageRep can do just that. How

NSXML and XQuery

2009-10-12 Thread Kelvin Chung
I'm not sure if this is the right place to ask (is there someplace more relevant?), but I'm having trouble processing XQuery using the NSXML classes. Whereas I can get the correct results in something like Saxon, I'm having trouble doing so in NSXML: for example, it seems that NSXML doesn

STL algorithms and NSEnumerator/NSFastEnumeration

2011-10-29 Thread Kelvin Chung
I have this Objective-C container which I want to use in an algorithm that only takes STL iterators. Is there a generic adapter for NSEnumerator or id that will provide appropriate STL iterators? Also, is there a way to tell the difference between two NSEnumerators (a la STL iterator differenc

Cocoa Bindings and Dependent Keys question

2009-05-30 Thread Kelvin Chung
I seem to have a very simple question, but the answer is eluding me for some odd reason, but here goes: Suppose I have two NSArrayControllers, ac1 and ac2. Suppose now that I have a third controller ac3, whose content array is dependent on both ac1.selection and ac2.selection (or some keypat

Developing with Java

2009-05-04 Thread Kelvin Chung
Has anyone tried to use Rococoa (http://rococoa.dev.java.net) to develop a Cocoa program with Java? If so, how is it? I'm trying to build the sample Currency Converter program in XCode, but with Java using Rococoa. Are there any tips on developing a Cocoa program with Java (using JNI/ JN

Associating Objective-C objects with Java objects using JNI

2009-05-05 Thread Kelvin Chung
I'm trying to find a good way of associating an Objective-C object with an arbitrary Java object, so that you could essentially delegate the Objective-C method call to a Java object. I envision that this would have to be done using JNI. However, I don't know the specifics of how it can be

Core Data and ordered to-many relations

2009-05-24 Thread Kelvin Chung
Is there a way to represent an ordered to-many relation? For example, suppose you have an entity, Person, related to itself (one-to-many). Now suppose Alice is related to Carol and Dave, and Bob is related to Dave and Carol, in the order prescribed. Is there a way to model that using a re

Data storage/retrieval

2009-05-25 Thread Kelvin Chung
I'm not sure what is the best way to write a simple DB application. Suppose I have something like an SQLite database. What I want to do is basically to write a Cocoa frontend for it. This frontend only needs to read from it - not write to it. I don't see any database functionality in Coc

Using fmdb with Cocoa Bindings

2009-05-26 Thread Kelvin Chung
I'm fairly new to both fmdb and Cocoa bindings, so I am wondering if anyone can help me out: Suppose I have an FMResultSet resulting in a query. I'm trying to put the results in an NSTableView with Cocoa Bindings. Now the table view has its contentArray bound to an NSArrayController (call

Re: Using fmdb with Cocoa Bindings

2009-05-27 Thread Kelvin Chung
On May 27, 2009, at 11:06 AM, Bill Garrison wrote: On May 27, 2009, at 1:33 AM, Kelvin Chung wrote: I'm fairly new to both fmdb and Cocoa bindings, so I am wondering if anyone can help me out: Suppose I have an FMResultSet resulting in a query. I'm trying to put the res

NSValueTransformer/Cocoa Bindings question

2009-05-27 Thread Kelvin Chung
I'm having trouble using an NSValueTransformer. Suppose I have an NSArrayController foo. If I bind a label's value to selection.number (which is an NSNumber) on foo, then this is fine. However, I'm having trouble when it comes to transforming this value. Suppose I have a second NSArrayCo

Binding to two values

2009-05-28 Thread Kelvin Chung
I'm not sure the best way to do this, but suppose I have two NSArrayControllers, tableView1Controller and tableView2Controller. Now suppose I have an NSArrayController, table3Controller. What I am trying to do is to have it so that table3Controller's Content Array binding depend on both ta