Re: display Mac id

2009-06-23 Thread Laurent Cerveau
You can use IOKit UserLibg  get the MAC hardware address. I did not  
retest it though (it comes from older code) so you probably have to  
check for small bugs.


laurent

kern_return_t   kernResult;
mach_port_t masterPort;
io_service_t tmpService, controllerService;
CFDataRef macAddressData;
CFMutableDictionaryRef  classesToMatch;

//Get the master port
kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
//Find the etherner 0 card criteria
classesToMatch = IOBSDNameMatching(masterPort,0,"en0");
//find the corresponding service
tmpService = IOServiceGetMatchingService(masterPort, classesToMatch);   
// by asking for it specifically.
kernResult = IORegistryEntryGetParentEntry( tmpService,  
kIOServicePlane, &controllerService );


//now we get the data and do something with them
macAddressData = (CFDataRef)  
IORegistryEntryCreateCFProperty 
( controllerService,CFSTR(kIOMACAddress), kCFAllocatorDefault, 0);		


//release what is needed
CFRelease(macAddressData);
IOObjectRelease(controllerService);
IOObjectRelease(tmpService);

On Jun 23, 2009, at 9:04 AM, Kiran Kumar wrote:


Hi all,

i am doing project to change MAC Address ,i want to display MACID in
a single textbox like 00:15:e9:4c:c3:d7

or 00-15-e9-4c-c3-d7 can any one help me plz ...




Thanks,
kiran

The information contained in this email and any attachments is  
confidential and may be subject to copyright or other intellectual  
property protection. If you are not the intended recipient, you are  
not authorized to use or disclose this information, and we request  
that you notify us by reply mail or telephone and delete the  
original message from your mail system.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com

This email sent to lcerv...@me.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: about NSThread crash

2009-06-23 Thread Chris(吴潮江)



On Jun 24, 2009, at 2:28 AM, Ken Thomases wrote:


You probably don't need to use a background thread to do FTP.  You can  do 
it using asynchronous methods on the main thread.  Since you can,  you 
probably should.  It's almost always less error prone and even  more 
efficient.



Considering the GUI operations, I use the background thread to do FTP.



How are you pausing and resuming the download?

As you said, through controlling this from the GUI, when user click the
pause button, I will stop receiving the data in the background and exit the
thread.


Doing it the "naive" way will get you in trouble.
 In fact, In Windows platform, I control it successful with the same 
methods.

 Maybe it is really "naive" way in the Mac platform.


You should launch the program in the debugger, instead -- use Debug 
instead of  Run.  That way, it will reliably show you the proper thread in 
the  event of a crash.

According to your suggestion, I will try to do it.

Thanks.

Regards,
Chris


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Selectively using formatter in table view text cell

2009-06-23 Thread Graham Cox


On 24/06/2009, at 4:00 PM, Quincey Morris wrote:


(a) Use the delegate, something like (untested, obviously):

