I would like to resize a table view programmatically. I will be
resizing based on the number of rows (which I know in advance), given
a fixed row height which I set myself.
I tried resizing the window's contentView and that did not work. I
know that a window, a scroll view, and a clip view
I am confused by what seem to be two possible approaches to placing
popup button cells into a table.
If I understand the documentation, one can:
a) set the popup button cell as the data cell of the (subclassed) column
OR
b) return the popup button cell in the table datasource method:
- (id)
As a follow-up to the previous question on popups in a table, I am
wondering what APIs you can use to implement the kind of "intelligent"
popups one finds, for example, when filling out the State field in
forms needing an address. You start typing "Ma" and Maine or Maryland
come up. But you
I seem to have fallen into the pitfall you described below. I can get
the table view to display values in a combo box from a data source,
which takes those values from an array in the model. I also have
autocomplete working.
But I can't seem to get the values I choose to "stick" (remain
d
I have a master controller loading a window controller subclass, but
for some reason, I cannot get a pointer to the window loaded in the
XIB file. I've looked at every connection, and I've also tested the
order by of method calls.
In the window controller's init:
[self window] yields nothin
d the "object" (blue cube)
at all in the nib if the file's owner is of the same class and
presumably represents the same object. Are they redundant?
On Jul 27, 2009, at 10:57 PM, Graham Cox wrote:
On 28/07/2009, at 12:39 PM, Daniel Child wrote:
I have a master controller l
That would have been a good guess, but that's not it. Visible at
launch is checked (ON).
On Jul 28, 2009, at 3:13 AM, cocoa-dev-requ...@lists.apple.com wrote:
This came up in another chat I had today. In that case, the window
was not set to be visible at launch, so the system deferred actual
arrigan wrote:
On Jul 28, 2009, at 8:31 AM, Daniel Child wrote:
Which brings up another question: do I need the "object" (blue
cube) at all in the nib if the file's owner is of the same class
and presumably represents the same object. Are they redundant?
They are complete
Thanks for confirming this.
On Jul 28, 2009, at 11:43 AM, Graham Cox wrote:
Not only are they redundant, this is almost certainly your bug.
Objects in a nib are real objects. Therefore you have two of them,
both of the same class. Normally File's Owner is the window
controller and this is
Actually, once I have init'd the window controller and set up the
model data, I call showWindow on the controller. Unchecking visible at
launch doesn't seem to make any difference.
On Jul 28, 2009, at 11:47 AM, Graham Cox wrote:
Visible at launch is checked (ON)
Which is almost never wha
The correct number, a value obtained from the model.
On Jul 28, 2009, at 3:02 PM, cocoa-dev-requ...@lists.apple.com wrote:
The only datasource method to get called is numberOfRowsInTableView.
What number is it returning?
--Andy
___
Cocoa-dev mai
No, the syntax was right. The problem mysteriously disappeared when I
altered the timing of the method to redraw the table, including the
time data is loaded. Thanks for your suggestions.
On Jul 28, 2009, at 8:38 PM, Andy Lee wrote:
Just to be sure -- your method is numberOfRowsInTableView:,
Unihan.txt provides text files showing characters in the format U+.
If I scan these in, naturally I can obtain the NSString representation
.
But I need to convert this text to genuine unichars OR NSStrings (the
actual characters represented).
Two questions:
1. I didn't see any relev
g stringWithFormat: @"%c", &value];
NSLog(@"strc is %...@\n", strc);
NSString *strC = [NSString stringWithFormat: @"%C", &value];
NSLog(@"strC is %...@\n", strC);
} else {
NSLog( @"Hex reading failed." );
}
Seems like a lot o
SOLVED!
My stupid error: passing address of value instead of just value.
Thanks very much for your help. Character displays correctly.
On Aug 11, 2009, at 1:30 PM, Daniel Child wrote:
Thank you. I think I'm almost there, though I'm getting incorrect
values. I tried both %c and
Hi All,
I'm trying to get my feet wet with bindings and want to try something
simpler than the mail example provided online.
All I'm trying to do is to replace the target-action-outlet approach
with bindings in the simplest case I can think of: a text field whose
value would correspond to
I think I understood the first half of what you said, and can now see
why making number the receiver of addObserver was totally wrong.
But I seem to have a problem.
If I want to observe the property of an object, and in my case, it
turns out that the M and C are collapsed into a model-contro
I have a window controller that I initialize using
initWithWindowNibName.
To improve readability later in the code, I try to cache the window
outlet to another variable. [self window] returns no value, however.
This exact same code used to work in previous incarnations of the
program, and
On May 15, 2008, at 12:09 AM, Ken Thomases wrote:
Can you be more specific about why you want your controller to
observe its own number property? What are you trying to
accomplish? I suspect there's another way to accomplish what you're
interested in.
I'm simply trying to reduce bindings
I had already checked the outlets, but rebuilding the nib from scratch
fixed the problem. It must have become corrupted somehow. Thanks.
On May 15, 2008, at 12:35 AM, Ken Thomases wrote:
On May 14, 2008, at 11:23 PM, Daniel Child wrote:
I am just getting used to IB3 but don't see what o
You were right, it accidentally switched to user defaults. Removing
that and setting it back to controller still leads to a runtime
exception.
2008-05-15 22:30:53.718 StringBinding[290:10b] An uncaught exception
was raised
2008-05-15 22:30:53.719 StringBinding[290:10b] [0x119650> valueForUn
After reading a host of theoretical explanations on bindings, I tried
the bindings-based currency converter tutorial to try to get some
basic feel for bindings in practice. The example is written for an
earlier version of OSX, but I think I reproduced it correctly for
XCode 3. However, I ge
THANK YOU!
On May 20, 2008, at 9:33 AM, Michael Babin wrote:
On May 19, 2008, at 11:41 PM, Daniel Child wrote:
After reading a host of theoretical explanations on bindings, I
tried the bindings-based currency converter tutorial to try to get
some basic feel for bindings in practice. The
I worked out a super basic bindings case where table columns display
the ivars of a Word class via bindings. Words have three ivars with
standard accessors. An ArrayController manages a table of these words,
with appropriate bindings between the columns and ivars. It works as
expected. So f
First off, thanks very much for the lengthy response. My initial
response to your post was rejected for length, so I am trying to
abbreviate here, pinpointing areas of confusion.
Hmm. An NSArrayController doesn't manage tables, it manages an
array (as its name implies). So, do you have an
You could also establish the bindings through File's
Owner.delegate.. It amounts to the same thing
for this nib. In other nibs, the application delegate won't
actually be in that same nib, and so the ability to refer to it via
a key path from either the File's Owner or the Application sta
How do you determine how many managed objects of a certain entity type
exist in the managed object context?
Apple's sample code gives this example for finding managed objects.
NSManagedObjectContext *moc = [self managedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescripti
Somehow I thought a predicate was mandatory. Simply setting the entity
works.
Thank you.
On Jul 9, 2008, at 2:34 AM, mmalc crawford wrote:
On Jul 8, 2008, at 11:16 PM, Daniel Child wrote:
NSManagedObjectContext *moc = [self managedObjectContext];
NSEntityDescription *entityDescription
Hi All,
I'm learning Core Data to work out how the fetch button in IB can be
set to a particular fetch request.
I have set up three fetch requests with predicates for one of my
entities. And when I go to IB, I see that the fetch button has a
target-action connection to the NSArrayControll
Hi All,
I am trying to implement a singleton class which is a subclass of
NSManagedObject, but it is not behaving as expected. The librarian
singleton is supposed to keep a list of the data sources, which are
added periodically. I'm trying to cache the Librarian as an instance
variable o
:
@"Librarian"
inManagedObjectContext: moc]; // moc becomes nil here !!!
etc.
enables me to determine how many librarians I have (once I set up such
a utility).
Thanks for looking.
On Sep 9, 2008, at 3:11 PM, Daniel Child wrote:
Hi All,
I am trying to implement a singleton class which is a subc
Hi,
I'm stumped. I have a button in a master window tied to a method that
simply shows another window. The method is as simple as they come.
- (IBAction) showMLTableListings: (id) sender
{
[mLTableListingsWindow makeKeyAndOrderFront: self];
}
where mLTableListingsWindow is simply the
THANK YOU! That solved it for all of the windows.
On Sep 25, 2008, at 4:25 PM, Kyle Sluder wrote:
On Thu, Sep 25, 2008 at 4:17 PM, Daniel Child <[EMAIL PROTECTED]>
wrote:
If I press the button in question once, the window dutifully comes
up. If I
close the window and press the bu
To avoid cluttering up my main AppController (which had five windows),
I've started placing the individual windows into separate xib files.
Pre-Core Data (for a regular cocoa app), I would simply set up a
window controller, establish a reference to it in the main controller
(initWithWindowN
I should? Then how do I get the reference back? If windowA is a window
outlet in my AppController, then first time around I don't do
anything. It is automatically assigned a reference when the window
loads, and I can use makeKeyAndOrderFront.
But if I choose to automatically release the win
Hmm, well that seems to be the catch. I can't get the bindings to work
for the MOC.
First off, to set up the table displayed in the window loaded with a
separate nib file, I simply dragged in an "entity" object from the
Librarian. That doesn't set up an MOC binding, but, following an on-
lin
No. But I'm still wondering. How would you set up a reference again if
you chose to have the window released on close...without reloading the
entire nib, which is probably counterproductive.
On Sep 26, 2008, at 3:30 PM, Charles Steinman wrote:
If it's accessed via an outlet in your app contr
On Mar 1, 2008, at 6:15 AM, Ken Thomases wrote:
Does your init method do anything else other than calling [super
initWithWindowNibName:]? In particular, if it calls [self window],
that forces the loading (and awakening) of the NIB in order to
reconstitute the window.
My bad. I should have
On Mar 3, 2008, at 2:05 PM, Ken Thomases wrote:
On Mar 3, 2008, at 11:12 AM, Daniel Child wrote:
On Mar 1, 2008, at 6:15 AM, Ken Thomases wrote:
Does your init method do anything else other than calling [super
initWithWindowNibName:]? In particular, if it calls [self
window], that
OK, thanks. But then in Cocoa you normally use alloc and init
together, and that's where the problem is, I think.
initWithWindowNibName seems to result in the window being shown
automatically.
I am instantiating the window controller, and am trying to figure out
at which point I could gai
In the process of parsing thousands and thousands of records and
placing (most of) them in a table which I want to save to disk, I get
this error:
LSC Data Preparation(1097,0xa000ed88) malloc: *** vm_allocate
(size=1069056) failed (error code=3)
LSC Data Preparation(1097,0xa000ed88) malloc:
On Mar 8, 2008, at 1:11 AM, Ken Thomases wrote:
We can think of three stages of loading a window from a NIB and
showing it:
1. Loading the NIB bundle's contents into memory
2. Unarchiving the NIB's contents and instantiating the object
graph that was frozen within it
3. Showing the window
On Mar 12, 2008, at 12:00 PM, [EMAIL PROTECTED] wrote:
Some points of interest:
1. vm_allocate(size=1069056) - Is each of your 'thousands and
thousands of records' this large? If so then it is no wonder that you
will run out of address space after a couple of thousand (on 32-bit)
No. I build
Each record is allocated and explicitly released at the end of the
loop after adding it to the table. I thought autorelease might wait
too long to get rid of it, so I do it explicitly.
As for Instruments, unfortunately I'm doing this on Tiger.
On Mar 12, 2008, at 12:00 PM, [EMAIL PROTECTED]
f code the various blocks refer to. (Sorry if that
is a newbie question. Performance tools are totally new territory for
me.)
On Mar 12, 2008, at 1:47 PM, John Stiles wrote:
Daniel Child wrote:
Each record is allocated and explicitly released at the end of the
loop after adding it to the table.
An autorelease pool got me through the parsing operation without
issue. Thanks for your input.
In ObjectAlloc, is there a way to figure out what exactly how each
"General Block" matches up with objects in code? I can make rough
guesses based on the data types and their behavior, but can the
Hi,
I am using sortArrayUsingFunction: context: to sort a fairly large
table (100k recs). Judging from the readout of comparisons being made
the sort appears to be about 80% done when everything comes to a
halt. No message, no nothing. It just stops.
The exact same function works if the t
That makes a lot of sense to me, and that's the situation I'm trying
to get to. But right now all I have is the original (unsorted) raw
data. So I need to load it into memory and sort it.
Since the sorting operation hangs some kazillion compare:s into the
process, I can't exactly trace my w
On Mar 13, 2008, at 6:24 PM, Jens Alfke wrote:
You don't necessarily need to sort all of it at once. You just need
to find the first few items, to display in your table view. If the
user scrolls past those, you need to find more. You can do this by
streaming the data from a file, keeping on
Great suggestion. Thanks.
On Mar 13, 2008, at 5:00 PM, Ben Trumbull wrote:
One nice thing about sorting, is that this is easy to do: merge
sort. You can break up the problem as much as you want, and use any
handy sort function, and then merge the pieces together.
Algorithms for merging are
Actually, since I've parsed the data successfully, I suppose I could
store it and reopen in Core Data. Since I am new to Cocoa and have a
limited programming background, I thought I should keep things
basic,. Will give it a try as well (once I've tried the merge sort).
But since I will have
I have a project that is going to require remote debugging, and I am
wondering if there are any restrictions on remote debugging between a
PowerPC Mac and one of the newer Intel machines. Apple's
documentation makes no mention of this other than for the case of
panic kernels.
Can one comp
I had an application that built fine on Tiger using Xcode 2.4.1. When
I try building on Leopard, I get a duplicate symbol error as follows:
ld: duplicate symbol _evLanguageAsString in
/Users/.../build/.../Debug/LSC Data Preparation.build/Objects-normal/
ppc/DataDescription.o
and
/Users/.../bu
evLanguageAsString is a function defined in a file called DataTypes.h.
Both DataDescription.h and Step1_SourceTypeController.h import
DataTypes.h.
I thought #import would take care of the possibility of duplication.
Are you suggesting I need to separate the declaration of the function
fro
Thanks. Separating the header and implementation solved the linking
error, and that should hopefully cure me of the sloppy habit of
stuffing functions into a header.
I'm not sure the differences between reported errors in Xcode 3 and
2.4 are not worth tracking down, because they are conside
I am building a sample input method and the build succeeds, but the
icon on the executable has a weird circle with bar (like a European do
not enter sign) over it. When I try copying it into Library/Input
Methods it indeed behaves very slowly...practically useless.
I can't figure out what t
remote debugging, but that should be OK as far as I know.
On Apr 28, 2008, at 4:12 PM, Ricky Sharp wrote:
On Apr 28, 2008, at 2:57 PM, Daniel Child wrote:
I am building a sample input method and the build succeeds, but the
icon on the executable has a weird circle with bar (like a European
do
If input methods were not allowed, that would mean no one could type
Chinese, Japanese, Korean. I find that hard to believe.
The post seems to be about Input Managers, not input methods.
On Apr 28, 2008, at 4:52 PM, [EMAIL PROTECTED] wrote:
Also, if this is under Leopard, aren't input manag
Trying to fix the previous problem of an illegitimate app, I switched
to a build configuration of Xcode 3.0 and SDK 10.5 and got the
following message:
File /../.../.../...xxx.app depends on itself. This target might
include its own product.
Googling this hasn't helped. Is this a bug?
Th
Thanks! That took care of it.
On Apr 28, 2008, at 11:20 PM, Luke Pike wrote:
That error usually means the application is included as part of the
target. To fix this, just find the application in the Xcode project
and uncheck the target checkbox.
Luke
On Apr 28, 2008, at 11:10 PM, Daniel
It turns out that the exact same configuration WILL build a release
version but NOT a debug version.
How is that even possible?
On Apr 28, 2008, at 4:12 PM, Ricky Sharp wrote:
On Apr 28, 2008, at 2:57 PM, Daniel Child wrote:
I am building a sample input method and the build succeeds, but
I am trying to set up remote debugging for input methods using Xcode.
For starters, I'm trying to use Apple's sample, but am having a number
of issues.
One is that I am not sure where/how to set up the shared build
location in the case of an input method. To run an input method, you
need
know keyboard input is intended for Xcode or the client
application (like TextEdit, which "hosts" the test).
On May 1, 2008, at 1:42 PM, j o a r wrote:
On May 1, 2008, at 10:39 AM, Daniel Child wrote:
Input methods run in the background and need to be debugged
remotely
W
MOTE is a PPC Since this was Apple's sample, I'm leaving the
SDK/target as is since presumably those are the settings they
used???
On May 1, 2008, at 1:42 PM, j o a r wrote:
On May 1, 2008, at 10:39 AM, Daniel Child wrote:
Input methods run in the background and need to
Hi All,
I'm working out some tests one one-to-many and many-to-many relations
between entities. So far things are working well, including the
bindings. But I'm puzzled by the documentation.
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html#/
/
I have a background app (an input method) that has a window associated
with MainMenu.nib.
The first time the app launches when I select it from the input
methods list, the window launches. But if I close the window, it seems
there is no way to get it back.
My current settings in IB are:
-
Hi All,
I am trying to add an object in a to-many relationship and get this
error:
-[_NSControllerObjectProxy entity]: unrecognized selector sent to
instance
The object I'm adding was obtained by using
NSManagedObject *theWord = [wordList selection]
This yields a proxy object instead of
of the
corresponding view was missing the model key. A million thanks for
pointing this out.
On Feb 25, 2009, at 3:05 PM, Kyle Sluder wrote:
On Wed, Feb 25, 2009 at 2:43 PM, Daniel Child
wrote:
The object I'm adding was obtained by using
NSManagedObject *theWord = [wordList selection]
I have a basic parent entity with two child entities. I set up a nib
file using the default "entity" interface for all three. I can add and
remove data fine, but for some reason, the search fields that are
automatically provided do not work, and in fact cause the following
error message:
I'm not sure if I understand your question, but if FillStyle and
FillColor are entities, why not simply create corresponding managed
objects and set their values, making sure that all of the relations
(between color and style, and between style and figure) are
established. They will then be
Hi All,
This strikes me as something that should be absurdly easy to do, but I
can't seem to find any examples with more than two or three entities,
and so no one mentions it, and I don't see it in the documentation.
How do you expand the Core Data model sheet??? (The part where
entities
Hi All,
I have a Core Data app that I am trying to debug.
If I simply run it, the main window loads fine.
If I try to run in debug mode, an exception is thrown before even
loading the main nib. This problem seems to have started when I tried
to put manual breakpoints in the code. Now, just
It says
Running…
(gdb) po $rdi
Value can't be converted to integer.
(gdb)
On Apr 22, 2009, at 2:56 PM, Nick Zitzmann wrote:
On Apr 22, 2009, at 12:36 PM, Daniel Child wrote:
Since none of the methods below are things I have written, I'm not
sure where to go from here. Ho
Nick Zitzmann wrote:
On Apr 22, 2009, at 1:28 PM, Daniel Child wrote:
It says
Running…
(gdb) po $rdi
Value can't be converted to integer.
(gdb)
Are you sure your program is running as Intel 64? The $rdi register
is only available to X86-64 applications. In 32-bit Intel apps,
ar
You're right.
(gdb) po $rdi
Value can't be converted to integer.
(gdb) po *(int *)($ebp+8)
Cannot access memory at address 0x1
(gdb)
On Apr 22, 2009, at 4:16 PM, Nick Zitzmann wrote:
On Apr 22, 2009, at 2:13 PM, Daniel Child wrote:
Well, I think so. I thought all Core2 Duos
n Apr 22, 2009, at 2:20 PM, Daniel Child wrote:
(gdb) po *(int *)($ebp+8)
Cannot access memory at address 0x1
(gdb)
Something's still not right here. On Intel 32, $ebp+8 points to the
first argument in a function call, which would be the NSException
object passed into objc_exception_th
I have a Core Data app that imports data via a separate managed object
contexts. Without multithreading, the operation works fine. But since
the import takes over a minute, I want to do the import in a different
thread. The data consists of an archived table of data with records.
This is my
I am trying to create a framework out of some files that I use in a
few apps. I expected this to be easy, but instead got a kazillion
warnings, all of which take the form:
objc_class_name_ referenced from
in .o
[MANY METHODS AND FILES LISTED]
or
objc_msgSend referenced from
in .o
or
NSL
Thanks for the sugestion. I will keep the idea of passing object IDs
in mind when that situation comes up. But I think I misled you.
My data was not in Core Data yet, but rather in an archive I needed to
unfreeze and place in Core Data. In the end, I did something similar
to what you sugge
I remember having this problem while developing Core Data apps for
testing purposes. It often happened while I modified the app in
various ways.
I think the solution was to delete the store in ApplicationSupport/
. If you have legacy data, you'll have to export that from
an old version and
That was it. Thanks.
On Apr 28, 2009, at 1:07 AM, cocoa-dev-requ...@lists.apple.com wrote:
I am trying to create a framework out of some files that I use in a
few
apps. I expected this to be easy, but instead got a kazillion
warnings, all
of which take the form:
objc_class_name_ referenced
I'm trying to catch whitespace between words with a scanner. For some
reason, the white space is not being recognized.
Am I missing something obvious or is there a bug here? Thanks.
{
NSMutableArray *separateWords;
NSScanner *scanner;
NSCharacterSet *spaceCharSet;
A whole while loop reduced to one line. Very cool.
Thanks also for the tip on setCharactersToBeSkipped:nil.
That was driving me nuts.
On May 7, 2009, at 1:13 AM, Graham Cox wrote:
On 07/05/2009, at 3:05 PM, Daniel Child wrote:
I'm trying to catch whitespace between words with a scanner
From what I read, the default (button in a view is outlined/shaded
in blue and is set as the button which responds to RETURN. I have a
serious of buttons (step 1, step 2, etc.), and I want the appropriate
button to be highlighted as the default when it is turn to do that
step. I used this c
You were absolutely right. Thanks. A shame that push button is the
only one that provides this colored behavior for default. I could see
it being useful.
On Feb 21, 2008, at 3:29 PM, Ken Ferry wrote:
I think you're confusing the focus ring with the default button.
You're right it turned out to be a focus issue.
I was looking into FirstResponder (before posting the question but it
didn't seem right), but as Ken Ferry pointed out, the issue was
actually on my computer: a preference setting where focus moves to
all objects, not just text fields. Plus th
I am trying to place and size segmented controls programmatically on
a window controlled by a subclass of NSWindowController. What I'm
getting, however, is simply the window as it was initially drawn in
IB. I think the problem has to do with loading the window properly
and more specifically
I am trying to understand the interrelationship between various
method calls made once a window controller is instantiated. I am
loading a window controller from within a master controller. Data
passed from the master controller to the window controller is used to
programmatically alter the
Visible at launch is not checked.
But are you suggesting that you cannot configure the window prior to
displaying it? Or do you distinguish "load" from "display"? I'm
trying to load it into memory, alter it, and then display.
Judging from debug sessions, the window and other top level objec
89 matches
Mail list logo