On Jul 27, 2008, at 12:33 AM, Mark Teagarden wrote:
Hi,
I'm working on a strategy game in which a NSMutableArray called
'army' contains a series of Unit objects. Each Unit contains a
property called next_unit, which is a pointer to the next unit in
the array - I'm implementing a linked-
On Jul 27, 2008, at 2:17 AM, Nathan Kinsinger wrote:
On Jul 27, 2008, at 12:33 AM, Mark Teagarden wrote:
Hi,
I'm working on a strategy game in which a NSMutableArray called
'army' contains a series of Unit objects. Each Unit contains a
property called next_unit, which is a pointer to t
Xcode is complaining because objectAtIndex: returns an id.
NSMutableArray doesn't know/care what type(s) of objects it's holding.
If you want to use the dot syntax, you'll need to cast the id returned
from objectAtIndex: to the type of object it really is (a Unit* in
this case). Alternatel
On Jul 27, 2008, at 1:24 AM, Mark Teagarden wrote:
Ah. I think I was under the impression that objectAtIndex was
already returning a pointer to an object of type Unit, in which
case the cast would be unnecessary. Is the actual object, or a copy
thereof, being returned? I thought that s
On Jul 26, 2008, at 9:02 AM, Jacob Ole Juul Kolding wrote:
Hello List
I've implemented at main window in IB and set resize attributes for
all my objects which works as desired, but I have two problems.
First, when i maximize the app the objects in the window are resize
but not placed pro
I sub-class NSDocument and call it MedDocument. My code is similar to
Apple's SimpleToolbar .. the biggest difference is that I create a Category
= MedDocument+ToolbarDelegateCategory in order to compartmentalize the code,
i.e., keep the toolbar stuff in a separate file. And it works .. except for
Hello!
I am having a really weird problem with WebView and more specifically
getting them to load a WebArchive. My app acquires WebArchives (saved
by Safari, TextEdit, other apps, or from the pasteboard provided by
those apps) and then later tries to load them.
My bug is WebView doesn't s
I'm having an interesting problem today. I'm working with the event-
driven XML parser in Core Foundation. For those of you who aren't
familiar with that parser, you have to implement at least 3 callback
methods:
void *createStructure(CFXMLParserRef parser, CFXMLNodeRef node, void
*info)
On Sun, Jul 27, 2008 at 5:51 AM, Carter R. Harrison
<[EMAIL PROTECTED]> wrote:
> I'm having an interesting problem today. I'm working with the event-driven
> XML parser in Core Foundation. For those of you who aren't familiar with
> that parser, you have to implement at least 3 callback methods:
On 27 Jul 2008, at 10:02 pm, John Love wrote:
I call:
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(openDocument:)]; as Apple specifies.
Well, what do you want the tool bar item to actually *do*? Whatever it
is, and whatever object is responsible for handling it is your act
Nicolas,
Web archives are actually xml documents, so you can open and view
them in BBEdit, for example. The problem with Test2 is that the value
of "WebResourceURL" is "x-msg://21/". If you change that to a http
URL, such as "http://www.google.com/";, it will load.
Probably your WebView c
Ok great thanks for the assistance.
On Jul 27, 2008, at 10:19 AM, Clark Cox <[EMAIL PROTECTED]> wrote:
On Sun, Jul 27, 2008 at 5:51 AM, Carter R. Harrison
<[EMAIL PROTECTED]> wrote:
I'm having an interesting problem today. I'm working with the
event-driven
XML parser in Core Foundation. F
Hi Jeff,
Replacing that source URL with a random HTTP URL before loading *did*
do the trick. Thank you very much, you saved me a lot of trouble!
I have to say I'm still not sure why this URL matters to load the page
since the entire contents/data are already in the local archiv. the
URL d
Hi,
I'm fairly sure that this isn't possible without hooking into private methods
of NSLayoutManager, but it's worth asking on the off-chance...
In a standard rich text NSTextView, the ruler view has an accessory view
provided by NSLayoutManager. This accessory view has several handy controls in
On Sat, Jul 26, 2008 at 8:42 AM, Cloud Strife <[EMAIL PROTECTED]> wrote:
> Hi everyone. Maybe this issue is very odd, but I came across it indeed.
> I wrote an application using an override NSView to respond events trigged by
> users. Obviously, rewrite the -(void)mouseDown:(NSEvent* )theEvent is
>
Stupid question, probably, but if an object is deleted, is it
automatically removed as an observer of notifications? Or should I
write a removeObserver into my dealloc?
J.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post
Hi
I wrote a Quark XTension that dynamically generates ad placeholder images on a
page and am having a problem where doing a restore on a saved NSGraphicsContext
crashes after the last ad is placed. If I comment out the save/restore context,
the app doesn't crash but it also doesn't render the
On Jul 27, 2008, at 12:36 PM, James Maxwell wrote:
Stupid question, probably, but if an object is deleted, is it
automatically removed as an observer of notifications? Or should I
write a removeObserver into my dealloc?
J.
James,
No, an object is not automatically removed as an observer
On Jul 27, 2008, at 12:35 PM, [EMAIL PROTECTED] wrote:
Hi
I wrote a Quark XTension that dynamically generates ad placeholder
images on a page and am having a problem where doing a restore on a
saved NSGraphicsContext crashes after the last ad is placed. If I
comment out the save/restore
-- Original message --
From: glenn andreas <[EMAIL PROTECTED]>
>
> You're setting a graphics context:
> > // uncommenting the next line works fine for all ads except the
> > last which
> > // causes a crash after the last ad image is placed.
> > //[N
On Jul 27, 2008, at 7:36 PM, James Maxwell wrote:
Stupid question, probably, but if an object is deleted, is it
automatically removed as an observer of notifications? Or should I
write a removeObserver into my dealloc?
If you're talking about NSNotification/Center, then the answer is: "It
-- Original message --
From: [EMAIL PROTECTED]
>
> -- Original message --
> From: glenn andreas <[EMAIL PROTECTED]>
> >
> > You're setting a graphics context:
> > > // uncommenting the next line works fine for all ads except the
Hey there,
Hooking into PDF services on OSX is really easy. All you need to do is
to create a link in ~/Library/PDF Service to the application that is
supposed to be listed in the printing dialog's menu. Now the problem
is: How do I display anything but just the application's name?
Instea
On Jul 27, 2008, at 12:57 PM, [EMAIL PROTECTED] wrote:
-- Original message --
From: glenn andreas <[EMAIL PROTECTED]>
You're setting a graphics context:
// uncommenting the next line works fine for all ads except the
last which
// causes a cra
On Jul 27, 2008, at 9:52 AM, Nicolas L. wrote:
I have to say I'm still not sure why this URL matters to load the
page since the entire contents/data are already in the local
archiv. the URL doesn't need to be accessed, does it...
Might be a question for the WebKit developers.
http://webkit
-- Original message --
From: glenn andreas <[EMAIL PROTECTED]>
> restoreGraphicsState restores the state of the current context - it
> does not restore the context to the previous context. You need to
> explicitly save the current context before you do setCurr
>
> Well, what do you want the tool bar item to actually *do*? Whatever it is,
> and whatever object is responsible for handling it is your action and
> target, respectively. Just like a menu item.
>
I want it to call NSDocumentController's openDocument: which is the action
of the "Open ..." File
There's been some discussion on this topic previously, but I haven't
been able to find the solution that I'm looking for. I'm using the
event-driven XML parser (CFXMLParser). Apparently it does not support
the replacement of entity references (&, <, >, etc..).
So assume I'm trying to parse
On Jul 27, 2008, at 1:33 PM, [EMAIL PROTECTED] wrote:
-- Original message --
From: glenn andreas <[EMAIL PROTECTED]>
restoreGraphicsState restores the state of the current context - it
does not restore the context to the previous context. You need to
explicitly
By "one content view," do you mean a view inside the window's content
view? It appears to do the same thing. The resizing animation works
when it has a layer, but then again the same thing happens with the
content view having a layer.
On Jul 27, 2008, at 11:58 AM, Milen Dzhumerov wrote:
On
Hey, i am not sure but i have the feeling that the title should be "planes,
trains, & automobiles"
so with an extra semicolon behind the &.
2008/7/27 Carter R. Harrison <[EMAIL PROTECTED]>
> There's been some discussion on this topic previously, but I haven't been
> able to find the solution th
On Jul 26, 2008, at 7:42 AM, Cloud Strife wrote:
Hi everyone. Maybe this issue is very odd, but I came across it
indeed.
I wrote an application using an override NSView to respond events
trigged by
users. Obviously, rewrite the -(void)mouseDown:(NSEvent* )theEvent is
necessary.
I want to tes
Hello,
I'm trying to understand how to use subquery expressions, but I just
don't... :-)
I have an array of MyCustomClass objects. MyCustomClass has a function
that returns an array of dictionaries. I want to query all keys in
each dictionary for a given string, i. e. something like "(ANY
SELF.fu
Hi All,
I have a simple question: what is the best way to quit another
application? The app's name and exact path are known. I looked at
NSWorkspace but couldn't find anything useful.
Thanks,
Daniel
___
Cocoa-dev mailing list (Cocoa-dev@lists.app
I have a try/catch in a method and I am trying to catch first an
NSRangeException and secondly the general NSException. The code looks
basically like.
@try
{
//A bunch of stuff here .
}
@catch (NSRangeException *nSRE)
{
NSLog(@"Width exception: %@ %@", [nSRE name], [nSRE
On 27 Jul 2008, at 07:36, Jacob Bandes-Storch wrote:
[snip]
For resizing, the logical method is -[NSWindow
setFrame:display:animate:]. This all works fine... until a
descendant subview has a layer. Then I get a pause, and the window
resizes without animating. If I remove the layer from th
On Jul 27, 2008, at 12:52 PM, Carter R. Harrison wrote:
There's been some discussion on this topic previously, but I haven't
been able to find the solution that I'm looking for. I'm using the
event-driven XML parser (CFXMLParser). Apparently it does not
support the replacement of entity
--- On Sun, 7/27/08, Randy <[EMAIL PROTECTED]> wrote:
> @catch (NSRangeException *nSRE)
NSRangeException is declared as an NSString constant, not a class. What you
want to do is catch an NSException and check if [[exception name]
isEqualToString:NSRangeException].
Cheers,
Chuck
__
--- On Sun, 7/27/08, Daniel Richman <[EMAIL PROTECTED]> wrote:
> I have a simple question: what is the best way to quit
> another
> application? The app's name and exact path are known. I
> looked at
> NSWorkspace but couldn't find anything useful.
AppleEvents/AppleScript would be the ticket.
-- Original message --
From: glenn andreas <[EMAIL PROTECTED]>
>
> CG is "stateless", in that there is no "current context" (all drawing
> to a CGContext requires passing the CGContextRef). NSGraphicsContext,
> on the other hand, involves an implicit "curren
Anyone know if the "Actor" design pattern for concurrent programming
has been implemented for Cocoa?
In a nutshell, an Actor is an object that has its own [cooperative]
thread and message queue. Actors interact by message-passing instead
of shared state. The idea is to eliminate the need fo
AppleEvents/AppleScript would be the ticket.
Thanks! I used AppleScript. Just wasn't sure if there was some Cocoa
class that did the job.
Daniel
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator
You don't need to; just iterate over the array. Plus, if you want
a linked list, you just need a pointer to the head node, a method to
add new nodes, (possibly a method to remove nodes), and a method to
walk the list (probably using delegation to hand off the
responsibility of what happen
On Jul 27, 2008, at 4:19 PM, [EMAIL PROTECTED] wrote:
-- Original message --
From: glenn andreas <[EMAIL PROTECTED]>
CG is "stateless", in that there is no "current context" (all drawing
to a CGContext requires passing the CGContextRef).
NSGraphicsContext,
On Sun, Jul 27, 2008 at 7:09 PM, glenn andreas <[EMAIL PROTECTED]> wrote:
>
> If you call [NSGraphicsContext currentContext] before your
> setCurrentContext:, what do you get back?
>
> Whatever that is, that's the context to restore with a second
> [NSGraphicsContext setCurrentContext: ] at the end
I managed to get the table column to resize properly by following your
instructions.
but as for the window itself:
Just to make sure, when you say leftmost strut in autosizing controls
you mean the red spacers?
They are set for all objects in my window, but still the problem
persists.
Anot
Hello List
I'm been reading the documentation quit a bit but haven't found the
answer.
My problem is that I don't really understand how containers work in
Cocoa,
I know NSView, but how do I add an object to it programmatically, say
a NSImage?
Any pointer greatly appreciated!
Jacob Koldin
When attempting to use NSPopupButton and bindings to
NSArrayController, as a means to navigate an array of objects, is
there any tutorial or example out there?
I keep getting "cannot perform operation without a managed object
context"
This would seem to imply that I should be using CoreData.
I'm been reading the documentation quit a bit but haven't found the
answer.
My problem is that I don't really understand how containers work in
Cocoa,
I know NSView, but how do I add an object to it programmatically,
say a NSImage?
The term "container" is usually used to reference things
gr... I haven't come across this for a while - mainly because I
haven't started a new project for a while - but IB is not recognizing
the class inheritance of my MyDocument.
Specifically, I'm using GCDrawKit, which has an NSDocument subclass
called DKDrawingDocument. If I make MyDocument
On Jul 27, 2008, at 7:55 PM, John Joyce wrote:
When attempting to use NSPopupButton and bindings to
NSArrayController, as a means to navigate an array of objects, is
there any tutorial or example out there?
I don't believe specifically for your case (ie, an NSPopUpButton),
but this list
Hi guys!
I'm kinda new to Cocoa framework. I'm trying to create an
application that will send requests to my web server. Everything is
cool, except error handling. I would assume that any error while
request is being sent should trigger didFailWithError, but it seems
it is not what happe
On 28 Jul 2008, at 5:05 am, John Love wrote:
Absolutely . So in my sub-class of NSDocument, I call my own
customized Toolbar routine(s) within my override of -
windowControllerDidLoadNib. Just how do I pass an instance of
NSDocumentController to these Toolbar routine(s)?
There is only
Because DKDrawingDocument comes from a framework it's possible that IB
can't find the definition. I'm not sure that's the problem, but you
can usually fix it by dragging the DKDrawingDocument.h file into IB
which is enough to get it to realise what's going on.
cheers, Graham
On 28 Jul 200
On Jul 27, 2008, at 7:09 PM, glenn andreas wrote:
If you call [NSGraphicsContext currentContext] before your
setCurrentContext:, what do you get back?
Whatever that is, that's the context to restore with a second
[NSGraphicsContext setCurrentContext: ] at the end...
Pay no attention to w
What is the most common/accepted way of dealing with the inaccuracies
of floating point math? I'm trying to find out 1) Do 2 NSBezierPath
lines intersect and then 2) What is the point of the intersection?
Given a couple points on a line I can find the intersection point but
since 2 line seg
In the documentation for NSDocument there is a method called -
(void)setWindow:(NSWindow*)aWindow, for which aWindow is described as
"The window to which the receiver’s window outlet points."
Furthermore, if I ctrl-click on the File's Owner in MyDocument.xib (a
document-based app), which is
Don't you want NSDocuments -(NSWindow*)windowForSheet: rather than -
(void)setWindow:? I assume you're trying to retrieve the object rather
than set it.
That may not be your problem, but it's the only thing I can think of.
Alex
On Jul 27, 2008, at 7:26 PM, Todd Heberlein wrote:
In the docum
Hi All,
I've been having some strange problems with an NSArray. It's probably
something obvious, but I can't figure it out.
I have an AppController class with an NSArray instance value, called
numbers. numbers stores NSStrings (which are numbers, but I don't need
them as ints or anything). T
On Sun, Jul 27, 2008 at 9:41 PM, Ashley Perrien <[EMAIL PROTECTED]> wrote:
> What is the most common/accepted way of dealing with the inaccuracies of
> floating point math? I'm trying to find out 1) Do 2 NSBezierPath lines
> intersect and then 2) What is the point of the intersection?
>
> Given a c
On Jul 27, 2008, at 7:34 PM, Alex Heinz wrote:
Don't you want NSDocuments -(NSWindow*)windowForSheet: rather than -
(void)setWindow:? I assume you're trying to retrieve the object
rather than set it.
That may not be your problem, but it's the only thing I can think of
I was trying [window
Ah, I see what you mean. You might try windowForSheet, and see if that
works, but you're right, it does seem strange to have an outlet that
doesn't respond. It's possible that its not an outlet directly from
the NSDocument object, but rather from one of NSDocument's instance
variables.
Al
On 28/07/2008, at 12:52 PM, Daniel Richman wrote:
[snip]
So I'm befuddled. Any ideas? Sorry for the long post.
I'd say you've either got a memory management issue, e.g. you're
forgetting to retain numbers (are you using garbage collection?), or
the debugger is getting confused and printin
On Jul 27, 2008, at 10:26 PM, Todd Heberlein wrote:
In the documentation for NSDocument there is a method called -
(void)setWindow:(NSWindow*)aWindow, for which aWindow is described
as "The window to which the receiver’s window outlet points."
Furthermore, if I ctrl-click on the File's Own
On Jul 27, 2008, at 10:52 PM, Daniel Richman wrote:
numbers = [allNumbers componentsSeparatedByString:@"\t"];
You don't own the return value from -componentsSeparatedByString:, so
you must retain it if you want it to stick around.
the contents of the array have become other, non string thi
On Sun, Jul 27, 2008 at 8:03 PM, Dennis Davydenko
<[EMAIL PROTECTED]> wrote:
>>
>> Hi guys!
>>
>> I'm kinda new to Cocoa framework. I'm trying to create an application that
>> will send requests to my web server. Everything is cool, except error
>> handling. I would assume that any error while requ
I'd say you've either got a memory management issue, e.g. you're
forgetting to retain numbers (are you using garbage collection?), or
the debugger is getting confused and printing something else.
That was it! I had forgotten to retain numbers. What confused me was
that I was getting those bo
On 28/07/2008, at 1:06 PM, Daniel Richman wrote:
I'd say you've either got a memory management issue, e.g. you're
forgetting to retain numbers (are you using garbage collection?),
or the debugger is getting confused and printing something else.
That was it! I had forgotten to retain numb
On 28/07/2008, at 12:26 PM, Todd Heberlein wrote:
But I cannot pass messages to the window variable. For example, I
cannot send it the "setTitle:" message.
If you're looking at changing the document title for a document you
should look at overriding NSWindowController's
windowTitleForDoc
I'm trying to create a Mail-style scroll view, with a view for
information (like the view for message headers) above a text view for
the content. I created two NSViews in Interface Builder, changed the
class of the bottom one to NSTextView, selected both, and clicked
Layout > Embed Objects
On Jul 27, 2008, at 9:56 PM, [EMAIL PROTECTED] wrote:
When attempting to use NSPopupButton and bindings to
NSArrayController, as a means to navigate an array of objects, is
there any tutorial or example out there?
I don't believe specifically for your case (ie, an NSPopUpButton),
but this
On Jul 27, 2008, at 1:37 PM, Fabian wrote:
I want to query all keys in
each dictionary for a given string, i. e. something like "(ANY
SELF.function.collection.keys.value contains %@, searchString)". What
is the most efficient way to do this?
Well, NSArray has a method called containsObject: s
On 28 Jul 2008, at 11:05 am, Ken Tozier wrote:
Saving/restoring the context with
*oldContext = [NSGraphicsContext currentContext];
[NSGraphicsContext setCurrentContext: oldContext];
Did the trick. No more crashes.
Since this is such a common thing to need to do, it's usually more
conveni
On 28 Jul 2008, at 11:41 am, Ashley Perrien wrote:
Given a couple points on a line I can find the intersection point
but since 2 line segments may not intersect, I then check:
if([lineOne containsPoint: intersectionPoint])
That will nearly always fail
Yep, it nearly always will. It's not
Putting two views inside a scroll view seems like a weird way to go
about this. What I would do is create a custom NSView subclass that
draws information at the top and has an NSTextView as a subview drawn
underneath.
Omar Qazi
Hello, Galaxy!
1.310.294.1593
On Jul 27, 2008, at 8:31 PM, Jac
Hello,
What should I pass to -drawInRect's attributes to draw NSString as a
single line with ellipsis at the end if it doesn't fit to the rect?
Or point me to another method that can do that.
Thank you.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple
On Jul 27, 2008, at 11:31 PM, Jacob Bandes-Storch wrote:
I'm trying to create a Mail-style scroll view, with a view for
information (like the view for message headers) above a text view
for the content. I created two NSViews in Interface Builder, changed
the class of the bottom one to NSText
iPhone SDK
--
Until an announcement is made otherwise, developers should be aware
that the iPhone SDK is still under non-disclosure (section 5.3 of the
iPhone Development Agreement). It can't be discussed here, or anywhere
publicly. This includes other mailing lists, forums, and als
Hi,
Heres what u can do,
NSString *stringToDraw; // the string to draw
NSMutableDictionary *attrs = [NSMutableDictionary
dictionaryWithCapacity:2];
NSMutableParagraphStyle *ps = [[[NSMutableParagraphStyle alloc] init]
autorelease];
[ps setLineBreakMode:NSLineBreakByTruncatingTail];
[attrs se
iPhone SDK
--
Until an announcement is made otherwise, developers should be aware
that the iPhone SDK is still under non-disclosure (section 5.3 of the
iPhone Development Agreement). It can't be discussed here, or anywhere
publicly. This includes other mailing lists, forums, and als
Thanks, exactly what I need.
Btw, is there any easy way to center this line vertically? Or I need
to measure it's height and offset it vertically myself?
On Mon, Jul 28, 2008 at 9:57 AM, chaitanya pandit
<[EMAIL PROTECTED]> wrote:
> Hi,
> Heres what u can do,
>
> NSString *stringToDraw; // the str
On 28 Jul 2008, at 1:52 pm, Omar Qazi wrote:
To be honest, I don't know if this will work, since I don't know if
containsObject is checking if the argument is a pointer to an object
in the array, or if it is equal to the object, but it's better than
nothing, I guess.
From the docs:
con
Err, how about - (BOOL)setSelectionIndex:(NSUInteger)index;
I'm not familiar with bindings and haven't used NSArrayController, but
this was immediately obvious in the docs. So obvious, it suggests I've
missed the point...
htha,
Graham
On 28 Jul 2008, at 1:43 pm, John Joyce wrote:
NSA
Scratch that, I read on and realised you've already found it. D'oh!
G
On 28 Jul 2008, at 4:37 pm, Graham Cox wrote:
Err, how about - (BOOL)setSelectionIndex:(NSUInteger)index;
I'm not familiar with bindings and haven't used NSArrayController,
but this was immediately obvious in the docs. S
Graham's suggestion is also better because -[NSGraphicsContext
setCurrentContext:] just releases the context that was previously
current, as opposed to autoreleasing it.
So this has a bug:
NSGraphicsContext *originalContext = [NSGraphicsContext currentContext];
[NSGraphicsContext setCurrentContex
85 matches
Mail list logo