-(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell  
forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {

if (!)
return;
	id objectValue = [self.delegate tableView: self  
objectValueForTableColumn:aTableColumn row:rowIndex;
	// or find the data directly from your data model, if not using a  
data source

if (objectValue isKindOfClass: [NSNumber class])
aCell.formatter = myFormatter;
else
aCell.formatter = nil;
}



Thanks! That works fine and was very easy...

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: about NSThread crash

2009-06-23 Thread Ken Thomases

On Jun 24, 2009, at 1:12 AM, Chris(吴潮江) wrote:

I have some problems when to using thread. As we all know, there is  
a method to create a thread,
+ (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget  
withObject:(id)anArgument.

- (void)aSelector:(id)anArgument
{
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   //  Here I implement FTP functions. e.g. download/ pause  
download/ resume download file.

   [pool release];
   [NSThread exit];
}


You probably don't need to use a background thread to do FTP.  You can  
do it using asynchronous methods on the main thread.  Since you can,  
you probably should.  It's almost always less error prone and even  
more efficient.



To my surprise, when downloading a file, I pause download and no  
error display. Then I resume to download file,

it's ok.


How are you pausing and resuming the download?  I assume the user is  
controlling this from the GUI.  If so, how are you communicating this  
request to the background thread?  How is the background thread  
receiving and acting on the request?  When you use multiple threads,  
you have to be very careful and deliberate about how you do things  
like this.  Doing it the "naive" way will get you in trouble.


However, at this time I pause download file, there will be a error  
showing EXC_BAD_ACCESS and the stack

information is:
mach_msg_trap
mach_msg
CFRunLoopRunSpecific
CFRunLoopRunInMode
RunCurrentEventLoopInMode
ReceiveNextEventCommon
BlockUnitlNextEventMatchingListInMode
_DPSNextEvent
_[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
_[NSApplication run]
NSApplicationMain


This is the stack for the main thread.  Judging from its normality,  
it's probably not the thread on which the exception occurred.  The  
debugger is showing you an arbitrary thread.  This can happen if you  
rely on Xcode's "auto-attach debugger on crash" feature.  You should  
launch the program in the debugger, instead -- use Debug instead of  
Run.  That way, it will reliably show you the proper thread in the  
event of a crash.


Regards,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


about NSThread crash

2009-06-23 Thread Chris(吴潮江)
Hi,
I have some problems when to using thread. As we all know, there is a method to 
create a thread,  
+ (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget 
withObject:(id)anArgument.
- (void)aSelector:(id)anArgument
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//  Here I implement FTP functions. e.g. download/ pause download/ resume 
download file.
[pool release];
[NSThread exit];
}
To my surprise, when downloading a file, I pause download and no error display. 
Then I resume to download file,
it's ok. However, at this time I pause download file, there will be a error 
showing EXC_BAD_ACCESS and the stack
information is:
mach_msg_trap
mach_msg
CFRunLoopRunSpecific
CFRunLoopRunInMode
RunCurrentEventLoopInMode
ReceiveNextEventCommon
BlockUnitlNextEventMatchingListInMode
_DPSNextEvent
_[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
_[NSApplication run]
NSApplicationMain

I don't know why? 
Please tell me the reason if anyone knows.
Thanks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Selectively using formatter in table view text cell

2009-06-23 Thread Quincey Morris

On Jun 23, 2009, at 22:27, Graham Cox wrote:


I have a table view that displays the contents of a dictionary.

The values can be string data or numeric data. For numeric, I want  
to use a formatter to make it nice and pretty, but for string data I  
want to display it verbatim. If I attach a formatter to the text  
cell it refuses to validate pure string input. Is there a way to set  
up the formatter this way, or do I need to either create a special  
formatter or apply the formatter selectively for different rows (if  
so, how?).



(a) Use the delegate, something like (untested, obviously):

-(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell  
forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {

if (!)
return;
	id objectValue = [self.delegate tableView: self  
objectValueForTableColumn:aTableColumn row:rowIndex;
	// or find the data directly from your data model, if not using a  
data source

if (objectValue isKindOfClass: [NSNumber class])
aCell.formatter = myFormatter;
else
aCell.formatter = nil;
}

(b) Add a string version of the property to your data model, using a  
suitable formatter internally, and bind the column to that.





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UML Diagramming or Other Helpful Software?

2009-06-23 Thread Philip Mötteli

Hi,


Am 24.06.2009 um 03:49 schrieb Brad Gibbs:

I'm wondering if there are some tools commonly in use in the Mac  
software development community for diagramming an app, creating use  
cases and / or requirements, etc.  I've seen OmniGraffle and  
ConceptDraw.  I'm just wondering how other people go about laying  
out their apps from 30,000 feet, and whether there are tools for  
this I haven't bumped into, yet.


I'm feeling the most comfortable with Visual-Paradigm.


Re


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Jeff Laing
I won't argue too strongly on this (though I should because I *have* configured 
sendmail systems and its just not that hard, if you're a developer. And I have 
rolled my own Perl scripts that talked enough SMTP to connect directly, so its 
not that big a deal, again for a developer), but my point was that the 
arguments that said "don't use sendmail, it won't get through firewalls that 
block port 25" are just wrong.

Now, if someone had said "Apple's default firewall only lets Mail.app connect 
out through port 25", I'd have gone home and taken a look because I wasn't 
aware of that capability being in the box.  That's why I use Little Snitch.

The points being made about some users not having an SMTP-able email server is 
quite valid.  Though people using gmail can still do smtp, as far as I'm aware.

http://lifehacker.com/software/email-apps/how-to-use-gmail-as-your-smtp-server-66.php

-Original Message-
From: Andrew Farmer [mailto:andf...@gmail.com] 
Sent: Wednesday, 24 June 2009 3:27 PM
To: Jeff Laing
Cc: Nick Zitzmann; cocoa-dev@lists.apple.com
Subject: Re: Cocoa and email (SMTP/POP3)

On 23 Jun 2009, at 21:52, Jeff Laing wrote:
> Ok, I'll bite.
>
> How does the mail server that Mail.app is talking to distinguish  
> between Mail.app and /usr/sbin/sendmail ?  They both presumably just  
> talk SMTP ?

Mail.app is configurable by the user to connect to a specific relay  
mail server, potentially using login credentials, SSL, and/or an  
alternate port. Sendmail, by contrast, is not configurable (without  
cracking open the terminal, at least), and will by default always  
connect directly to the destination mail server. It's this exact  
behavior that makes it unlikely to work properly.

Consider also that not all users even have Mail.app configured. An  
increasing number of users use online mail services such as GMail  
exclusively. In their case, not even scripting Mail.app will help you.

If you really need to deliver email notifications from an application,  
the only reliable solution is to put together a properly secured web- 
to-email gateway for your application somewhere and use that. Sending  
email directly from the desktop is no longer a viable solution without  
explicit configuration.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Andrew Farmer

On 23 Jun 2009, at 21:52, Jeff Laing wrote:

Ok, I'll bite.

How does the mail server that Mail.app is talking to distinguish  
between Mail.app and /usr/sbin/sendmail ?  They both presumably just  
talk SMTP ?


Mail.app is configurable by the user to connect to a specific relay  
mail server, potentially using login credentials, SSL, and/or an  
alternate port. Sendmail, by contrast, is not configurable (without  
cracking open the terminal, at least), and will by default always  
connect directly to the destination mail server. It's this exact  
behavior that makes it unlikely to work properly.


Consider also that not all users even have Mail.app configured. An  
increasing number of users use online mail services such as GMail  
exclusively. In their case, not even scripting Mail.app will help you.


If you really need to deliver email notifications from an application,  
the only reliable solution is to put together a properly secured web- 
to-email gateway for your application somewhere and use that. Sending  
email directly from the desktop is no longer a viable solution without  
explicit configuration.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Selectively using formatter in table view text cell

2009-06-23 Thread Graham Cox

I have a table view that displays the contents of a dictionary.

The values can be string data or numeric data. For numeric, I want to  
use a formatter to make it nice and pretty, but for string data I want  
to display it verbatim. If I attach a formatter to the text cell it  
refuses to validate pure string input. Is there a way to set up the  
formatter this way, or do I need to either create a special formatter  
or apply the formatter selectively for different rows (if so, how?).


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Jeff Laing
Ok, I'll bite.

How does the mail server that Mail.app is talking to distinguish between 
Mail.app and /usr/sbin/sendmail ?  They both presumably just talk SMTP ?

If the scriptable solution works, then roll-your-own-smtp should also work, 
provided you go the hard yards and implement everything it requires (like the 
tricky authentication stuff).  And I'd have thought that /usr/bin/sendmail 
should do that just fine?  Am I missing some subtlety?

-Original Message-
From: cocoa-dev-bounces+jeff.laing=spatialinfo@lists.apple.com 
[mailto:cocoa-dev-bounces+jeff.laing=spatialinfo@lists.apple.com] On Behalf 
Of Nick Zitzmann
Sent: Wednesday, 24 June 2009 2:14 PM
To: Dave DeLong
Cc: cocoa-dev@lists.apple.com
Subject: Re: Cocoa and email (SMTP/POP3)


On Jun 23, 2009, at 9:42 PM, Dave DeLong wrote:

> 3.5: Use /usr/sbin/sendmail:  Create an NSTask that launches /usr/ 
> sbin/sendmail, configures the headers, and then just pipes your  
> email through the task's standardInput.


I can't really recommend doing that in a non-internal app, though,  
because if the user only has a static IP address and no domain name,  
then a good deal of mail servers won't accept the mail from the host  
unless they identify using a fake host name and get lucky.

Nick Zitzmann


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jeff.laing%40spatialinfo.com

This email sent to jeff.la...@spatialinfo.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Nick Zitzmann


On Jun 23, 2009, at 10:13 PM, Nick Zitzmann wrote:

I can't really recommend doing that in a non-internal app, though,  
because if the user only has a static IP address and no domain name,  
then a good deal of mail servers won't accept the mail from the host  
unless they identify using a fake host name and get lucky.



I almost forgot: All but the mom-and-pop public and semi-private Wi-Fi  
providers in the world block outgoing port 25, except maybe to their  
special servers, for fairly obvious reasons. So yeah, don't use  
sendmail for directly sending messages in non-internal apps. The  
Scripting Bridge is the best way to go in most cases.


Nick Zitzmann


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSScrollView: special handling of subview's headerView?

2009-06-23 Thread Quincey Morris

On Jun 23, 2009, at 18:11, Aaron Burghardt wrote:

I recently encountered a problem with a custom NSView sublcass that  
is designed to be a container for 3 WebViews and is embedded in a  
scroll view.  The problem was that once the view was added to the  
view hierarchy, one of its WebViews was removed and inserted as a  
sibling to the view.  I posted a question on the WebKit SDK mailing  
list because I thought my problem was related to WebView, but I  
determined that it occurred because my NSView subclass had an  
instance variable named headerView and that view was automatically  
set up as if a header, similar to an NSTableView or NSOutlineView  
column headerView. Renaming the ivar eliminated the problem.  My  
question is, is this documented behavior?  I intend to file a  
documentation bug, but I wanted to make sure I didn't miss something.


Also see:

http://codehackers.net/blog/?p=10

The behavior is partially described here:


http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Concepts/TableParts.html

although you'd be justified in concluding that it only happens with an  
embedded NSTableView (or subclass like NSOutlineView).


You might want to file a bug against NSScrollView itself, instead of  
the documentation. Having it check random classes for random method  
names seems a bit rude. It should probably only check if the subview  
is some kind of NSTableView, or whatever.


Incidentally, the fact that this behavior found a instance variable of  
yours implies that your NSView subclass lets  
'accessInstanceVariablesDirectly:' return YES (the default).  
Unfortunately there doesn't seem a way to make this default to NO (a  
*much* better idea -- the dangers far outweigh any convenience, since  
the default pretty much makes all your instance variables public), but  
this is a useful lesson that overriding it to return NO in every class  
you write is not a bad idea (though a PITA to do).



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Andrew Farmer

On 23 Jun 2009, at 20:42, Dave DeLong wrote:
3.5: Use /usr/sbin/sendmail:  Create an NSTask that launches /usr/ 
sbin/sendmail, configures the headers, and then just pipes your  
email through the task's standardInput.


That doesn't work for users behind residential ISPs that block port  
25, or for destinations that block mail from residential ISPs.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Dave DeLong
That's a good point, and one that I brushed past because I was using  
it for an internal app.  So yeah: use at your own risk.  =)


Dave

On Jun 23, 2009, at 10:13 PM, Nick Zitzmann wrote:


On Jun 23, 2009, at 9:42 PM, Dave DeLong wrote:

3.5: Use /usr/sbin/sendmail:  Create an NSTask that launches /usr/ 
sbin/sendmail, configures the headers, and then just pipes your  
email through the task's standardInput.



I can't really recommend doing that in a non-internal app, though,  
because if the user only has a static IP address and no domain name,  
then a good deal of mail servers won't accept the mail from the host  
unless they identify using a fake host name and get lucky.


Nick Zitzmann




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 12:41 AM, Dave Carrigan wrote:
>
> On Jun 22, 2009, at 9:01 PM, Michael Ash wrote:
>
>> -Wconversion warns you every time
>> a function call has the parameter passing altered by the presence of
>> the function's prototype, which is to say that it will warn you every
>> time you call any function (or method) which takes a char, unsigned
>> char, short, unsigned short, or float. Not exactly useful.
>
> At least until Xcode gets gcc 4.3, where -Wconversion has been renamed
> -Wtraditional-conversion, and -Wconversion gives useful warnings about
> variables that might have their value changed during the conversion.
>
> This page
> http://developer.apple.com/documentation/Darwin/Conceptual/64bitPorting/building/building.html does
> seem to suggest that -Wconversion has its place but istm that you will have
> a lot of difficulty isolating the real problems from all of the error chaff.

Again, -Wconversion does nothing to help with 64-bit coding on the
version of gcc that Apple is currently shipping. Read the man page if
you don't believe it. The useful one for this purpose is
-Wshorten-64-to-32. That Apple document is either wrong or referring
to a different version of gcc than the one my man page is talking
about.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Nick Zitzmann


On Jun 23, 2009, at 9:42 PM, Dave DeLong wrote:

3.5: Use /usr/sbin/sendmail:  Create an NSTask that launches /usr/ 
sbin/sendmail, configures the headers, and then just pipes your  
email through the task's standardInput.



I can't really recommend doing that in a non-internal app, though,  
because if the user only has a static IP address and no domain name,  
then a good deal of mail servers won't accept the mail from the host  
unless they identify using a fake host name and get lucky.


Nick Zitzmann


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 3:13 PM, JongAm
Park wrote:
> Oh.. one more thing...
>
> I think you didn't catch what I wanted to say.
> It will be OK to return NULL if it can't convert a given string to a string
> in a given text encoding method.
> ( But, yes.. Apple's document mentioned that its behaviour can be changed,
> so don't rely on it. )
>
> What I wanted to say was "Why does it return a meaningful address when the
> system encoding is Japanese while it doesn't when the system encoding is
> English?".
> (When UTF8 is used for a target. )
> Can't MacRoman be converted to UTF8 while MacJapanese can be?
> I assumed that MacRoman code page is almost identical to UTF8, because UTF8
> is compatible with ASCII and MacRoman is extended form for ASCII.

Why assume? If you're working with encoded string data, it is
foolhardy to *assume* anything about the encodings that you're working
with. Go learn how they work. It's not that hard. MacRoman will
literally take you fifteen seconds to understand, as it is an
extremely simple encoding. UTF-8 is more complicated, but still pretty
easy to understand, and it is *vital* to understand it. Wikipedia has
very good articles on both encodings, as well as many others.

That you say something like "MacRoman code page is almost identical to
UTF8" indicates that your education on character encodings is woefully
lacking. You should remedy this problem ASAP.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com



Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Dave DeLong
3.5: Use /usr/sbin/sendmail:  Create an NSTask that launches /usr/sbin/ 
sendmail, configures the headers, and then just pipes your email  
through the task's standardInput.


I had to do this earlier today and it works pretty well.  You  
obviously can't do anything too complex with it, but in my case, I was  
just sending a plaintext report email and it worked great.  I found  
the basic pattern here: http://www.cocoadev.com/index.pl?SendingEmailMessages


Cheers,

Dave

On Jun 23, 2009, at 9:38 PM, Nick Zitzmann wrote:



On Jun 23, 2009, at 11:25 AM, Isaac Alston wrote:


How do I deal with email in Cocoa?



You either:
1. Use a third party framework or library
2. Use the Scripting Bridge to communicate with an existing mail  
client

3. Do the work yourself

There are no built-in network protocols other than FTP and HTTP(s),  
and they're only there because they provide significant utility to  
most programs.


Nick Zitzmann

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa and email (SMTP/POP3)

2009-06-23 Thread Nick Zitzmann


On Jun 23, 2009, at 11:25 AM, Isaac Alston wrote:


How do I deal with email in Cocoa?



You either:
1. Use a third party framework or library
2. Use the Scripting Bridge to communicate with an existing mail client
3. Do the work yourself

There are no built-in network protocols other than FTP and HTTP(s),  
and they're only there because they provide significant utility to  
most programs.


Nick Zitzmann




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Opinion on managed memory and garbage collection

2009-06-23 Thread Rob Keniger


On 24/06/2009, at 7:39 AM, Sean McBride wrote:


If you were writing a new Cocoa application from scratch, would
garbage collection be the preferred method over the reference  
counting

(retain/release) method.


I switched to GC-only during the 10.5 betas, and my answer is: Yes.



Same here, and in general the experience has been positive. No longer  
having to worry about retain cycles is bliss.


The biggest issues I've had to deal with are:

- many third-party frameworks and pieces of sample code do not have GC  
support yet and so you have to check their code quite carefully before  
trusting it, especially the -dealloc method


- Interface Builder does not use GC (at least in 10.5, don't know  
about 10.6), so you cannot create an Interface Builder plug-in for a  
class that requires GC. This is a big problem if you have not written  
all your code as dual-mode.


- you have to be very careful to make sure all the objects you want to  
keep around are rooted somewhere, otherwise they will "go away" at  
unpredictable times.


As others have said, the tools are not quite up to scratch for dealing  
with GC but there are some nice gdb features like "info gc-roots  
0xpointer" and ""info gc-references 0xpointer" which are very helpful.


--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSScrollView: special handling of subview's headerView?

2009-06-23 Thread Aaron Burghardt

Hi All,

I recently encountered a problem with a custom NSView sublcass that is  
designed to be a container for 3 WebViews and is embedded in a scroll  
view.  The problem was that once the view was added to the view  
hierarchy, one of its WebViews was removed and inserted as a sibling  
to the view.  I posted a question on the WebKit SDK mailing list  
because I thought my problem was related to WebView, but I determined  
that it occurred because my NSView subclass had an instance variable  
named headerView and that view was automatically set up as if a  
header, similar to an NSTableView or NSOutlineView column headerView.  
Renaming the ivar eliminated the problem.  My question is, is this  
documented behavior?  I intend to file a documentation bug, but I  
wanted to make sure I didn't miss something.


Thanks,

Aaron


Begin forwarded message:



On Jun 22, 2009, at 8:42 PM, Jeff Johnson wrote:


Hi Aaron.

Could you create a full sample app?

On Jun 22, 2009, at 1:35 PM, Aaron Burghardt wrote:

This is a slightly simplified version, but it shows the general  
approach.  The goal was to have HTML content that matched the  
width of MyView, so the WebViews  are instructed to -layout  
whenever the width changes.  After they are laid out, the height  
of MyView is adjusted to match the natural height of the stacked  
WebViews.  In Interface Builder, an instance of MyView is embedded  
in an NSScrollView.


Thanks,

Aaron

@interface MyView : NSView
{
WebView *webView1;
WebView *webView2;
WebView *webView3;
}
@end



In the process of creating a test app, I figured it out.   
Apparently, NSScrollView has special handling for a subview that has  
an instance variable called headerView.  In my original project, the  
WebView ivars had other names, one of which was headerView.  When  
the instance of MyView is added as a subview to the NSScrollView,  
the headerView is removed from MyView's subviews and inserted in the  
scroll view parent.  NSTableView and NSOutlineView also have a  
headerView, but they are probably designed to expect this behavior.   
When I renamed the variable, the problem went away.


Cheers,

Aaron





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

problem with "selection" controller key when showing NSComboBoxCell content values

2009-06-23 Thread Eli Manjarrez
I have a Core Data Document-Based Application, and I'm running into a
problem with bindings and the NSComboBoxCell.

Background: I have a table, the columns of which are bound (via an
array controller) to respective properties of one entity
("mainEntity") in my data model.  mainEntity has a to-many
relationship to subEntity in my data model.  Via a second controller
(bound to the "selection.relationshipName" controller key of the first
controller), I have managed to bind the content values of my combo box
cell to a property of subEntity.  This all works quite well, except
for the following...

Problem: When running the program, and clicking on the ellipsis of the
combo box for a row that isn't already selected, the content values
that appear are those for the previously-selected row, even though the
act of clicking the ellipsis causes its row to become selected.  Thus,
if I select row A, then click on the ellipsis of the combo box of row
B (which has the effect of also selecting row B), the content values
that appear are those associated with row A.  If I click two more
times on the ellipsis for row B's combo box (hiding and showing again
the content values), the correct values (i.e. the ones associated with
row B) appear.

So it seems like the selected table row is updating after the combo
box cell has gotten and displayed its content values.  Does anyone
know a way to get the combo box to show values related to the row that
it is in?  The first thing that comes to mind is to continue what I'm
doing, but find a way to get the table row selection to change before
the combo box cell gets/shows its values, in hopes that this will
allow the controllers to pull the right data first, however none of
the approaches I've tried (delegate methods, using actions, etc.) have
worked so far.  Perhaps there is even a better way to configure the
bindings that would get around this issue entirely.

Thanks in advance for your help.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Cocoa and email (SMTP/POP3)

2009-06-23 Thread Isaac Alston
Hi,

I've started learning Cocoa. I want to write a simple email client to
do some 'real world' coding and to learn more about the framework. I
thought there would be a simple way to send email in Cocoa, but a
quick search on Google only turned up
http://vafer.org/blog/20080604120118, which dates from 2008. I had a
look at each of the projects mentioned there though, but none of them
have been updated in months.

How do I deal with email in Cocoa?

I could use an existing C library, but I thought there would be
something that had been integrated already with the rest of Cocoa.
Your advice is appreciated.

Regards,

-- 
Isaac
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


display Mac id

2009-06-23 Thread Kiran Kumar

Hi all,

i am doing project to change MAC Address ,i want to display MACID in
a single textbox like 00:15:e9:4c:c3:d7

or 00-15-e9-4c-c3-d7 can any one help me plz ...




Thanks,
kiran

The information contained in this email and any attachments is confidential and 
may be subject to copyright or other intellectual property protection. If you 
are not the intended recipient, you are not authorized to use or disclose this 
information, and we request that you notify us by reply mail or telephone and 
delete the original message from your mail system.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?

2009-06-23 Thread Steve Fogel

Hi, all...

In my iPhone app I'd like to have a text field that duplicates the  
behavior of the phone field in the Contacts application, applying a  
mask to the field as it's being entered.


So if the user types 2125551212, I'd like the text field to display  
(212) 555-1212.


I know about the method  
textField:shouldChangeCharactersInRange:replacementString:, which  
would enable me to brute force this with lots of code. However, I'd  
like to be able to take locale into consideration, so this becomes non- 
trivial.


Anyone know of any locale-aware foundation classes that help with this?

Thx

Steve
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Beginner Question Re: Memory Management

2009-06-23 Thread Peter N Lewis

On 23/06/2009, at 12:31 , WT wrote:
So, after I scratched my head silly for several minutes, it suddenly  
came to me. If I'm going to use a property, I *must* refer to it as  
object.property rather than simply as property. In the specific  
example I had, I should not have replaced all those repeated chunks  
of code with


textFieldPreviousContent = textField.text;

but with

self.textFieldPreviousContent = textField.text;


This is why I never use the same property name as ivar name.

Many people use the _ prefix for ivars, but whatever prefix or suffix  
you choose, give the ivar a different name, and then you know when  
you're accessing the ivar and when you're using the setter/getter.


@synthesize textFieldPreviousContent = _textFieldPreviousContent;

Enjoy,
   Peter.
--
 Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro  Macros for your Mac
   



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


re: Cascade Delete won't delete Department in Apple Sample Code

2009-06-23 Thread Ben Trumbull

Core Data documentation [1] describes the Cascade Delete Rule as
follows:

"Delete the objects at the destination of the relationship.  For
example, if you delete a department, fire all the employees in that
department at the same time."

In order to understand another problem, I tried this on this the
inverse relationship in Apple's DepartmentAndEmployees Sample Code
project.  That is, in the data model, I selected the Employee -->
Department to-one relationship by selecting the 'department'
relationship in the 'Employee' entity, changed its Delete Rule to
Cascade, added some code to log and -processPendingChanges to the
MyDocument class [2], built, and run.

Running, in a new document, I added an Employee, then deleted it.  I
expected that the Department would be deleted also, but it was not.
Now I understand that deleting the Department might wreak havoc in
this particular project, or generate a 'deny' error, but according to
the console log [3] it didn't even try.  Can anyone suggest why not?


Your array controller "helpfully" nulled out the relationship first,  
so the relationship no longer exists at all by the time you cascade  
the deletion.


You'll see it cascade as you expect if you don't bind it into the UI  
in this manner.  As a workaround, you could create a custom remove  
action that deletes the object and calls processPendingChanges directly.


- Ben

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UML Diagramming or Other Helpful Software?

2009-06-23 Thread WT
I'm with Dave on this one. In fact, I am writing the design document  
for an iPhone game and I'm using Omnigraffle for every diagram, and  
even some of the art work. Just make sure to get extra stencils.


http://www.graffletopia.com/

Wagner

On Jun 24, 2009, at 3:50 AM, Dave DeLong wrote:

You're already mentioned it, but I'm a big fan of Omnigraffle and  
use it quite frequently.


Dave

On Jun 23, 2009, at 7:49 PM, Brad Gibbs wrote:


Hi,

I'm wondering if there are some tools commonly in use in the Mac  
software development community for diagramming an app, creating use  
cases and / or requirements, etc.  I've seen OmniGraffle and  
ConceptDraw.  I'm just wondering how other people go about laying  
out their apps from 30,000 feet, and whether there are tools for  
this I haven't bumped into, yet.


Thanks.

Brad

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UML Diagramming or Other Helpful Software?

2009-06-23 Thread Dave DeLong
You're already mentioned it, but I'm a big fan of Omnigraffle and use  
it quite frequently.


Dave

On Jun 23, 2009, at 7:49 PM, Brad Gibbs wrote:


Hi,

I'm wondering if there are some tools commonly in use in the Mac  
software development community for diagramming an app, creating use  
cases and / or requirements, etc.  I've seen OmniGraffle and  
ConceptDraw.  I'm just wondering how other people go about laying  
out their apps from 30,000 feet, and whether there are tools for  
this I haven't bumped into, yet.


Thanks.

Brad

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


UML Diagramming or Other Helpful Software?

2009-06-23 Thread Brad Gibbs

Hi,

I'm wondering if there are some tools commonly in use in the Mac  
software development community for diagramming an app, creating use  
cases and / or requirements, etc.  I've seen OmniGraffle and  
ConceptDraw.  I'm just wondering how other people go about laying out  
their apps from 30,000 feet, and whether there are tools for this I  
haven't bumped into, yet.


Thanks.

Brad
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Adam R. Maxwell


On Jun 23, 2009, at 6:20 PM, WT wrote:



On 24/06/2009, at 4:02 AM, Anders Lassen wrote:

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct.



You know, I have no clue if this is going to help or not, because I  
have no experience whatsoever with typesetting systems (other than  
using them), but have you considered looking at the source code for  
TeX/LaTeX front-ends? I would suspect that they have to deal with  
the very issue you're dealing with. One of the best TeX front-ends  
for the Mac is TeXShop and it's open-source, so you should be able  
to peruse its source.


All TeXShop or another front end will do is run a TeX process (e.g.,  
pdftex, xetex) on your TeX source, then display the result in a  
PDFView.  You'd have to look at the TeX source to see what it does: http://xetex.sourceforge.net 
 is one example.





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Graham Cox


On 24/06/2009, at 11:20 AM, WT wrote:



On 24/06/2009, at 4:02 AM, Anders Lassen wrote:

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct.



You know, I have no clue if this is going to help or not, because I  
have no experience whatsoever with typesetting systems (other than  
using them), but have you considered looking at the source code for  
TeX/LaTeX front-ends? I would suspect that they have to deal with  
the very issue you're dealing with. One of the best TeX front-ends  
for the Mac is TeXShop and it's open-source, so you should be able  
to peruse its source. You might also want to contact some of its  
developers and code contributors.


source:
http://www.uoregon.edu/~koch/texshop/texshopsource.zip

contributors:
http://www.uoregon.edu/~koch/texshop/extras.html



Going further, since TeX can layout formulae, you could incorporate  
the code or call it to handle the task, then just display the result.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[Announce] Expense: A Core Data Tutorial part 3 posted.

2009-06-23 Thread Michael Swan
I just posted the third part of my Core Data tutorial dealing with  
user preferences. The series also deals with bindings a good deal.

http://themikeswan.wordpress.com/2009/06/23/expenses-a-core-data-tutorial-part-3/

Mike Swan
ETCP Certified Entertainment Electrician
http://www.michaelsswan.com

<>



"The Ego is the little self that pretends to be the only self and  
speaks so loudly that the still, small voice of the Greater Self,  
whose whisperings come from within the Soul, are rarely heard - unless  
we learn to listen."




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread WT


On 24/06/2009, at 4:02 AM, Anders Lassen wrote:

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct.



You know, I have no clue if this is going to help or not, because I  
have no experience whatsoever with typesetting systems (other than  
using them), but have you considered looking at the source code for  
TeX/LaTeX front-ends? I would suspect that they have to deal with the  
very issue you're dealing with. One of the best TeX front-ends for the  
Mac is TeXShop and it's open-source, so you should be able to peruse  
its source. You might also want to contact some of its developers and  
code contributors.


source:
http://www.uoregon.edu/~koch/texshop/texshopsource.zip

contributors:
http://www.uoregon.edu/~koch/texshop/extras.html

Wagner
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Graham Cox


On 24/06/2009, at 4:02 AM, Anders Lassen wrote:

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct.



In general, I don't think it's meaningful to ask for the metrics  
ascender, descender, and so on for an individual glyph. Those metrics  
apply to a font as a whole. A glyph is just a path that sits inside a  
bounding box, and certain positions on that path (such as the height  
of the top of the curved part for the letter 'd' for example) are not  
recorded. What is noted is the positions of some layout guidelines  
such as the xHeight, baseline and overall ascender and descender.


However, most rational fonts do stick to the guidelines, so these  
metrics are useful for positioning glyphs. If you do need finer  
metrics for the mathematical formula layout task, you may need to  
choose a couple of fonts and build some supplementary tables yourself  
for handling the positioning.


This page (and the guide it is part of) are must-reads: 
http://developer.apple.com/documentation/Cocoa/Conceptual/FontHandling/Tasks/GettingFontMetrics.html

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cascade Delete won't delete Department in Apple Sample Code

2009-06-23 Thread Andy Lee
On Tuesday, June 23, 2009, at 07:23PM, "Jerry Krinock"  wrote:
>Although eyebrows are raised at the on-the-fly invention of the term  
>"back pointers" (not defined in wikipedia.org), I suppose that "back  
>pointers ... are nullified" could be loosely interpreted to mean that,  

"Back pointer" is not a new invention.  It means just what you think it means:



In the real world, wikipedia.org is not the exhaustive gospel on any subject, 
including computer science. :)

--Andy

>in this case of the inverse relationship being to-many, in the object  
>at the other end of the relationship, in the set value of the inverse  
>relationship, the pointer to the deleted object is removed.  That does  
>seem to be what happens.  The author traded off some precision for  
>readability -- probably a good decision.  I'll let that one slide.
>
>___
>
>Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
>Please do not post admin requests or moderator comments to the list.
>Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>Help/Unsubscribe/Update your Subscription:
>http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com
>
>This email sent to ag...@mac.com
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cascade Delete won't delete Department in Apple Sample Code

2009-06-23 Thread Quincey Morris

On Jun 23, 2009, at 16:23, Jerry Krinock wrote:


The documentation of the NSDeleteRule simply states:

"NSCascadeDeleteRule. If the object is deleted, the destination  
object or objects of this relationship are also deleted."


That's all, chief.  There is an "if", but there are no "ands" or  
"buts".  This statement even goes out of its way to define what  
happens in case there is only a singular "object".  It's deleted.   
Gone.  Period.  No questions.  No prisoners.


Well, I didn't mean the documentation was correct as is. I meant to  
suggest the actual behavior is correct (in the sense of being as  
intended), and it's the documentation that needs to be fixed. :)


So, this one gets a Bug Report.  7000470.  (Did the person who filed  
700 get a free iPod?)


I think that person got a free bug.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cascade Delete won't delete Department in Apple Sample Code

2009-06-23 Thread Jerry Krinock


On 2009 Jun 23, at 00:48, Quincey Morris wrote:

The delete rules are really about ownership. Department->Employee  
ownership is clear: *the* department owns each of its employees. But  
Employee->Department ownership isn't well defined. (If two employees  
"own" the same department, who gets to decide when to delete the  
department?) Therefore, apparently, the problematic cases (Nullify  
and Cascade) are just ignored -- beyond the necessary step of  
removing the Employee from the Department's set of related Employees.


So for Cascade it's not so much that Core Data failed to deliver on  
a promise to delete the Department, but rather that it never really  
promised.


That's beautiful, Quincey.  Everything you say is certainly true in  
real life.  But now step in from the garden and back into computer  
science.  Cocoa is not real life.  Cocoa is an abstract system that is  
supposed to behave according to its documentation.  The documentation  
of the NSDeleteRule simply states:


"NSCascadeDeleteRule. If the object is deleted, the destination object  
or objects of this relationship are also deleted."


That's all, chief.  There is an "if", but there are no "ands" or  
"buts".  This statement even goes out of its way to define what  
happens in case there is only a singular "object".  It's deleted.   
Gone.  Period.  No questions.  No prisoners.


So, this one gets a Bug Report.  7000470.  (Did the person who filed  
700 get a free iPod?)


The Nullify case is wrong, too -- nothing in the Department actually  
gets set to nil -- but the removal of the pointer from the  
relationship set is near enough to fulfillment of a Nullify promise  
that it doesn't seem like it didn't work.


Well, what I see happening is that, for the to-many relationship, the  
pointer to the employee is removed from the set.  Let's look at the  
documentation on that one:


"NSNullifyDeleteRule.  If the object is deleted, back pointers from  
the objects to which it is related are nullified."


Although eyebrows are raised at the on-the-fly invention of the term  
"back pointers" (not defined in wikipedia.org), I suppose that "back  
pointers ... are nullified" could be loosely interpreted to mean that,  
in this case of the inverse relationship being to-many, in the object  
at the other end of the relationship, in the set value of the inverse  
relationship, the pointer to the deleted object is removed.  That does  
seem to be what happens.  The author traded off some precision for  
readability -- probably a good decision.  I'll let that one slide.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data "Uniqueing" not happening as expected

2009-06-23 Thread Jerry Krinock
I tried to reproduce this in a demo project but gave up on it.  In the  
demo project, attempting to set a cross-store relationship always  
results in a nice warning and program termination.  It would just take  
too long to pick my project apart.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-23 Thread Sean McBride
On 6/22/09 9:41 PM, Dave Carrigan said:

>> -Wconversion warns you every time
>> a function call has the parameter passing altered by the presence of
>> the function's prototype, which is to say that it will warn you every
>> time you call any function (or method) which takes a char, unsigned
>> char, short, unsigned short, or float. Not exactly useful.
>
>At least until Xcode gets gcc 4.3,

Which, IMNSHO, will never happen.

>where -Wconversion has been renamed
>-Wtraditional-conversion, and -Wconversion gives useful warnings about
>variables that might have their value changed during the conversion.

You can get similar warnings today with:


--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Opinion on managed memory and garbage collection

2009-06-23 Thread Sean McBride
On 6/22/09 7:58 AM, Phil Hystad said:

>If you were writing a new Cocoa application from scratch, would
>garbage collection be the preferred method over the reference counting
>(retain/release) method.

I switched to GC-only during the 10.5 betas, and my answer is: Yes.

Others have made good comments, I'll simply add that the tools support
on 10.5 is weaker than with retain-release.  There are all kinds of
limitations (individually minor, but in summation major):
 - Instruments reports zillions of false positives when checking for leaks
 - there's no guard malloc for GC memory
 - OpenGL Profiler doesn't work with GC apps
 - CHUD.framework is not dual mode, so can't be linked against
 - MallocDebug.app crashes with GC apps
 - etc. etc. etc.

Otherwise, GC has been a great experience for me.

No doubt things will improve in 10.6

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Core Data Fetching Limitations?

2009-06-23 Thread Ulai Beekam

Sure. It is not mentioned in the "Core Data Programming Guide". However it is 
mentioned in "Predicate Programming Guide".


Take a look at the section called "Constraints and Limitations" (second item in 
the list) on this page:


http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Articles/pBasics.html#//apple_ref/doc/uid/TP40001792


To tell you the truth, I think your question is very good. Because in the 
meantime, I actually tried combining two "IN"s together (to be more precise, I 
combined both of them in an NSCompoundPredicate) and it seemed to work fine, 
even with SQLite!

I therefore ask: Was there any particular reason for why you asked me? I am 
starting to suspect that there was a good reason for it :) Please feel free to 
share with me everything you know about this topic.


> Date: Tue, 23 Jun 2009 12:17:24 -0700
> Subject: Re: Core Data Fetching Limitations?
> From: barryw...@gmail.com
> To: ulaibee...@hotmail.com
>
> Ulai,
>
> Can you point me to the documentation that gives the "only one IN" per
> query limitation of SQLite?
>
> Thanks,
> Barry
>
> 2009/6/21 Ulai Beekam :
>>
>> (Sorry, the previous post was not sent with plaintext)
>>
>> Please draw up the following model on a piece of paper:
>>
>> We have three entities: Department, Employee, and EmployeeCar. Each of them 
>> has the 'name' attribute.
>>
>> Department has the to-many 'employees' relationship to Employee. Its inverse 
>> is, naturally, the to-one 'department' relationship in Employee.
>>
>> Employee has a to-one 'employeeCar' relationship to EmployeeCar. Its inverse 
>> is the to-many 'employees' relationship  in EmployeeCar. This reflects the 
>> reality that a single car can be assigned to more than one employee, but a 
>> given employee does only have one car assigned to him.
>>
>>
>> NOW HERE IS THE QUESTION: How can I make Core Data:  fetch all 
>> departments that have an employee whose name starts with 'Jo' and whose 
>> assigned car has the name of 'Volvo' 
>>
>>
>>
>> Can Core Data even make such fetches? Can it be done without ALL,ANY? I ask 
>> because I might want to combine many such conditions, making it impossible 
>> to do with the SQLite storage option. Maybe I can just simply forget the 
>> SQLite storage for this? What are the alternatives? Am I doomed to work with 
>> the other slower storages?
>>
>> And note that I do indeed have to have it inside a single predicate because 
>> I have an NSArrayController of Department objects, and after having made the 
>> correct predicate (for which I need your help) I plan to set the array 
>> controller's fetch predicate to that predicate.
>>
>> Thanks, U.
>> _
>> Invite your mail contacts to join your friends list with Windows Live 
>> Spaces. It's easy!
>> http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/barrywark%40gmail.com
>>
>> This email sent to barryw...@gmail.com
>>

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: bluetooth on the iPhone

2009-06-23 Thread Greg Guerin

David Brennan wrote:

I am looking to create a iPhone app that will display a reading  
from a bluetooth device. I don't know where to start with this or  
if it can even be done. Any help or advice would be great.


Visit this URL:
  http://developer.apple.com/search/search.html

Enter plausible search terms:
  iphone bluetooth
  iphone bluetooth peer

Since your question isn't Cocoa-related, consider the iPhone dev  
forums instead of this list.


  http://devforums.apple.com/

Finally, google is your friend.  Search terms:
  iphone bluetooth dev forum

  -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread JongAm Park

Hello, Aki

Oh.. I see. "when it can do efficiently" is the key!

Thank you very much for pointing that out.

Aki Inoue wrote:

JongAm,

The keyword here is that the function returns non-NULL when it can do 
so "efficiently".
It all depends on a particular CFString instance's internal 
representation and the encoding being passed.


The best encoding for a particular string is 
CFStringGetFastestEncoding().


Aki

On Jun 23, 2009, at 12:13 PM, JongAm Park wrote:


Oh.. one more thing...

I think you didn't catch what I wanted to say.
It will be OK to return NULL if it can't convert a given string to a 
string in a given text encoding method.
( But, yes.. Apple's document mentioned that its behaviour can be 
changed, so don't rely on it. )


What I wanted to say was "Why does it return a meaningful address 
when the system encoding is Japanese while it doesn't when the system 
encoding is English?".

(When UTF8 is used for a target. )
Can't MacRoman be converted to UTF8 while MacJapanese can be?
I assumed that MacRoman code page is almost identical to UTF8, 
because UTF8 is compatible with ASCII and MacRoman is extended form 
for ASCII.


Anyway.. I will go around the problem...

Thank you anyway.

Laurent Cerveau wrote:
According to the doc it is completely OK for the CFStringPtr to 
return NULL.

 CFStringGetCStringPtr()
 CFStringGetCharactersPtr()

These functions are provided for optimization only. They will either 
return the desired
pointer quickly, in constant time, or they return NULL. They might 
choose to return NULL
for many reasons; for instance it's possible that for users running 
in different
languages these sometimes return NULL; or in a future OS release the 
first two might
switch to always returning NULL. Never observing NULL returns in 
your usages of these
functions does not mean they won't ever return NULL. (But note the 
CFStringGetCharactersPtr()

exception mentioned further below.)

What you do with falling back to CFStringGetCString is right

laurent

On Jun 23, 2009, at 7:26 PM, JongAm Park wrote:


Hello.

I didn't find any CoreFoundation mailing list, so I post my 
question about CFStringEtCStringPtr() here in Cocoa mailing list.


My problem is that CFStringGetCStringPtr( ..., 
kCFStringEncodingUTF8) doesn't convert a string passed through its 
first parameter and returns 0 on English system.
However, on Japanese system, it returns a pointer to converted 
string correctly.


The first parameter points to a string which is a path in English. 
There is no Japanese characters.
Because the 2nd parameter is one of 8 bit encoding, it didn't work 
before on Japanese system, where it was called like :


CFStringGetCStringPtr( ...,  CFStringGetSystemEncoding() )

The encoding method on a Japanese system is

kCFStringEncodingMacJapanese 
 



So, I forced the 2nd parameter to kCFStringEncodingUTF8 and thought 
that it would work on English system also.

However, on an English system, of which system encoding is

kCFStringEncodingMacRoman 
 




It doesn't convert its 1st parameter and returned 0.
So, I had to call another CFStringGetCStringPtr() with 
CFStringGetSystemEncoding() as its 2nd parameter.


Is it a bug? Usually English encoding is the most trouble-free 
encoding method which can be converted to UTF8. So, I expected that 
it would work with kCFStringEncodingUTF8.

Or.. can anyone tell me why it doesn't work?

My whole source code which contains this fix is like

 char *fullPath;
 char outPath[512];;
   Boolean conversionResult;
 CFStringEncoding encodingMethod;
 // This is for ensuring safer operation. When 
CFStringGetCStringPtr() fails,

 // it tries CFStringGetCString().
   encodingMethod = CFStringGetSystemEncoding();
   // 1st try for English system
 fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
 if( fullPath == NULL )
 {
 // 2nd try for Japanese system
 encodingMethod = kCFStringEncodingUTF8;
 fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
 }
   // for safer operation.
 if( fullPath == NULL )
 {
 CFIndex length = CFStringGetLength(mstr);
 fullPath = (char *)malloc( length + 1 );
 conversionResult = CFStringGetCString(mstr, fullPath, length, 
kCFStringEncodingUTF8 );

   strcpy( outPath, fullPath );
   free( fullPath );
 }
 else
 strcpy( outPath, fullPath );

Thank you.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
)


Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists

Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Anders Lassen

