Thanks for correcting me. I have a lot to learn about this.
Kyle Sluder wrote:
On Tue, Mar 10, 2009 at 9:24 PM, Daniel Richman
wrote:
Set your program as a User Agent with launchd on install (i.e., a login
item). launchd will make sure your program is running when the user logs in
Set your program as a User Agent with launchd on install (i.e., a login
item). launchd will make sure your program is running when the user logs in.
Then, take a look at the NSTimer docs to implement the every-so-often
part of it.
--Daniel Richman
Pierce Freeman wrote:
Hi everyone:
I am
Thanks for correcting that. I'd forgotten that long long existed.
--Daniel Richman
Kyle Sluder wrote:
On Sat, Mar 7, 2009 at 8:13 PM, Daniel Richman
wrote:
But your app could be running on a 32 bit only machine, so 64 bit is not a
bet to make if you want this program to work on un
I don't know what the default compile settings are for 64-bit machines,
so I could be wrong. However, I think the default is 32-bit only,
regardless of environment. You have to set the compiler to also compile
64-bit binaries in the Info window of the project (right click on your
project name i
I think this is it. Thank you so much.
Daniel
Roland King wrote:
Daniel Richman wrote:
Hi all,
I am trying to write an app that has a hard-coded NSString, formatted
like this:
@"Alex: This is a test.\nBruce: One two.\nFred: This is another test."
The idea is that the lines i
Hi all,
I am trying to write an app that has a hard-coded NSString, formatted
like this:
@"Alex: This is a test.\nBruce: One two.\nFred: This is another test."
The idea is that the lines in the text are spoken using the indicated
voice. In the example above, line one is Alex, line two is Bru
Another way of doing this: Cocoa Programming for Mac OS X talks about
this specific thing. It's either the second-to-last or the last chapter,
and it's entitled "NSTask."It allows you to wrap around a shell command
and get stdout and stderr. Obviously, if there's a framework, that's
best, but t
If your array is called myArray, type
po myArray
in the debugger, and it will print the value of all objects in the array.
Daniel
MAGDELENAT Philippe wrote:
Hi,
I am wondering how to see the value of a NSNumber in XCode debugger
using a formatter when the said NSNumber is in a NSMutableArr
Correct. You need to make an agent, not a daemon.
Daniel
Geoff Beier wrote:
On Fri, Aug 1, 2008 at 6:11 AM, Ivan C Myrvold <[EMAIL PROTECTED]> wrote:
I have developed a daemon which is launched by launchd. It have no user
interface, other than putting up a status menu with an icon at the s
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
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
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
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
Hi All,
I just finished reading the docs on memory management and want to make
sure I got everything right (for non-GC apps):
1) Any object returned by new, alloc, copy or any derivates
(mutableCopy, etc.) is 'yours.' You must release/autorelease it yourself.
2) Objects not returned by any
Stefan Arentz wrote:
Hi Jon
Just an aside - does Hillegass, Third Edition teach you Core Data?
The blurb on Amazon says it does but when I looked at the index
online it didn't mention Core Data.
No it does not teach you Core Data.
There are two Core Data chapters but they are more 'click h
Of course. I actually realized this with chemid (it had been id) but I
had completely forgotten about description. Thanks to all.
Daniel
mmalc Crawford wrote:
On Jul 12, 2008, at 11:00 AM, Daniel Richman wrote:
The entity is a chemical with three string attributes: chemid, name,
and
Hi All,
I'm trying to create a simple Core Data app. I've done this before with
success. I'm using an NSArrayController set to Entity mode. The entity
is a chemical with three string attributes: chemid, name, and
description. In MyDocument.xib, I've created a table view and done all
the bindi
Hi All,
I want to start an application (it's bundled with my main app) in a
specific case. It was previously installed to a known location (it's a
helper app, so I put it in ~/Library/Application Support -- was that the
right thing to do?), so is there any class I can call upon, or is the
bes
If the window is shown immediately and the "Visible at Launch" flag is
set, have you connected the 'window' outlet?
This was it! Thanks so much.
Daniel
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or mode
Hi All,
I must be missing something blatantly obvious, but here goes: I made a
Preferences window whose File's Owner is a custom class:
PreferencesController, which is a subclass of NSWindowController. If you
click on the Preferences menu item, the window is shown by
[prefController showWind
Thanks! This is perfect.
Ken Thomases wrote:
On Jul 2, 2008, at 5:21 PM, Daniel Richman wrote:
I thought of that, and it's certainly a possibility, but it seems
mainly intended for preferences. I was wondering, before I turn to
that, if there's some other way of doing it t
I thought of that, and it's certainly a possibility, but it seems mainly
intended for preferences. I was wondering, before I turn to that, if
there's some other way of doing it that's more designed for this.
Thanks,
Daniel
I. Savant wrote:
I need some way for the agent to save its list of ale
Hi All,
I'm writing a program with a helper agent. The agent runs in the
background, occasionally putting up alerts for the user to see. When the
main program is running, it communicates information to the agent about
what alerts to display. Then, the agent remembers this information after
th
;
}
@end
Thats the simple single threaded case. Things get much more
interesting if you want to be able to call 'bar' from multiple threads.
Compiled in Mail -
Jon Hess
On Jul 1, 2008, at 3:35 PM, Daniel Richman wrote:
Hi All,
I have created a class (call it Foo) that the
Hi All,
I have created a class (call it Foo) that there will be one and only one
instance of (call it Bar). I need some way to have Foo keep a pointer to
Bar, so when another object asks for the pointer to Bar, Foo will be
able to return the pointer.
Presumably this can be done, as NSNotific
Use this:
NSTimer *myTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 // number
of seconds as double
target:self // targer
selector:@selector(checkTimer:) // selector to call (parameter is the timer)
userInfo:nil // I don't use any user info
repeats:YES]; // whether the timer repeats or is o
Sorry, I just realized that won't work for floating point numbers. But
you can check if the number is an integer first, then use the % operand
if so.
Daniel
Daniel Richman wrote:
Use
double newNumber = oldNumber % 13;
This will return your number's remainder when dividing
Use
double newNumber = oldNumber % 13;
This will return your number's remainder when dividing between 13, which
could be 0 - 12.
Daniel
Ashley Perrien wrote:
Is there a fairly simple way of setting up a clock style looping of
numbers? Where 1-12 act normally but 11 + 2 would return 1 and s
One second seems to be accurate enough for my purposes, but I'll
investigate using 0.5 seconds.
Daniel
Shawn Erickson wrote:
On Sat, Jun 28, 2008 at 7:58 AM, Michael Ash <[EMAIL PROTECTED]> wrote:
On Sat, Jun 28, 2008 at 12:10 AM, Shawn Erickson <[EMAIL PROTECTED]> wrote:
Also you s
Seconds);
timeInSeconds--;
}
}
Thanks again to all.
Daniel
Ken Thomases wrote:
On Jun 27, 2008, at 10:55 PM, Daniel Richman wrote:
I'm trying to program a simple timer app: you enter a number of
seconds, and it updates a text field every second with the number of
secs remaining. The
Hi All,
I'm trying to program a simple timer app: you enter a number of seconds,
and it updates a text field every second with the number of secs
remaining. The problem is that I'm not able to do anything with the UI
while this is going on. Here's my code:
- (IBAction)startTimer:(id)sender
{
Here is a simple example:
-(NSArray*) makeObject {
NSArray *a = [NSArray arrayFromObjects];someObject, anotherObject,
nil];
This should be NSArray *a = [NSArray arrayFromObjects:someObject,
anotherObject];
// should I [a retain];
I would use [a retain];
// or [a release];
/
What do you mean, loading a NIB? Do you mean in Interface Builder, or at
runtime?
Daniel
J. Todd Slack wrote:
Hi All,
Are there any examples of loading a NIB, accessing a tab view in a
window of the NIB I just loaded?
I was trying to accomplish via AppleScript originally, but nothing
see
Hello All,
I have an NSDateFormatter in an NSTableView. I would like the user to be
able to enter dates in different ways, e.g.
1/2/07
January 17, 2008
I know it is possible to set how the date is formatted at compile time
via IB, but is there any way to accept multiple formats at runtime?
I think it's fine. This was my code for your exercise:
-(void)tableView:(NSTableView *)aTableView
setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
NSLog(@"Replacing '%@' with '%@'", [toDoList
objectAtIndex:rowIndex], anObject);
[to
Can you post your code for your main class? I've been doing the same
thing and haven't had anything like that.
Daniel
William Squires wrote:
Okay, here's a strange UI glitch. I have an Xcode project in which I
have a "to-do" list (the challenge in Chapter 6 of the new Hillegaas
book). I've
You should implement
-(void)tableView:(NSTableView *)aTableView
setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
The table view sends this message to you when one of its cells is being
edited, and then you do whatever you want with the dat
Hi All,
I was wondering if there's any way to put a strikethrough in text the
program generates to put on screen (not something the user enters). For
example, in HTML (I know this is a long way from that), you can use the
and tags. Is there anything to do that in Cocoa?
Thanks,
Daniel
Ah. So the typedef changes depending on the platform.
Interesting, thanks.
Nick Zitzmann wrote:
On Jun 21, 2008, at 9:13 AM, Daniel Richman wrote:
Thanks! I don't know why they introduced NSInteger. It sounds like it
would be a subclass of NSNumber.
They did that so that NSData
h.
Charles
On Jun 21, 2008, at 10:13 AM, Daniel Richman wrote:
Thanks! I don't know why they introduced NSInteger. It sounds like it
would be a subclass of NSNumber.
That didn't seem to be the problem, though. The program still crashes
only when you aren't deleting t
;s not an
object, and definitely not an NSNumber. But I've seen a few errors
confusing the two lately that didn't seem to happen before).
hth,
Graham
On 21 Jun 2008, at 12:51 pm, Daniel Richman wrote:
I've got an NSTableView that displays the data in an NSMutableArray.
(The prog
Hi All,
I've got an NSTableView that displays the data in an NSMutableArray.
(The program is a to-do list.) I just tried adding a function to allow
you to delete an item: you select the item in the table and then click
delete. My code is as follows:
- (IBAction)deleteItem:(id)sender
{
int
when you try to addObject you're sending a message to
nil, which is acceptable under Objective-C
On 17-Jun-08, at 5:02 PM, Daniel Richman wrote:
I've got an object which has an NSMutableArray as an instance
variable. If, in one of my methods, I try to call
[myArray addObject:@&quo
I've got an object which has an NSMutableArray as an instance variable.
If, in one of my methods, I try to call
[myArray addObject:@"this is a test"]; (for example),
I get no error, but the object isn't added. If I try to do
[myArray objectAtIndex:0];
I get (null), and
[myArray count];
ret
44 matches
Mail list logo