Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Search Forums > Search Results

Showing results 1 to 50 of 101
Search: Posts Made By: ali
Thread Thread Starter Last Post Replies Views Forum
The TextEdit source code shows how to implement... 451 Views / 2 Replies  
The TextEdit source code shows how to implement the two services TextEdit exports.

In addition, these is source code for a simple service that works on text (SimpleService) and a filter service...
Posted by ali, on Jul 19, 2001 at 01:10 PM, in Developer Center
In general, mutation of mutable collections is... 701 Views / 1 Replies  
In general, mutation of mutable collections is not thread-safe. One reason for this is performance; second reason is that you often need some external lock anyway to coordinate some of the top level...
Posted by ali, on Jun 21, 2001 at 09:22 PM, in Developer Center
Your executable has debug information. Once this... 591 Views / 6 Replies  
Your executable has debug information. Once this is removed, it should be down to a much leaner size.

One way to do this is use the "install" target, which will build and install the tool in...
Posted by ali, on Jun 13, 2001 at 09:46 PM, in Developer Center
I don't know how slow or fast Smalltalk is; but... 913 Views / 13 Replies  
I don't know how slow or fast Smalltalk is; but in ObjC, once a method has been sent once, subsequent invocations of the same method are very fast --- just a few more instructions slower than a...
Posted by ali, on Jun 10, 2001 at 03:17 AM, in Developer Center
Well, it all depends heavily on what the... 913 Views / 13 Replies  
Well, it all depends heavily on what the algorithms and the usage patterns in a given piece of code are... Some general answers:

Overall, like C++, ObjC is basically C, compiled down to machine...
Posted by ali, on Jun 9, 2001 at 12:47 AM, in Developer Center
More strictly speaking, autorelease just says... 527 Views / 8 Replies  
More strictly speaking, autorelease just says "send this object a release later". The place where autorelease is most useful is when you have to return a value from a method call, and you have to...
Posted by ali, on Jun 7, 2001 at 12:34 PM, in Developer Center
This isn't supported; the toolbar button is... 409 Views / 1 Replies  
This isn't supported; the toolbar button is supposed to just show the standard toolbar, not do anything else, so there is no public API to do something like this.

Ali
Posted by ali, on Jun 6, 2001 at 10:23 PM, in Developer Center
The reference count is used even in the absence... 527 Views / 8 Replies  
The reference count is used even in the absence of autorelease pools! ObjX is valid at the point you indicated, because it still has a refcount of 1.

Ali

[ 06-06-2001: Message edited by: ali ]
Posted by ali, on Jun 6, 2001 at 05:29 PM, in Developer Center
They don't. To indicate you can be copied, you... 527 Views / 8 Replies  
They don't. To indicate you can be copied, you need to implement the NSCopying protocol, which involves implement the copyWithZone: method. (You can usually ignore the zone.)

Note that if you are...
Posted by ali, on Jun 6, 2001 at 05:25 PM, in Developer Center
You said "method," so I'm assuming you're using... 496 Views / 4 Replies  
You said "method," so I'm assuming you're using ObjC and Cocoa. You can use NSDate easily:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1...
Posted by ali, on Jun 6, 2001 at 04:34 PM, in Developer Center
Every Cocoa app has a single instance of... 785 Views / 12 Replies  
Every Cocoa app has a single instance of NSApplication, which is accessible via [NSApplication sharedApplication]. You should send any NSApplication messages to that instance, so