Yes, thanks, I am sure this will help.


On Jun 23, 2009, at 8:02 PM, Quincey Morris wrote:


On Jun 23, 2009, at 10:32, Anders Lassen wrote:


I am working on a project that involves writing math formulas.:

2 * x^2 + sqrt(3)
-  + aB
  3

note that the above is only to explain, what I mean by math formulas.

In my project, I have a object type that handles letters. Because  
letters must be aligned to special math symbols I need to know the  
ascent and descent of the character.


But maybe, I have now found a way to do this, although it is not  
tested yet.


I hope that the function:

ATSUGetUnjustifiedBounds

will help me.


It sounds like you want the glyph bounding boxes -- "glyph ascent"  
is not really a standard term like "font ascent", so it could mean  
one of several possible metrics. I tried searching  
developer.apple.com for "glyph metrics" and the second hit was this  
tech note:


http://developer.apple.com/technotes/tn/tn2033.html

which explains how to get glyph metrics (include glyph bounding  
boxes) using ATSUI. The 19th hit was:


	http://developer.apple.com/documentation/Carbon/Reference/CTFontRef/Reference/reference.html#/ 
/apple_ref/c/func/CTFontGetBoundingRectsForGlyphs


which explains how to get the same information using Core Text.

Is that the information you need?


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/anders.lassen%40mac.com

This email sent to anders.las...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Anders Lassen

Hi,

I have learned a bit more since I started this investigation. So now I  
know that I can use Core Text or ATSUI to get glyph metrics.


(see former email responses about this)


Anders Lassen

On Jun 23, 2009, at 8:39 PM, Scott Thompson wrote:



On Jun 23, 2009, at 1:02 PM, Anders Lassen wrote:

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct



Unfortunately the documentation on the text system in Mac OS X can  
be very difficult to navigate (as you have no doubt learned).  There  
is documentation on QuickDraw, ATSUI, Core Text, the Cocoa System  
etc... etc... some of it's legacy, some of it's deprecated, and it's  
really hard to know what you should use.


I would recommend looking at the Cocoa Text system (if you are a  
Cocoa app) then drop down to the Core Text level if that is not  
sufficient.  I would use ATSUI as a last resort.


Speaking in very broad terms, the text systems on the OS are much  
happier if you start out at the character level and let them manage  
the conversion from characters to glyphs.  You can then get at the  
glyph information, but the information you can learn about any  
particular glyph is usually given in the context of an entire line  
of text that has been arranged for you.  To learn about an  
individual glyph you would have to either arrange for it to be put  
into it's own style run, or you would have to dig around in the font  
tables yourself (a practice I would recommend avoiding if at all  
possible).


You started out asking about glyphs and now are talking about  
characters. What information are you starting with in your  
application?  Do you have a set of characters that represents some  
sub-expression of your formula, or are you starting out with a set  
of glyph ids?


Scott








___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread Aki Inoue

JongAm,

The keyword here is that the function returns non-NULL when it can do  
so "efficiently".
It all depends on a particular CFString instance's internal  
representation and the encoding being passed.


The best encoding for a particular string is CFStringGetFastestEncoding 
().


Aki

On Jun 23, 2009, at 12:13 PM, JongAm Park wrote:


Oh.. one more thing...

I think you didn't catch what I wanted to say.
It will be OK to return NULL if it can't convert a given string to a  
string in a given text encoding method.
( But, yes.. Apple's document mentioned that its behaviour can be  
changed, so don't rely on it. )


What I wanted to say was "Why does it return a meaningful address  
when the system encoding is Japanese while it doesn't when the  
system encoding is English?".

(When UTF8 is used for a target. )
Can't MacRoman be converted to UTF8 while MacJapanese can be?
I assumed that MacRoman code page is almost identical to UTF8,  
because UTF8 is compatible with ASCII and MacRoman is extended form  
for ASCII.


Anyway.. I will go around the problem...

Thank you anyway.

Laurent Cerveau wrote:
According to the doc it is completely OK for the CFStringPtr to  
return NULL.

 CFStringGetCStringPtr()
 CFStringGetCharactersPtr()

These functions are provided for optimization only. They will  
either return the desired
pointer quickly, in constant time, or they return NULL. They might  
choose to return NULL
for many reasons; for instance it's possible that for users running  
in different
languages these sometimes return NULL; or in a future OS release  
the first two might
switch to always returning NULL. Never observing NULL returns in  
your usages of these
functions does not mean they won't ever return NULL. (But note the  
CFStringGetCharactersPtr()

exception mentioned further below.)

What you do with falling back to CFStringGetCString is right

laurent

On Jun 23, 2009, at 7:26 PM, JongAm Park wrote:


Hello.

I didn't find any CoreFoundation mailing list, so I post my  
question about CFStringEtCStringPtr() here in Cocoa mailing list.


My problem is that CFStringGetCStringPtr( ...,  
kCFStringEncodingUTF8) doesn't convert a string passed through its  
first parameter and returns 0 on English system.
However, on Japanese system, it returns a pointer to converted  
string correctly.


The first parameter points to a string which is a path in English.  
There is no Japanese characters.
Because the 2nd parameter is one of 8 bit encoding, it didn't work  
before on Japanese system, where it was called like :


CFStringGetCStringPtr( ...,  CFStringGetSystemEncoding() )

The encoding method on a Japanese system is

kCFStringEncodingMacJapanese 


So, I forced the 2nd parameter to kCFStringEncodingUTF8 and  
thought that it would work on English system also.

However, on an English system, of which system encoding is

kCFStringEncodingMacRoman 



It doesn't convert its 1st parameter and returned 0.
So, I had to call another CFStringGetCStringPtr() with  
CFStringGetSystemEncoding() as its 2nd parameter.


Is it a bug? Usually English encoding is the most trouble-free  
encoding method which can be converted to UTF8. So, I expected  
that it would work with kCFStringEncodingUTF8.

Or.. can anyone tell me why it doesn't work?

My whole source code which contains this fix is like

 char *fullPath;
 char outPath[512];;
   Boolean conversionResult;
 CFStringEncoding encodingMethod;
 // This is for ensuring safer operation. When  
CFStringGetCStringPtr() fails,

 // it tries CFStringGetCString().
   encodingMethod = CFStringGetSystemEncoding();
   // 1st try for English system
 fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
 if( fullPath == NULL )
 {
 // 2nd try for Japanese system
 encodingMethod = kCFStringEncodingUTF8;
 fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
 }
   // for safer operation.
 if( fullPath == NULL )
 {
 CFIndex length = CFStringGetLength(mstr);
 fullPath = (char *)malloc( length + 1 );
 conversionResult = CFStringGetCString(mstr, fullPath, length,  
kCFStringEncodingUTF8 );

   strcpy( outPath, fullPath );
   free( fullPath );
 }
 else
 strcpy( outPath, fullPath );

Thank you.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com )


Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com

This email sent to lcerv...@me.com




__

bluetooth on the iPhone

2009-06-23 Thread David Brennan

Hi,

I am looking to create a iPhone app that will display a reading from a  
bluetooth device. I don't know where to start with this or if it can  
even be done. Any help or advice would be great.


Kind regards,
Dave.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread JongAm Park

Oh.. one more thing...