[[NSApplication...
Posted by ali, on Jun 1, 2001 at 07:44 PM, in Developer Center
And I get the following error: -[NSPanel... 785 Views / 12 Replies  
And I get the following error: -[NSPanel beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:]: selector not recognized

This problem is because NSPanel does indeed not have a...
Posted by ali, on May 30, 2001 at 08:06 PM, in Developer Center
In TextEdit, the save sheet is put up at one... 785 Views / 12 Replies  
In TextEdit, the save sheet is put up at one point:

[panel beginSheetForDirectory:... file:... modalForWindow:... modalDelegate:......
Posted by ali, on May 30, 2001 at 03:43 PM, in Developer Center
As other people have pointed out, you have to do... 656 Views / 11 Replies  
As other people have pointed out, you have to do this in your Info.plist file. You can list both extensions and/or types that your app is interested in. You don't do this in InternetConfig.

If...
Posted by ali, on May 26, 2001 at 12:49 PM, in Developer Center
At WWDC, during the first day sessions, Scott... 537 Views / 11 Replies  
At WWDC, during the first day sessions, Scott Forstall discussed the major application programming environments available on Mac OS X (Classic, Java, BSD, Cocoa, and Carbon) and pointed out that the...
Posted by ali, on May 23, 2001 at 01:01 PM, in Developer Center
All Cocoa apps also support Unicode input, and... 388 Views / 4 Replies  
All Cocoa apps also support Unicode input, and work with Chinese and Korean as well as Japanese. And yes, at WWDC it was announced that these languages (along with a few other European languages, in...
Posted by ali, on May 23, 2001 at 02:49 AM, in macOS
Actually no, it's pretty strict with regards to... 2,558 Views / 29 Replies  
Actually no, it's pretty strict with regards to the keywords. So if there are keywords, they have to be in the specified order, and the keywords have to be specified.

Might be nice to allow...
Posted by ali, on May 19, 2001 at 04:51 PM, in Developer Center
Also, [document save:YES usingName:"My Doc"... 2,558 Views / 29 Replies  
Also,

[document save:YES usingName:"My Doc" asRichText:NO createPreview:YES saveBackup:NO];


is lot clearer than

document.save(YES, "My Doc", NO, YES, NO);

So when you have multiple...
Posted by ali, on May 19, 2001 at 12:41 AM, in Developer Center
Borderless windows are not in general designed... 763 Views / 9 Replies  
Borderless windows are not in general designed for use with UI elements... I believe hELLO wORLD has hit it right on the head and his suggestion should help. Let us know!

Ali
Posted by ali, on May 13, 2001 at 03:34 AM, in Developer Center
Is there anything special about the window the... 763 Views / 9 Replies  
Is there anything special about the window the text field is in? Is it also programmatically created, or is it extracted from a nib? If latter, and you have a regular IB created text field in the...
Posted by ali, on May 12, 2001 at 01:29 PM, in Developer Center
Excellent advice. Calls to cString might fail... 525 Views / 4 Replies  
Excellent advice. Calls to cString might fail (and return NULL) if ever any of those strings had characters that cannot be converted into the default c-string encoding (which is what the cString...
Posted by ali, on May 11, 2001 at 05:14 PM, in Developer Center
nsString = [NSString stringWithCString:aCString];... 544 Views / 2 Replies  
nsString = [NSString stringWithCString:aCString];
char *anotherCString = [nsString cString];

One more thing to note is that c-strings can come in a variety of encodings. NSStrings on the other...
Posted by ali, on May 6, 2001 at 01:13 PM, in Developer Center
You can draw a rectangle of the same size as the... 1,049 Views / 17 Replies  
You can draw a rectangle of the same size as the image, and same color as the background. You can use something like

[[NSColor whiteColor] set];
NSRectFill(NSMakeRect(x, y, size.width,...
Posted by ali, on May 5, 2001 at 06:56 PM, in Developer Center
Yes, there is implicit double-buffering of sorts.... 1,049 Views / 17 Replies  
Yes, there is implicit double-buffering of sorts. All drawing goes to a backing store, and is flushed either when you flush it explicitly (or as a part of the normal drawing mechanism), or when your...
Posted by ali, on May 5, 2001 at 06:52 PM, in Developer Center
Buffered windows need to be flushed for the... 1,049 Views / 17 Replies  
Buffered windows need to be flushed for the output to be copied from the backing store memory to the display. When you move or touch the window, or "dip" the window (behind the dock for instance),...
Posted by ali, on May 4, 2001 at 09:52 PM, in Developer Center
Mac OS X 10.0 is not the final word on the user... 731 Views / 23 Replies  
Mac OS X 10.0 is not the final word on the user experience of file extensions. Apple is looking at this issue, with the goal of retaining the superior user experience features of Mac OS file type...
Posted by ali, on Apr 27, 2001 at 01:00 PM, in macOS
2) I can't seem to create RGB colors with... 717 Views / 3 Replies  
2) I can't seem to create RGB colors with NSColor. Do I use colorWithDeviceRed? or colorWithCalibratedRed?

"Device" colors are are colors which will always use those values, on any device....
Posted by ali, on Apr 26, 2001 at 12:20 PM, in Developer Center
Is your service implemented as: -... 465 Views / 2 Replies  
Is your service implemented as:

- (void)doSearchService:(NSPasteboard *)pboard userData:(NSString *)data error:(NSString **)error {
...
}

Did you specify your service provider?

...
Posted by ali, on Apr 22, 2001 at 02:12 PM, in Developer Center
Not totally sure, but deleting SimpleText... 568 Views / 15 Replies  
Not totally sure, but deleting SimpleText altogether might also cause TextEdit to open those documents (by default).

For speech in TextEdit: Someone should create a text-to-speech service, it'll...
Posted by ali, on Apr 19, 2001 at 06:44 PM, in macOS
There is also: ... 433 Views / 2 Replies  
There is also:

NSGraphics.drawAttributedString(NSAttributedString, NSRect);

NSGraphics.drawAttributedString(NSAttributedString, NSPoint);


There seems to be no drawString(), which would...
Posted by ali, on Apr 19, 2001 at 03:04 AM, in Developer Center
I like the MS mouse as well --- I'm using the... 800 Views / 33 Replies  
I like the MS mouse as well --- I'm using the optical one with the two buttons only ("Intellimouse with Intellieye 1.0"). You plug it into X and it just works. The scrollwheel is easy to get used to....
Posted by ali, on Apr 18, 2001 at 05:55 PM, in macOS
In general, if you link with... 572 Views / 3 Replies  
In general, if you link with Foundation.framework, you have a command-line app; if you link with AppKit. framework (or Cocoa.framework), you have a UI app. However, even if you link with AppKit or...
Posted by ali, on Apr 11, 2001 at 06:33 PM, in Developer Center
Calling objectForKey: is the right approach,... 1,849 Views / 11 Replies  
Calling objectForKey: is the right approach, something else must be busted. You're doing the following?

[[NSUserDefaults standardUserDefaults] objectForKey:defaultName]

Ali
Posted by ali, on Apr 11, 2001 at 06:28 PM, in Developer Center
drawRect() is not meant to be called directly;... 1,441 Views / 3 Replies  
drawRect() is not meant to be called directly; it's meant to be implemented by subclassers of NSView, and the drawing machinery is supposed to call it for you.

To force a redraw, call...
Posted by ali, on Apr 11, 2001 at 06:24 PM, in Developer Center
Here are the object ownership guidelines in... 512 Views / 8 Replies  
Here are the object ownership guidelines in Cocoa, starting with the most important:

1. Objects returned from method calls should not be freed by the caller unless the method is a "new", "alloc",...
Posted by ali, on Apr 3, 2001 at 10:36 PM, in Developer Center
Finder looks at /Applications and a few other... 420 Views / 1 Replies  
Finder looks at /Applications and a few other special places (/Network/Applications; Applications in your home folder; etc) for applications automatically. (And subfolders of these...) That means...
Posted by ali, on Mar 25, 2001 at 03:18 PM, in macOS
You can use the "size" command on a binary to... 613 Views / 8 Replies  
You can use the "size" command on a binary to find out how much space is being used up by what in the binary. For instance, if I build TextEdit and do:

size...
Posted by ali, on Mar 24, 2001 at 08:42 PM, in Developer Center
If you're seeing executable size of 500-800K for... 613 Views / 8 Replies  
If you're seeing executable size of 500-800K for a small app, it's most likely due to debugging symbols and such. Typically the binary for a small app is in the 30-60K range; with icon and other...
Posted by ali, on Mar 24, 2001 at 01:44 PM, in Developer Center
Variable argument lists have always been a bit... 627 Views / 4 Replies  
Variable argument lists have always been a bit troublesome in C... Best to limit their use as much as possible.


I suppose one issue with putting a NULL automatically at the end could be that if...
Posted by ali, on Mar 23, 2001 at 12:48 PM, in Developer Center
thisImage = [NSData... 1,246 Views / 2 Replies  
thisImage = [NSData dataWithContentsOfFile:@"/Developer/Examples/Carbon/SimpleText/Sources/SimpleTextDoc.tiff"];
...
[imageWindow replaceCharactersInRange: NSMakeRange(0, 0) withRTFD: thisImage];
...
Posted by ali, on Mar 22, 2001 at 06:03 PM, in Developer Center
Significant changes (bug fixes and features) will... 396 Views / 2 Replies  
Significant changes (bug fixes and features) will be listed in the release notes, in /Developer/Documentation/ReleaseNotes/AppKit.html, Foundation.html, and others.

As far as the exact reason why...
Posted by ali, on Mar 22, 2001 at 03:58 AM, in Developer Center
Note that NSColor objects cannot be written... 562 Views / 4 Replies  
Note that NSColor objects cannot be written directly to defaults, as they are not one of the few special "plist" classes. However, you can archive a color object as a data, then write that. If you...
Posted by ali, on Mar 19, 2001 at 07:57 PM, in Developer Center
In advertising changes to preferences (that are... 651 Views / 12 Replies  
In advertising changes to preferences (that are stored in the XML plist files in the preferences folder), please encourage the use of the "defaults" command line tool rather than any hand editing of...
Posted by ali, on Mar 19, 2001 at 12:37 PM, in macOS
Before anyone recommends vi, emacs, or pico to a... 674 Views / 15 Replies  
Before anyone recommends vi, emacs, or pico to a cliphobe, TextEdit application on X will often get the job done when dealing with plain text Unix files (as well as rich, RTF files), without having...
Posted by ali, on Mar 17, 2001 at 03:21 PM, in macOS
Is the text object first responder? That is, does... 617 Views / 4 Replies  
Is the text object first responder? That is, does it have a blinking cursor? You do this either by clicking it the text view (obviously), or by [[view window] makeFirstResponder:view];

Are you...
Posted by ali, on Mar 13, 2001 at 06:49 PM, in Developer Center
Not always. I believe in general a C... 562 Views / 4 Replies  
Not always.

I believe in general a C function does not know how many arguments it has, so it has to use some other means to determine how many arguments to pull off the stack. In the case of...
Posted by ali, on Mar 12, 2001 at 06:51 PM, in Developer Center
When you do arrayWithObjects:, be sure to... 562 Views / 4 Replies  
When you do arrayWithObjects:, be sure to terminate the list of objects with NULL:

arr = [NSArray arrayWithObjects:@"s",t0, NULL];

You need this because arrayWithObjects: takes a variable...
Posted by ali, on Mar 12, 2001 at 06:02 PM, in Developer Center
Most of Cocoa is implemented in C or Objective-C;... 687 Views / 5 Replies  
Most of Cocoa is implemented in C or Objective-C; you really would not want to interpret that, unlike Java, whose "bytecodes" are designed for interpreting.

However, as 00101001 says, earlier...
Posted by ali, on Mar 9, 2001 at 02:32 AM, in Developer Center
As far as "Unicode" handling, any character will... 1,081 Views / 9 Replies  
As far as "Unicode" handling, any character will be handled properly (and not lost). But as far as display, this depends on the availability of an appropriate font, and I am not sure how complete...
Posted by ali, on Mar 8, 2001 at 02:19 PM, in Developer Center
Unicode is the best, most robust way. For... 1,081 Views / 9 Replies  
Unicode is the best, most robust way. For instance, for em-dash use:

unichar ch = 0x2014;
NSString *emdash = [NSString stringWithCharacters:&ch length:1];

Another option is to use 8-bit chars,...
Posted by ali, on Mar 8, 2001 at 01:58 PM, in Developer Center
Showing results 1 to 50 of 101
 
Top
Privacy Policy
All times are GMT -4. The time now is 10:41 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,