I think you didn't catch what I wanted to say.
It will be OK to return NULL if it can't convert a given string to a 
string in a given text encoding method.
( But, yes.. Apple's document mentioned that its behaviour can be 
changed, so don't rely on it. )


What I wanted to say was "Why does it return a meaningful address when 
the system encoding is Japanese while it doesn't when the system 
encoding is English?".

(When UTF8 is used for a target. )
Can't MacRoman be converted to UTF8 while MacJapanese can be?
I assumed that MacRoman code page is almost identical to UTF8, because 
UTF8 is compatible with ASCII and MacRoman is extended form for ASCII.


Anyway.. I will go around the problem...

Thank you anyway.

Laurent Cerveau wrote:
According to the doc it is completely OK for the CFStringPtr to 
return NULL. 


  CFStringGetCStringPtr()
  CFStringGetCharactersPtr()

These functions are provided for optimization only. They will either 
return the desired
pointer quickly, in constant time, or they return NULL. They might 
choose to return NULL
for many reasons; for instance it's possible that for users running in 
different
languages these sometimes return NULL; or in a future OS release the 
first two might
switch to always returning NULL. Never observing NULL returns in your 
usages of these
functions does not mean they won't ever return NULL. (But note the 
CFStringGetCharactersPtr()

exception mentioned further below.)

What you do with falling back to CFStringGetCString is right

laurent

On Jun 23, 2009, at 7:26 PM, JongAm Park wrote:


Hello.

I didn't find any CoreFoundation mailing list, so I post my question 
about CFStringEtCStringPtr() here in Cocoa mailing list.


My problem is that CFStringGetCStringPtr( ..., kCFStringEncodingUTF8) 
doesn't convert a string passed through its first parameter and 
returns 0 on English system.
However, on Japanese system, it returns a pointer to converted string 
correctly.


The first parameter points to a string which is a path in English. 
There is no Japanese characters.
Because the 2nd parameter is one of 8 bit encoding, it didn't work 
before on Japanese system, where it was called like :


CFStringGetCStringPtr( ...,  CFStringGetSystemEncoding() )

The encoding method on a Japanese system is

kCFStringEncodingMacJapanese 



So, I forced the 2nd parameter to kCFStringEncodingUTF8 and thought 
that it would work on English system also.

However, on an English system, of which system encoding is

kCFStringEncodingMacRoman 




It doesn't convert its 1st parameter and returned 0.
So, I had to call another CFStringGetCStringPtr() with 
CFStringGetSystemEncoding() as its 2nd parameter.


Is it a bug? Usually English encoding is the most trouble-free 
encoding method which can be converted to UTF8. So, I expected that 
it would work with kCFStringEncodingUTF8.

Or.. can anyone tell me why it doesn't work?

My whole source code which contains this fix is like

  char *fullPath;
  char outPath[512];;
Boolean conversionResult;
  CFStringEncoding encodingMethod;
  // This is for ensuring safer operation. When 
CFStringGetCStringPtr() fails,

  // it tries CFStringGetCString().
encodingMethod = CFStringGetSystemEncoding();
// 1st try for English system
  fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
  if( fullPath == NULL )
  {
  // 2nd try for Japanese system
  encodingMethod = kCFStringEncodingUTF8;
  fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
  }
// for safer operation.
  if( fullPath == NULL )
  {
  CFIndex length = CFStringGetLength(mstr);
  fullPath = (char *)malloc( length + 1 );
  conversionResult = CFStringGetCString(mstr, fullPath, length, 
kCFStringEncodingUTF8 );

strcpy( outPath, fullPath );
free( fullPath );
  }
  else
  strcpy( outPath, fullPath );

Thank you.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
)


Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com

This email sent to lcerv...@me.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.c

Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread JongAm Park

Thanks for your reply.

However, even with CFStringGetCString() with the 2nd parameter 
"kCFStringEncodingUTF8" doesn't work correctly.


Laurent Cerveau wrote:
According to the doc it is completely OK for the CFStringPtr to 
return NULL. 


  CFStringGetCStringPtr()
  CFStringGetCharactersPtr()

These functions are provided for optimization only. They will either 
return the desired
pointer quickly, in constant time, or they return NULL. They might 
choose to return NULL
for many reasons; for instance it's possible that for users running in 
different
languages these sometimes return NULL; or in a future OS release the 
first two might
switch to always returning NULL. Never observing NULL returns in your 
usages of these
functions does not mean they won't ever return NULL. (But note the 
CFStringGetCharactersPtr()

exception mentioned further below.)

What you do with falling back to CFStringGetCString is right

laurent

On Jun 23, 2009, at 7:26 PM, JongAm Park wrote:


Hello.

I didn't find any CoreFoundation mailing list, so I post my question 
about CFStringEtCStringPtr() here in Cocoa mailing list.


My problem is that CFStringGetCStringPtr( ..., kCFStringEncodingUTF8) 
doesn't convert a string passed through its first parameter and 
returns 0 on English system.
However, on Japanese system, it returns a pointer to converted string 
correctly.


The first parameter points to a string which is a path in English. 
There is no Japanese characters.
Because the 2nd parameter is one of 8 bit encoding, it didn't work 
before on Japanese system, where it was called like :


CFStringGetCStringPtr( ...,  CFStringGetSystemEncoding() )

The encoding method on a Japanese system is

kCFStringEncodingMacJapanese 



So, I forced the 2nd parameter to kCFStringEncodingUTF8 and thought 
that it would work on English system also.

However, on an English system, of which system encoding is

kCFStringEncodingMacRoman 




It doesn't convert its 1st parameter and returned 0.
So, I had to call another CFStringGetCStringPtr() with 
CFStringGetSystemEncoding() as its 2nd parameter.


Is it a bug? Usually English encoding is the most trouble-free 
encoding method which can be converted to UTF8. So, I expected that 
it would work with kCFStringEncodingUTF8.

Or.. can anyone tell me why it doesn't work?

My whole source code which contains this fix is like

  char *fullPath;
  char outPath[512];;
Boolean conversionResult;
  CFStringEncoding encodingMethod;
  // This is for ensuring safer operation. When 
CFStringGetCStringPtr() fails,

  // it tries CFStringGetCString().
encodingMethod = CFStringGetSystemEncoding();
// 1st try for English system
  fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
  if( fullPath == NULL )
  {
  // 2nd try for Japanese system
  encodingMethod = kCFStringEncodingUTF8;
  fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
  }
// for safer operation.
  if( fullPath == NULL )
  {
  CFIndex length = CFStringGetLength(mstr);
  fullPath = (char *)malloc( length + 1 );
  conversionResult = CFStringGetCString(mstr, fullPath, length, 
kCFStringEncodingUTF8 );

strcpy( outPath, fullPath );
free( fullPath );
  }
  else
  strcpy( outPath, fullPath );

Thank you.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
)


Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com

This email sent to lcerv...@me.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect);

2009-06-23 Thread Frederick C. Lee

This is for the iPhone/iTouch environment.

I discovered: CGContextTranslateCTM().

I'll also check out subclassing the scrollview.

Ric.

On Jun 14, 2009, at 7:53 PM, David Duncan wrote:


On Jun 12, 2009, at 11:53 AM, Frederick C. Lee wrote:

Is there a Cocoa/iPhone equivalent to Quartz's  
CGImageCreateWithImageInRect(image, imageRect)?



The equivalent is... CGImageCreateWithImageInRect :). Keep in mind  
that 9 times out of 10 what people want to use it for is not what  
that API is really designed for. If you just want to draw part of an  
image, use clipping & translation (either translate the CTM, or move  
your drawing rect).


If you want to pan across an image (and it isn't too big) you can  
just put the whole thing in a UIImageView contained in a  
UIScrollView. If the image is fairly large, then you may want to use  
a CATiledLayer (but you will have to draw it via Quartz instead of  
via UIImage's draw methods).

--
David Duncan
Apple DTS Animation and Printing



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Scott Thompson


On Jun 23, 2009, at 1:02 PM, Anders Lassen wrote:

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct



Unfortunately the documentation on the text system in Mac OS X can be  
very difficult to navigate (as you have no doubt learned).  There is  
documentation on QuickDraw, ATSUI, Core Text, the Cocoa System etc...  
etc... some of it's legacy, some of it's deprecated, and it's really  
hard to know what you should use.


I would recommend looking at the Cocoa Text system (if you are a Cocoa  
app) then drop down to the Core Text level if that is not sufficient.   
I would use ATSUI as a last resort.


Speaking in very broad terms, the text systems on the OS are much  
happier if you start out at the character level and let them manage  
the conversion from characters to glyphs.  You can then get at the  
glyph information, but the information you can learn about any  
particular glyph is usually given in the context of an entire line of  
text that has been arranged for you.  To learn about an individual  
glyph you would have to either arrange for it to be put into it's own  
style run, or you would have to dig around in the font tables yourself  
(a practice I would recommend avoiding if at all possible).


You started out asking about glyphs and now are talking about  
characters. What information are you starting with in your  
application?  Do you have a set of characters that represents some sub- 
expression of your formula, or are you starting out with a set of  
glyph ids?


Scott






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread Greg Guerin

JongAm Park wrote:

My problem is that CFStringGetCStringPtr( ...,  
kCFStringEncodingUTF8) doesn't convert a string passed through its  
first parameter and returns 0 on English system.
However, on Japanese system, it returns a pointer to converted  
string correctly.
It seems like you don't understand exactly what CFStringGetCStringPtr 
() does.


First, CFStringGetCStringPtr does not perform a conversion.

Refer to CFStringGetCStringPtr's docs, which state:

"This function either returns the requested pointer immediately, with  
no memory allocations and no copying, in constant time, or returns  
NULL."


The phrases "no memory allocations" and "no copying" should be  
clear.  The phrase "in constant time" implies that no actual  
conversion between encodings is performed, either.  Therefore, it's  
reasonable to conclude that  if the passed-in string-ref is not  
already in the requested encoding, CFStringGetCStringPtr() will  
return NULL.


Unless you have a specific need for the extra speed that  
CFStringGetCStringPtr() might offer, then you probably shouldn't use  
CFStringGetCStringPtr() at all.  Just use CFStringGetCString(),  
because it will perform conversions.  If you changed your posted code  
to only use CFStringGetCString(), it would eliminate about 2/3 of the  
code, maybe even more.  Then you could add code that does the buffer- 
length check to avoid overrunning the fixed-length outBuf, whose  
length is currently never checked nor used as a limit (i.e. you have  
a latent buffer overrun bug).



Also see the docs for CFStringGetCString, which say:

"You also typically call it as a “backup” when a prior call to the  
CFStringGetCStringPtr function fails."


So clearly, the behavior you described in your post is not a bug.  In  
fact, it is the expected behavior, and the docs describe what to do  
when it happens.




fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);


What is the type of 'mstr'?

How was 'mstr' produced?

  -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread Laurent Cerveau
According to the doc it is completely OK for the CFStringPtr to  
return NULL.


  CFStringGetCStringPtr()
  CFStringGetCharactersPtr()

These functions are provided for optimization only. They will either  
return the desired
pointer quickly, in constant time, or they return NULL. They might  
choose to return NULL
for many reasons; for instance it's possible that for users running in  
different
languages these sometimes return NULL; or in a future OS release the  
first two might
switch to always returning NULL. Never observing NULL returns in your  
usages of these
functions does not mean they won't ever return NULL. (But note the  
CFStringGetCharactersPtr()

exception mentioned further below.)

What you do with falling back to CFStringGetCString is right

laurent

On Jun 23, 2009, at 7:26 PM, JongAm Park wrote:


Hello.

I didn't find any CoreFoundation mailing list, so I post my question  
about CFStringEtCStringPtr() here in Cocoa mailing list.


My problem is that CFStringGetCStringPtr( ...,  
kCFStringEncodingUTF8) doesn't convert a string passed through its  
first parameter and returns 0 on English system.
However, on Japanese system, it returns a pointer to converted  
string correctly.


The first parameter points to a string which is a path in English.  
There is no Japanese characters.
Because the 2nd parameter is one of 8 bit encoding, it didn't work  
before on Japanese system, where it was called like :


CFStringGetCStringPtr( ...,  CFStringGetSystemEncoding() )

The encoding method on a Japanese system is

kCFStringEncodingMacJapanese 


So, I forced the 2nd parameter to kCFStringEncodingUTF8 and thought  
that it would work on English system also.

However, on an English system, of which system encoding is

kCFStringEncodingMacRoman 



It doesn't convert its 1st parameter and returned 0.
So, I had to call another CFStringGetCStringPtr() with  
CFStringGetSystemEncoding() as its 2nd parameter.


Is it a bug? Usually English encoding is the most trouble-free  
encoding method which can be converted to UTF8. So, I expected that  
it would work with kCFStringEncodingUTF8.

Or.. can anyone tell me why it doesn't work?

My whole source code which contains this fix is like

  char *fullPath;
  char outPath[512];;
Boolean conversionResult;
  CFStringEncoding encodingMethod;
  // This is for ensuring safer operation. When  
CFStringGetCStringPtr() fails,

  // it tries CFStringGetCString().
encodingMethod = CFStringGetSystemEncoding();
// 1st try for English system
  fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
  if( fullPath == NULL )
  {
  // 2nd try for Japanese system
  encodingMethod = kCFStringEncodingUTF8;
  fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
  }
// for safer operation.
  if( fullPath == NULL )
  {
  CFIndex length = CFStringGetLength(mstr);
  fullPath = (char *)malloc( length + 1 );
  conversionResult = CFStringGetCString(mstr, fullPath, length,  
kCFStringEncodingUTF8 );

strcpy( outPath, fullPath );
free( fullPath );
  }
  else
  strcpy( outPath, fullPath );

Thank you.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com

This email sent to lcerv...@me.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Anders Lassen

Hi,

The font descent is the maximum descent for all characters in that  
font, so it will not help me to position the character correct.


Anders Lassen


On Jun 23, 2009, at 7:37 PM, I. Savant wrote:


On Jun 23, 2009, at 12:44 PM, Anders Lassen wrote:

To clarify this and my original question: It is easy to find  
infomation about how to get a fonts ascent and descent, but I cant  
find any info about getting ascent/descent fot individual glyphs.


 I'm not sure if this is correct, but looking at this:

http://developer.apple.com/documentation/Cocoa/Conceptual/FontHandling/Tasks/GettingFontMetrics.html

 ... seems to indicate that performing the correct rectangle math  
using the font's -lineHeight, -ascender, and -descender methods  
combined with the bounding rect of the glyph should give you a  
remainder rectangle whose height is your answer.


--
I.S.






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Quincey Morris

On Jun 23, 2009, at 10:32, Anders Lassen wrote:


I am working on a project that involves writing math formulas.:

2 * x^2 + sqrt(3)
-  + aB
   3

note that the above is only to explain, what I mean by math formulas.

In my project, I have a object type that handles letters. Because  
letters must be aligned to special math symbols I need to know the  
ascent and descent of the character.


But maybe, I have now found a way to do this, although it is not  
tested yet.


I hope that the function:

ATSUGetUnjustifiedBounds

will help me.


It sounds like you want the glyph bounding boxes -- "glyph ascent" is  
not really a standard term like "font ascent", so it could mean one of  
several possible metrics. I tried searching developer.apple.com for  
"glyph metrics" and the second hit was this tech note:


http://developer.apple.com/technotes/tn/tn2033.html

which explains how to get glyph metrics (include glyph bounding boxes)  
using ATSUI. The 19th hit was:


	http://developer.apple.com/documentation/Carbon/Reference/CTFontRef/Reference/reference.html#/ 
/apple_ref/c/func/CTFontGetBoundingRectsForGlyphs


which explains how to get the same information using Core Text.

Is that the information you need?


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: renaming executable files

2009-06-23 Thread Mr. George Warner

On Jun 23, 2009, at 12:40 AM, Jens Miltner wrote:

Am 22.06.2009 um 19:22 schrieb Mr. George Warner:
On Sun, 21 Jun 2009 06:47:26 -0700 (PDT), Angelo Chen > wrote:
> I need to rename the executable file without renaming the  
project, how to do that? thanks




Interesting - I believe it should say "Product Name" in point #4of  
that Q&A article instead of "Project Name"?


You are correct… I sponsored that doc and missed it. Good catch. ;-)

I've already notified the author but next time you can post notes to  
the author via the feedback section ("Did this document help you?") at  
the bottom of a technote, Q&A, or code samples web page.


--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread I. Savant

On Jun 23, 2009, at 12:44 PM, Anders Lassen wrote:

To clarify this and my original question: It is easy to find  
infomation about how to get a fonts ascent and descent, but I cant  
find any info about getting ascent/descent fot individual glyphs.


  I'm not sure if this is correct, but looking at this:

http://developer.apple.com/documentation/Cocoa/Conceptual/FontHandling/Tasks/GettingFontMetrics.html

  ... seems to indicate that performing the correct rectangle math  
using the font's -lineHeight, -ascender, and -descender methods  
combined with the bounding rect of the glyph should give you a  
remainder rectangle whose height is your answer.


--
I.S.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Anders Lassen

Hi,

I am working on a project that involves writing math formulas.:

2 * x^2 + sqrt(3)
-  + aB
3

note that the above is only to explain, what I mean by math formulas.

In my project, I have a object type that handles letters. Because  
letters must be aligned to special math symbols I need to know the  
ascent and descent of the character.


But maybe, I have now found a way to do this, although it is not  
tested yet.


I hope that the function:

ATSUGetUnjustifiedBounds

will help me.


Anders Lassen

On Jun 23, 2009, at 7:10 PM, I. Savant wrote:


On Jun 23, 2009, at 12:44 PM, Anders Lassen wrote:

To clarify this and my original question: It is easy to find  
infomation about how to get a fonts ascent and descent, but I cant  
find any info about getting ascent/descent fot individual glyph



 What exactly are you trying to accomplish? In other words, what are  
you using this information for? Because there doesn't seem to be a  
way to do this easily / directly for individual glyphs, the best way  
forward likely depends heavily on your ultimate goal.


--
I.S.






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread JongAm Park

Hello.

I didn't find any CoreFoundation mailing list, so I post my question 
about CFStringEtCStringPtr() here in Cocoa mailing list.


My problem is that CFStringGetCStringPtr( ..., kCFStringEncodingUTF8) 
doesn't convert a string passed through its first parameter and returns 
0 on English system.
However, on Japanese system, it returns a pointer to converted string 
correctly.


The first parameter points to a string which is a path in English. There 
is no Japanese characters.
Because the 2nd parameter is one of 8 bit encoding, it didn't work 
before on Japanese system, where it was called like :


CFStringGetCStringPtr( ...,  CFStringGetSystemEncoding() )

The encoding method on a Japanese system is

kCFStringEncodingMacJapanese 


So, I forced the 2nd parameter to kCFStringEncodingUTF8 and thought that 
it would work on English system also.

However, on an English system, of which system encoding is

kCFStringEncodingMacRoman 



It doesn't convert its 1st parameter and returned 0.
So, I had to call another CFStringGetCStringPtr() with 
CFStringGetSystemEncoding() as its 2nd parameter.


Is it a bug? Usually English encoding is the most trouble-free encoding 
method which can be converted to UTF8. So, I expected that it would work 
with kCFStringEncodingUTF8.

Or.. can anyone tell me why it doesn't work?

My whole source code which contains this fix is like

   char *fullPath;
   char outPath[512];;
  
   Boolean conversionResult;

   CFStringEncoding encodingMethod;
   // This is for ensuring safer operation. When 
CFStringGetCStringPtr() fails,

   // it tries CFStringGetCString().
  
   encodingMethod = CFStringGetSystemEncoding();
  
   // 1st try for English system

   fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
   if( fullPath == NULL )
   {
   // 2nd try for Japanese system
   encodingMethod = kCFStringEncodingUTF8;
   fullPath = (char*)CFStringGetCStringPtr(mstr, encodingMethod);
   }
  
   // for safer operation.

   if( fullPath == NULL )
   {
   CFIndex length = CFStringGetLength(mstr);
   fullPath = (char *)malloc( length + 1 );
   conversionResult = CFStringGetCString(mstr, fullPath, length, 
kCFStringEncodingUTF8 );
  
   strcpy( outPath, fullPath );
  
   free( fullPath );

   }
   else
   strcpy( outPath, fullPath );

Thank you.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Realtime, GC and ObjC (Was Re: Opinion on managed memory and garbage collection)

2009-06-23 Thread Andy Lee
On Tuesday, June 23, 2009, at 12:29PM, "Andrea Gozzi"  
wrote:
>> On Jun 23, 2009, at 1:39 AM, Chris Idou wrote:
[...]
>> One of the concerns I see with GC is "I can't use it because my app  
>> is realtime or near-realtime".  In this case, GC or not is moot and  
>> the real issue is that you can't use Objective-C for realtime uses.
>
>First hand feedback: as an experiment we migrated our realtime-audio  
>apps from retain/release to GC a couple weeks ago while at WWDC. The  
>performance we see in the resulting garbage-collected apps is *very*  
>good,  and completely different than what we saw when we tried GC back  
>with 10.5.0 (no comment).
>
>After spending another few days checking things under load with Shark  
>and Instruments we came to the conclusion that GC is performing too  
>well not to use it, and we are switching to it for good. Once we  
>remove the crust of retain/release techniques from our code we expect  
>to see a net performance/stability gain...  and you should not  
>underestimate how psychologically exhilarating is to delete that  
>complex and now useless retain-cycles graph handler you spent 2 months  
>of your life to write and debug years ago :)

Thanks for this data point!  Some months ago, bbum posted a good rundown of the 
merits of GC, including the fact that its performance would be improving and 
would be taking advantage of multiple cores.  What you observed seems to 
validate this information.

--Andy


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread I. Savant

On Jun 23, 2009, at 12:44 PM, Anders Lassen wrote:

To clarify this and my original question: It is easy to find  
infomation about how to get a fonts ascent and descent, but I cant  
find any info about getting ascent/descent fot individual glyph



  What exactly are you trying to accomplish? In other words, what are  
you using this information for? Because there doesn't seem to be a way  
to do this easily / directly for individual glyphs, the best way  
forward likely depends heavily on your ultimate goal.


--
I.S.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Andy Lee
On Tuesday, June 23, 2009, at 11:14AM, "Kyle Sluder"  
wrote:
>There is no reason you can't do this:
>
>BOOL a = [foo bar];
>BOOL b = [baz quux];
>return a || b;

And I would add a brief comment to each of the lines where you're relying on 
side effects, in case someone comes along later and is tempted (as I think 
would be natural) to simplify the code to [foo bar] || [baz quux].

--Andy


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Anders Lassen

Hi,

I have read:

TrueType Reference Manual:
http://developer.apple.com/textfonts/TTRefMan/

FontHandling:
http://developer.apple.com/documentation/Cocoa/Conceptual/FontHandling/FontHandling.pdf

and

About drawing text with Cocoa NSString and NSAtrributedString, etc.

and

"Introduction to Quartz 2D Porgramming Guide"

but with no luck.

I have also seached the internet for "descent for glyphs"

but with no luck.

To clarify this and my original question: It is easy to find  
infomation about how to get a fonts ascent and descent, but I cant  
find any info about getting ascent/descent fot individual glyphs.



On Jun 23, 2009, at 6:21 PM, I. Savant wrote:


On Jun 23, 2009, at 12:14 PM, Anders Lassen wrote:


I need to know the descent and ascent for individual glyphs.

I have looked in several document sets -- both cocoa and carbon,  
but I did not have any luck.


Hope someone can help,


 What specific documentation did you read? What did you not  
understand about it? What have you tried on your own?


 Suggested reading:

How to Ask Questions the Smart Way
http://catb.org/~esr/faqs/smart-questions.html

--
I.S.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Realtime, GC and ObjC (Was Re: Opinion on managed memory and garbage collection)

2009-06-23 Thread Andrea Gozzi

On Jun 23, 2009, at 4:53 PM, Bill Bumgarner wrote:


On Jun 23, 2009, at 1:39 AM, Chris Idou wrote:
I haven't noticed GC pauses. It seems to me that the GC collects  
memory extremely quickly, relative to when it becomes unreachable.  
Given that it apparently does a lot of work in another thread, I  
wouldn't expect there to be much pausing in "normal" applications.


Good.  Then it is behaving as designed.  And the pauses are shorter  
and fewer in Snow Leopard.  Expect the trend to continue.


One of the concerns I see with GC is "I can't use it because my app  
is realtime or near-realtime".  In this case, GC or not is moot and  
the real issue is that you can't use Objective-C for realtime uses.


First hand feedback: as an experiment we migrated our realtime-audio  
apps from retain/release to GC a couple weeks ago while at WWDC. The  
performance we see in the resulting garbage-collected apps is *very*  
good,  and completely different than what we saw when we tried GC back  
with 10.5.0 (no comment).


After spending another few days checking things under load with Shark  
and Instruments we came to the conclusion that GC is performing too  
well not to use it, and we are switching to it for good. Once we  
remove the crust of retain/release techniques from our code we expect  
to see a net performance/stability gain...  and you should not  
underestimate how psychologically exhilarating is to delete that  
complex and now useless retain-cycles graph handler you spent 2 months  
of your life to write and debug years ago :)


Andrea


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread I. Savant

On Jun 23, 2009, at 12:14 PM, Anders Lassen wrote:


I need to know the descent and ascent for individual glyphs.

I have looked in several document sets -- both cocoa and carbon, but  
I did not have any luck.


Hope someone can help,


  What specific documentation did you read? What did you not  
understand about it? What have you tried on your own?


  Suggested reading:

How to Ask Questions the Smart Way
http://catb.org/~esr/faqs/smart-questions.html

--
I.S.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Problem: how to get glyph descent and ascent

2009-06-23 Thread Anders Lassen

Hi,

I need to know the descent and ascent for individual glyphs.

I have looked in several document sets -- both cocoa and carbon, but I  
did not have any luck.


Hope someone can help,

Anders Lassen
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Amount of Arguments per Method

2009-06-23 Thread WT

On Jun 23, 2009, at 4:57 PM, mmalc Crawford wrote:


On Jun 23, 2009, at 4:05 AM, WT wrote:

Why is it so baffling? The question is not wanting something to be  
changed, but wanting *bad enough* to have something changed.


Because, as has been stated so often, posting messages to a list  
will not cause any change.
If you complain about something on a list but don't actually file a  
bug report, then you're simply wasting everyone's time.


You're making the unjustified assumption that my original comment was  
a complaint intended to cause a change. As is clear from what I said -  
or at least it should have been - I can live with things as they are,  
so my original comment was merely that: a comment. Last I checked,  
people can still post comments in this list, provided they are related  
to the list's subject matter. That is, comments don't *have* to imply  
an action.


Whether or not it's an actual *error* is immaterial -- it's a  
usability issue.  It's still considered as a bug.


Not if it's a usability issue to only a very small group of people,  
which seems to be the case here.


Bug reports don't have to be a novel.  You could have spent less  
time filing a bug report than you have posting messages to this  
thread.


Since you're going to one extreme, let me go to the other. What do you  
think the result would be if someone filed a request that just said  
"add spaces to the documentation" ? If this is something important to  
me, I'd make the effort to be thorough in my reasoning when filing a  
request. Being thorough does not equate to writing a novel, but it  
still requires time.



You would also have better respected others' time.


It's the second time in your message that you subtly accuse me of  
wasting your time (and other people's). No one forced you to read my  
posts.


Efforts posting to a list without filing a bug report are certainly  
wasted.


See the first paragraph of this reply.

It's clearly sufficiently important an issue that you're willing to  
bring it to several thousand other people's attention.  If it's  
important enough for that, it's important enough for a bug report.


Another unjustified assumption. If my intention was to bring this  
specific matter to the attention of several thousand people with the  
specific intention of effecting change, I would have done it in a  
separate thread, not in this thread. As I pointed out above, my  
original message was merely a comment.



So, ease off with the head-chewing.



Please don't misrepresent others' behaviour.


I don't think I did that and I stand by my request. Your "This is  
simply baffling" was clearly judgmental, and uncalled for in a public  
venue.


===

Not that I see a reason to continue this exchange, but should you  
choose to do so, we should do it off the list.


Wagner
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Netscape Plugin error

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 7:37 AM, Reza Farhad wrote:
>
> Dear All
>
> I am not sure if this is right place for this, however:
> In my application when I try to load a certain web pages into a Webview I
> get the following error:
>
>
> #0      0x9096d9b7 in Debugger
> #1      0x13de47f5 in .objc_class_name_SwitchablePlugin
> #2      0x13de4aaf in NP_Initialize

This is probably just the Flash plugin being stupid as it usually is.
Fortunately it's also harmless. All Debugger() does is log a message
to the console saying that it was called. If you check your executable
settings in Xcode you'll find a checkbox to make it so the debugger
does not stop in this function, or you can just click continue to keep
running the app when you hit it.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Kai Brüning


On 23.6.2009, at 17:14, Kyle Sluder wrote:

On Tue, Jun 23, 2009 at 7:47 AM, Graham Cox  
wrote:
I'd like to if I could - unfortunately in this case the method in  
question
is -validateMenuItem: which is designed to have intentional side- 
effects,
like setting the item's state or title, as well as returning a  
boolean value
for the enable state. The API might have been better if it returned  
nothing
and made you handle the enable state directly also, but it wasn't  
so I'm

stuck with it.


There is no reason you can't do this:

BOOL a = [foo bar];
BOOL b = [baz quux];
return a || b;


Or, different style:

BOOL a = NO;

if ([foo bar])
   a = YES;
if ([baz quux])
   a = YES;

return a;

Kai

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Debugging NSService

2009-06-23 Thread Laurent Cerveau
I realize I did not provide a lot of information. So the Plist of my  
apps looks like :


NSServices


NSMenuItem

default
EnclickTo

NSMessage
ec2Encrypt
NSPortName
EnclickToService
NSSendTypes

Apple URL pasteboard type
NSFilenamesPboardType




However this is more my particular case and what I would more be  
looking for is (if there is ) a method to debug this (like enabling a  
default for service verbose if there is one)


Thanks

laurent


On Jun 23, 2009, at 4:34 PM, Laurent Cerveau wrote:



Hi

I want to add a service to my application. So I created the service  
entry in the plist, implemented the methods with proper signature,  
register the service at Application Did Finish launching time but  
unfortunately I never see my service appearing in the Services menu  
(after login and all).


How can I debug this?

thanks

laurent
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lcerveau%40me.com

This email sent to lcerv...@me.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to disable selection on Mouse down for NSOutlineView?

2009-06-23 Thread Arun
Hi All,

I have an application in which i use NSOutlineView Control. I need to
disable selection of leaf nodes when the mouse is down and select onlt on
mouse up.
How can i do this?

Thanks
Arun KA
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-23 Thread Jim Correia

On Jun 23, 2009, at 11:06 AM, Kyle Sluder wrote:

On Tue, Jun 23, 2009 at 6:53 AM, Jim Correia  
wrote:

On Jun 23, 2009, at 1:35 AM, Kyle Sluder wrote:

I do not see where you're finding this.  The bindings documentation
says: "The object should be suitable for the passing to
setObjectValue."  Maybe it's in the conceptual docs?


In the link I included in my last email (which was wrapped when  
sent to the

list):


Okay... but you are aware that's the documentation for
NSTextFieldCell, not NSTableColumn?  Bindings in a table view are done
on the table column, not on the cells themselves.


Correct. I should have read the original question more carefully.

Binding an NSTableColumn to a model object property which returns an  
NSAttributedString works correctly. As does binding to a property  
through a value transformer which returns an NSAttributedString.


Jim
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Kyle Sluder
On Tue, Jun 23, 2009 at 7:47 AM, Graham Cox wrote:
> I'd like to if I could - unfortunately in this case the method in question
> is -validateMenuItem: which is designed to have intentional side-effects,
> like setting the item's state or title, as well as returning a boolean value
> for the enable state. The API might have been better if it returned nothing
> and made you handle the enable state directly also, but it wasn't so I'm
> stuck with it.

There is no reason you can't do this:

BOOL a = [foo bar];
BOOL b = [baz quux];
return a || b;

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-23 Thread Kyle Sluder
On Tue, Jun 23, 2009 at 6:53 AM, Jim Correia wrote:
> On Jun 23, 2009, at 1:35 AM, Kyle Sluder wrote:
>> I do not see where you're finding this.  The bindings documentation
>> says: "The object should be suitable for the passing to
>> setObjectValue."  Maybe it's in the conceptual docs?
>
> In the link I included in my last email (which was wrapped when sent to the
> list):

Okay... but you are aware that's the documentation for
NSTextFieldCell, not NSTableColumn?  Bindings in a table view are done
on the table column, not on the cells themselves.  The table column
does not in turn bind any cells (after all, it only has one cell!); it
observes the keypath you specify and tells its tableview to redraw for
any rows that have been changed.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Amount of Arguments per Method

2009-06-23 Thread mmalc Crawford


On Jun 23, 2009, at 4:05 AM, WT wrote:

Why is it so baffling? The question is not wanting something to be  
changed, but wanting *bad enough* to have something changed.


Because, as has been stated so often, posting messages to a list will  
not cause any change.
If you complain about something on a list but don't actually file a  
bug report, then you're simply wasting everyone's time.



As I pointed out in the section that you left out of your quote of  
my previous message, I don't believe that Apple would change  
something across their entire documentation that is not an actual  
error




Whether or not it's an actual *error* is immaterial -- it's a  
usability issue.  It's still considered as a bug.



and which most people in this list don't even think is an issue at  
all, which means that in order to make a convincing case I'd have to  
spend an atypically large amount of time composing my request. Like  
most people, I have other things to do.




Bug reports don't have to be a novel.  You could have spent less time  
filing a bug report than you have posting messages to this thread.   
You would also have better respected others' time.


Unlike many people, I try not to do things in a half-cooked way and  
would/will file a request only if I'm reasonably sure that my  
efforts would/will pay off.


Efforts posting to a list without filing a bug report are certainly  
wasted.



Also, I do not consider this such a high-priority issue, which I  
already alluded to earlier when I said that I've learned to deal  
with it in my own way, or else I would already have filed a  
documentation enhancement request.


It's clearly sufficiently important an issue that you're willing to  
bring it to several thousand other people's attention.  If it's  
important enough for that, it's important enough for a bug report.




So, ease off with the head-chewing.


Please don't misrepresent others' behaviour.

mmalc

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Service not working

2009-06-23 Thread Guillem Palou

Hi all,

I've just solved the problem!
Thanks for the answers!

On Jun 22, 2009, at 11:37 PM, Guillem Palou wrote:


Hi folks,

I'm trying to develop an application that acts as a service, but I  
cannot make it appear on the Services Menu and I cannot execute it  
on the applications.  I tried to search for similar posts with no  
success and looked at the documentation at least 4 times with no  
luck either.

See If somebody can help me :)
Here Is the portion of the .plist files corresponding to the Service  
entry


NSServices


NSMessage
serviceMovieInfo
NSPortName
MovieInfoReport
NSReturnTypes

NSStringPboardType

NSSendTypes

NSStringPboardType

NSMenuItem

Menu item title
Get Movie Info




The methods are defined like they are put on the file; After  
compiling I've put the application with .app and .service in the  
places to see if it works but no luck either...


Anyone has some ideas?

Many thanks to all!

Guillem






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Realtime, GC and ObjC (Was Re: Opinion on managed memory and garbage collection)

2009-06-23 Thread Bill Bumgarner

On Jun 23, 2009, at 1:39 AM, Chris Idou wrote:
I haven't noticed GC pauses. It seems to me that the GC collects  
memory extremely quickly, relative to when it becomes unreachable.  
Given that it apparently does a lot of work in another thread, I  
wouldn't expect there to be much pausing in "normal" applications.


Good.  Then it is behaving as designed.  And the pauses are shorter  
and fewer in Snow Leopard.  Expect the trend to continue.


One of the concerns I see with GC is "I can't use it because my app is  
realtime or near-realtime".  In this case, GC or not is moot and the  
real issue is that you can't use Objective-C for realtime uses.


And, by "realtime uses", I really mean "you can't use Objective-C or  
CoreFoundation in a thread that requires near-realtime  
servicing" (since there is no support for real-realtime services in  
Mac OS X).


Any invocation of objc_msgSend() can block and/or allocation memory.   
It doesn't happen often, very rare actually, but it *can* happen and  
*will* happen when something causes various method caches to be  
flushed and repopulated.


Since a bunch -- and growing portion -- of CoreFoundation is  
implemented using Objective-C, you can't use CF either.


However, this isn't really the bugaboo that it sounds like.   The  
reality is that if your app has some particular subset of behaviors  
that are so terribly time sensitive -- of which there are a number of  
perfectly valid reasons why that might be -- that you need pretty  
close to realtime behavior, then you need to isolate said behavior(s)  
as much as possible.


This means:

- stick the behavior(s) in a thread that does as little work as possible
- don't do any allocaitons;  pre-allocate all the buffers you need
- don't do any locking; use lockless algorithms for push/pull of the  
data

- don't use any system APIs except exactly what is needed

And that is overly-simplistic, of course.

One last really big caveat:  Do not assume that you need to avoid ObjC/ 
CF/GC/sys until you can prove that you really need to.


b.bum


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Amount of Arguments per Method

2009-06-23 Thread Sean McBride
That can be better, but then you end up with 2x as many arguments, in a way:

[NSDictionary dictionaryWithObjectsAndKeys:
ob1, key1,
ob2, key2, ... etc.


On 6/22/09 7:10 AM, Jack Carbaugh said:

>With that many arguments, i'd make a dictionary and pass only that
>dictionary. I understand your choice for not doing so however.
>
>jack
>
>On Jun 22, 2009, at 4:03 AM, Roland King wrote:
>
>> This still the longest one or has Apple outdone themselves since? 11
>> args, you really wouldn't want much more than this.
>>
>> -
>> (id
>> )initWithBitmapDataPlanes:pixelsWid
>e:pixelsHigh:bitsPerSample:samplesPer
>Pixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel
>> :
>>
>> WT wrote:
>>> On Jun 22, 2009, at 8:05 AM, Chunk 1978 wrote:
 clearly simplicity is important, but i'd like to know if there is a
 limit for the amount of arguments which a method can handle?
>>> I don't know if there's an upper limit, but I don't recall ever
>>> writing a method with more than 5 or 6 arguments. When I feel
>>> inclined  to do otherwise, it typically means that there's a flaw
>>> in my design.
>>> Wagner
>>> ___
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
>>> This email sent to r...@rols.org
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/intrntmn%40aol.com
>>
>> This email sent to intrn...@aol.com
>
>___
>
>Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
>Please do not post admin requests or moderator comments to the list.
>Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>Help/Unsubscribe/Update your Subscription:
>http://lists.apple.com/mailman/options/cocoa-dev/sean%40rogue-research.com
>
>This email sent to s...@rogue-research.com
>

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Graham Cox


On 24/06/2009, at 12:24 AM, Michael Ash wrote:


If both expressions must be evaluated, then store them into separate
variables before combining them. Or better yet, if possible, redesign
your code so that it does not require side effects of boolean
expressions to happen in the first place.



I'd like to if I could - unfortunately in this case the method in  
question is -validateMenuItem: which is designed to have intentional  
side-effects, like setting the item's state or title, as well as  
returning a boolean value for the enable state. The API might have  
been better if it returned nothing and made you handle the enable  
state directly also, but it wasn't so I'm stuck with it.


The reason that I ever have to OR together two of these is because I'm  
using quite a lot of message forwarding in my app, so in 1 or 2 places  
I have to OR my forwarded -validateMenuItem: with super's  
implementation. I have managed to eliminate nearly all the places  
where I was doing this but not all - but it's getting cleaner all the  
time so maybe we'll end up without the need for this at some point.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-23 Thread Sean McBride
On 6/18/09 2:52 PM, Greg Guerin said:

>Chilton Webb wrote:
>
>> Is there a way to add a tag an IB object in such a way that it is
>> not visible to the user, but in such a way that I could reference
>> it from my app?
>
>
>Maybe the -tag method: it returns a 32-bit integer..  It's settable
>in IB as the control's tag value.  I don't know if iPhone has it.
>
>Since it's only 32-bits I don't know how useful it would be for your
>intended purpose.  But IB has no inherent use for it, and it is
>readable from the app.

Note that 'tag' is 64 bit in 64 bit apps.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Debugging NSService

2009-06-23 Thread Laurent Cerveau


Hi

I want to add a service to my application. So I created the service  
entry in the plist, implemented the methods with proper signature,  
register the service at Application Did Finish launching time but  
unfortunately I never see my service appearing in the Services menu  
(after login and all).


How can I debug this?

thanks

laurent
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 8:16 AM, Graham Cox wrote:
>
> On 23/06/2009, at 10:03 PM, Igor Mozolevsky wrote:
>
>> BOOL someValue = [object returnsBool] | [anotherObject alsoReturnsBool];
>>
>> which is a bitwise OR of two YESes, essentially.
>
>
> OK, makes sense... and since ||= is not valid, there should be no hidden
> gotcha with organising things this way.
>
> I was running into a problem with short-circuit evaluation with BOOL foo =
> [a bar] || [b baz]; where baz wasn't being called. Splitting the code down
> to
>
> BOOL foo = [a bar] | [b baz]; will always call baz but the result  will
> be identical...

The result is not guaranteed to be identical. It probably won't
*matter*, but [a bar] || [b baz] is guaranteed to always be 0 or 1,
whereas [a bar] | [b baz] could be any integer value (depending, of
course, on what bar and baz return).

Assuming bar and baz both return BOOL, then you just have the
potential for a non-one version of "true" in foo, which is fine. If,
however, bar and baz return, say, int, then you have the potential to
have non-zero values with the least-significant byte containing 0, at
which point foo will contain NO. Bad news.

> The problem crops up in combining calls to -validateMenuItem:, where the
> validation not only returns YES or NO but may also have side effects like
> changing the state of item. The call must be made even if the actual result
> is logically redundant.

I would like to suggest that your solution is less than ideal. A
programmer coming back through your code is likely to miss the fact
that there is only one pipe symbol instead of two, due to the fact
that the logical operator would be expected in code dealing with BOOL.
He is therefore likely to commit the opposite mistake you did: that of
assuming that the expression will short-circuit, and then being
confused when it does not.

If both expressions must be evaluated, then store them into separate
variables before combining them. Or better yet, if possible, redesign
your code so that it does not require side effects of boolean
expressions to happen in the first place.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Beginner Question Re: Memory Management

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 2:05 AM, WT wrote:
> On Jun 23, 2009, at 7:37 AM, Eric Hermanson wrote:
>
>> UNFORTUNATELY, the iPhone Simulator does not support instance variable
>> synthesis (at least it didn't in 2.x, maybe that changed in 3.0).
>
> I just tested that in the 3.0 simulator and it does NOT support ivar
> synthesis.

The 32-bit Objective-C runtime on the Mac side of things does not
support it, which means the simulator can't support it unless it moves
to 64-bit on the Mac side. That would open its own can of worms, since
the iPhone is a 32-bit platform. The only other way to resolve this
would be for the simulator to bring in a custom ObjC runtime and that
seems extremely unlikely to happen to me.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Beginner Question Re: Memory Management

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 12:31 AM, WT wrote:
> What the heck???
>
> So, after I scratched my head silly for several minutes, it suddenly came to
> me. If I'm going to use a property, I *must* refer to it as object.property
> rather than simply as property. In the specific example I had, I should not
> have replaced all those repeated chunks of code with
>
> textFieldPreviousContent = textField.text;
>
> but with
>
> self.textFieldPreviousContent = textField.text;
>
> Using
>
> textFieldPreviousContent = textField.text;
>
> meant that I was bypassing the very memory management I thought I was
> getting for free by turning textFieldPreviousContent into a property. Of
> course, my mistake implied that a) I was leaking the string pointed to by
> textFieldPreviousContent and b) I was not retaining the string returned by
> textField.text. And since that string is returned to me auto-released,
> textFieldPreviousContent ended up pointing to a memory location that was no
> longer valid by the time I used its contents. No wonder my app crashed.

Stuff like this is why I believe this silly dot syntax thing should be
avoided completely. If you had written [self
setTextFieldPreviousContent:[textField text]], not only would you have
avoided the mysterious crash, but it's *much* clearer exactly what's
going on. Using dot syntax instead of brackets only saves you maybe
four characters of typing and costs you dearly in terms of clarity.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Opinion on managed memory and garbage collection

2009-06-23 Thread Michael Ash
On Tue, Jun 23, 2009 at 2:09 AM, Quincey
Morris wrote:
> On Jun 22, 2009, at 21:21, Michael Ash wrote:
>
>> IMO there are three major reasons to avoid GC at this point:
>
> Your reasons are clearly stated, rational, compelling ... and almost
> *entirely* anecdotal. That means what you say is a personal perspective --
> and I'm pretty sure that you know that. But there are 2 things that concern
> me:
>
> 1) You're very convincing, maybe more even than you intended, so I'm afraid
> others might take this perspective as the *only* perspective (aka "fact").

Just to be clear, the list of reasons was meant to simply elaborate
some disadvantages, not be an attempt to show that it should be
avoided. I can see how "three major reasons to avoid GC" can be
interpreted the other way, but such was not my intent.

Thanks for coming in on the other side.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-23 Thread Jim Correia

On Jun 23, 2009, at 1:35 AM, Kyle Sluder wrote:

On Mon, Jun 22, 2009 at 9:12 PM, Jim Correia  
wrote:
The documentation for the value binding of NSTableView says that  
NSString

and NSNumber are the supported value types.


I do not see where you're finding this.  The bindings documentation
says: "The object should be suitable for the passing to
setObjectValue."  Maybe it's in the conceptual docs?


In the link I included in my last email (which was wrapped when sent  
to the list):





Value Bindings

value

An NSString or NSNumber that is displayed as the content of the
NSTextFieldCell. Availability:

- Jim
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Graham Cox


On 23/06/2009, at 10:03 PM, Igor Mozolevsky wrote:

BOOL someValue = [object returnsBool] | [anotherObject  
alsoReturnsBool];


which is a bitwise OR of two YESes, essentially.



OK, makes sense... and since ||= is not valid, there should be no  
hidden gotcha with organising things this way.


I was running into a problem with short-circuit evaluation with BOOL  
foo = [a bar] || [b baz]; where baz wasn't being called. Splitting the  
code down to


BOOL foo = [a bar] | [b baz]; will always call baz but the result  
 will be identical...


The problem crops up in combining calls to -validateMenuItem:, where  
the validation not only returns YES or NO but may also have side  
effects like changing the state of item. The call must be made even if  
the actual result is logically redundant.


--Graham
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Roland King
no. | is bitwise, not logical, || is the short-circuit one and there  
is no ||=.



On Jun 23, 2009, at 7:56 PM, Graham Cox wrote:


Just a quickie...

If I have:

BOOL someValue = [object returnsBool];

someValue |= [anotherObject alsoReturnsBool];

is the second line subject to short-circuit evaluation? In other  
words if the first method returns YES, is the second called?


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org

This email sent to r...@rols.org


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Igor Mozolevsky
2009/6/23 Igor Mozolevsky :
> 2009/6/23 Graham Cox :
>> Just a quickie...
>>
>> If I have:
>>
>> BOOL someValue = [object returnsBool];
>>
>> someValue |= [anotherObject alsoReturnsBool];
>>
>> is the second line subject to short-circuit evaluation? In other words if
>> the first method returns YES, is the second called?
>
> The second one will be called - | is a bitwise OR, whereas || is a logical OR.

So, the second will only be evaluated if the first returns NO when

BOOL someValue = [object returnsBool] || [anotherObject alsoReturnsBool];

whereas what you have is

BOOL someValue = [object returnsBool] | [anotherObject alsoReturnsBool];

which is a bitwise OR of two YESes, essentially.

--
Igor
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Short-circuit evaluation

2009-06-23 Thread Igor Mozolevsky
2009/6/23 Graham Cox :
> Just a quickie...
>
> If I have:
>
> BOOL someValue = [object returnsBool];
>
> someValue |= [anotherObject alsoReturnsBool];
>
> is the second line subject to short-circuit evaluation? In other words if
> the first method returns YES, is the second called?

The second one will be called - | is a bitwise OR, whereas || is a logical OR.

--
Igor
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Short-circuit evaluation

2009-06-23 Thread Graham Cox

Just a quickie...

If I have:

BOOL someValue = [object returnsBool];

someValue |= [anotherObject alsoReturnsBool];

is the second line subject to short-circuit evaluation? In other words  
if the first method returns YES, is the second called?


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Netscape Plugin error

2009-06-23 Thread Reza Farhad


Dear All

I am not sure if this is right place for this, however:
In my application when I try to load a certain web pages into a  
Webview I get the following error:



#0  0x9096d9b7 in Debugger
#1  0x13de47f5 in .objc_class_name_SwitchablePlugin
#2  0x13de4aaf in NP_Initialize
#3  0x98d9980f in -[WebNetscapePluginPackage _tryLoad]
#4  0x98d99437 in -[WebNetscapePluginPackage load]
#5	0x98de567f in -[WebNetscapePluginDocumentView  
initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element 
:]

#6  0x98dd2209 in WebFrameLoaderClient::createPlugin
#7  0x9779c3cb in WebCore::FrameLoader::loadPlugin
#8  0x9779bfa8 in WebCore::FrameLoader::requestObject
#9  0x976e8dea in WebCore::RenderPartObject::updateWidget
#10 0x97644842 in WebCore::FrameView::updateWidgets
#11 0x97644511 in WebCore::FrameView::performPostLayoutTasks
#12 0x9761e933 in WebCore::FrameView::layout
#13 0x9761e33b in WebCore::Timer::fired
#14 0x97605802 in WebCore::ThreadTimers::fireTimers
#15 0x97605222 in WebCore::ThreadTimers::sharedTimerFiredInternal
#16 0x976051a6 in WebCore::ThreadTimers::sharedTimerFired
#17 0x97ca11e4 in WebCore::timerFired
#18 0x91c3c14e in __CFRunLoopRun
#19 0x91c3a014 in CFRunLoopRunSpecific
#20 0x91c646c1 in CFRunLoopRunInMode
#21 0x962514c8 in RunCurrentEventLoopInMode
#22 0x962511c3 in ReceiveNextEventCommon
#23 0x96251048 in BlockUntilNextEventMatchingListInMode
#24 0x959628d5 in _DPSNextEvent
#25	0x95962149 in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:]

#26 0x9595c9c2 in -[NSApplication run]
#27 0x95947ac0 in NSApplicationMain
#28 0x22a8 in main at main.m:13

I have tried to put some try and catch blocks to handle this but I  
dont seem to be able to catch this.

Can anybody shed some light on this, and how I can resolve it.

Thanks

Reza
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-23 Thread Brian Bruinewoud

Thanks to all the responses.
-Wconversion made the warnings go away.
Hopefully that wont come back and bite me later...

On 23/06/2009, at 15:11 , Kyle Sluder wrote:

On Mon, Jun 22, 2009 at 9:01 PM, Michael Ash  
wrote:
I think you mean -Wshorten-64-to-32. -Wconversion warns you every  
time

a function call has the parameter passing altered by the presence of
the function's prototype, which is to say that it will warn you every
time you call any function (or method) which takes a char, unsigned
char, short, unsigned short, or float. Not exactly useful.


You are indeed correct, I had confused the two.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/brian%40darknova.com

This email sent to br...@darknova.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Amount of Arguments per Method

2009-06-23 Thread WT

On Jun 23, 2009, at 9:33 AM, mmalc Crawford wrote:


On Jun 22, 2009, at 10:59 PM, WT wrote:

Devpubs listens, and our delivery team (the folks that take the  
XML and output it to the various formats) ROCK.


I am now leaning more and more towards filing a documentation  
enhancement request.


This is simply baffling.
If you want something to be changed, then *file a bug report*.

mmalc


Why is it so baffling? The question is not wanting something to be  
changed, but wanting *bad enough* to have something changed.


As I pointed out in the section that you left out of your quote of my  
previous message, I don't believe that Apple would change something  
across their entire documentation that is not an actual error and  
which most people in this list don't even think is an issue at all,  
which means that in order to make a convincing case I'd have to spend  
an atypically large amount of time composing my request. Like most  
people, I have other things to do. Unlike many people, I try not to do  
things in a half-cooked way and would/will file a request only if I'm  
reasonably sure that my efforts would/will pay off.


Also, I do not consider this such a high-priority issue, which I  
already alluded to earlier when I said that I've learned to deal with  
it in my own way, or else I would already have filed a documentation  
enhancement request.


So, ease off with the head-chewing.

Wagner
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Beginner Question Re: Memory Management

2009-06-23 Thread Mike Abdullah
Note also that you should really be using -copy for string properties.  
It has the same effect as -retain, but also handles the possibility of  
someone handing in an NSMutableString.


On 23 Jun 2009, at 06:15, Graham Cox wrote:



On 23/06/2009, at 2:31 PM, WT wrote:


[textFieldPreviousContent release];
textFieldPreviousContent = [textField.text retain];



This is not a safe pattern anyway (though it's not the same as the  
discussion you raised). In isolation, suppose that the previous text  
and the current text are the same object. If no-one else is  
retaining it, then the first line will deallocate it, the second  
will send a message to a now deallocated object, probably crashing.


You get away with it in this case because something else *is*  
retaining the text, so the deallocation doesn't occur. But you  
shouldn't be relying on this - you'll get fewer bugs if you treat  
your memory management situations in isolation.


so do something like this:

NSString* temp = [[textField.text] retain];
[previousText release];
previousText = temp;

Even better is to make the setting of the previous text a standalone  
method, encapsulating this approach (or make it a retained property  
and synthesise it, as you did). That way the ad-hoc memory  
management done inline with other code can be removed, and isolated  
into one, correct, method.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


*** -[NSBundle Load] : Error loading code

2009-06-23 Thread Arjun SM
Hi all,
  I am get the following error every time i run my application on Tiger
10.4.11
*** -[NSBundle Load] : Error loading code /Library/Application
Support/appName.bundle/Contents/MacOS/appName for bundle
/Library/Application Support/appName.bundle/Contents/MacOS/appName, error
code 2 (link edit error code 0, error number 0 () )

Also please provide a link for the description of this Error code #.

Thanks,
~Arjun
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Service not working

2009-06-23 Thread Gregory Weston

Guillem Palou wrote:


I'm trying to develop an application that acts as a service, but I
cannot make it appear on the Services Menu and I cannot execute it on
the applications.  ...

NSServices


...
NSMenuItem

Menu item title
Get Movie Info








"NSMenuItem is a dictionary that specifies the text of the Services  
menu item. The solitary entry has the key default. ..."


You've got the wrong key name. It's literally supposed to be "default."
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Any Cocoa Developers on this list in Tallinn, Estonia?

2009-06-23 Thread John C. Randolph


On Jun 21, 2009, at 5:17 PM, Kok-Yong Tan wrote:

There's a potential client there I'd like to refer to you.  Please  
reply to me off-list.


Don't know about Estonia, but the guys at Software MacKiev would  
probably know.


-jcr

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


  1   2   >