Re: Live updating NSPredicateEditorRowTemplate?

2008-12-11 Thread Peter Ammon
This (terrible) message usually means that one of your templates  
contains an empty popup button, which is not allowed.


-Peter

On Dec 10, 2008, at 6:54 PM, Guy Umbright wrote:

As I mentioned, I can get new rows to add with an updated list via  
the code attached to the OP.  The problem is that if I uncomment the  
"[_editor reloadCriteria];" line the last popup of the initial row  
doesn't paint and I get the following message in the debug console:


"2008-12-10 20:49:41.050 prededit[12581:813] In 0x126340>, different number of items (2) than values (3)"


Guy

On Dec 8, 2008, at 8:58 PM, Peter Ammon wrote:



On Dec 8, 2008, at 6:37 PM, Guy Umbright wrote:

I am trying to create an NSPredicateEditorRowTemplate with its  
last view a  popup that contains a list of things (elsewhere in  
the window) that can be updated while the editor is being  
displayed.  I can get it so that I can add an instance of the  
template, update the list of items and add another instance which  
shows the updated list, but the original does not update.


For example, the original templates specifies A,B,C in the last  
popup.  I add a row with that template then I add a D to the list  
of items and then add another row to the Predicate Editor.  This  
new row will show me a list of A,B,C,D but the original row still  
just shows A,B,C.


Is there a way to resync that existing row with the new list of  
items in its source template?  Am I going to have to remove and re- 
add the row programmatically?


You should call -[NSPredicateEditor setRowTemplates:] with an array  
containing the new template (but not the old one).  If you want to  
preserve the predicate, you may have to save off the predicate via - 
objectValue, and then set it back; or alternatively calling  
reloadCriteria should work.


-Peter



___

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/pammon%40apple.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: CoreData -- addPersistentStoreWithType crashing [solved]

2008-12-11 Thread Ben Trumbull



This was exactly the problem.  It should be in the CoreData docs, or
better yet caught by the MOM compiler (I suppose GCC/LLVM can't really
catch this sort of thing since these are properly formed ObjC
classes).  Anyway, I spent a ton of time debugging this for it really
just being a syntax error.


Did you file a bug report with the full stack trace ?

- 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 [EMAIL PROTECTED]


Re: Update to xcode 3.1. copystrings failing, returning error code 71?

2008-12-11 Thread aaron smith
ah, I found it. was this
(http://www.digitalsanctum.com/2008/10/04/xcode-cant-exec-developerlibraryxcodeplug-inscorebuildtasksxcplugincontentsresourcescopystrings-no-such-file-or-directory/)

On Wed, Dec 10, 2008 at 11:46 PM, aaron smith
<[EMAIL PROTECTED]> wrote:
> Hey All, I just updated to xcode 3.1. When I make a new project, and
> try to build and go without even doing anything, I get a build fail.
>
> Here's the error:
> "error: can't execute
> /Developer/Library/Xcode/Plug-Ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings
> (No such file or directory)"
> "Command 
> /Developer/Library/Xcode/Plug-Ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings
> failed with exit code 71"
>
> Strange thing is, I checked to make sure that that copystrings file
> exists in the CoreBuildTasks. And it's there.
>
> Anyone else experience this?
> Thanks much.
>
___

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 [EMAIL PROTECTED]


AddressBook Framework, adding multiple records

2008-12-11 Thread Alexander Reichstadt

Hi,

using the AddressBook framework to add new records causes a console  
log saying that there is already one instance running of  
AddressBookSync. The entries I am adding do get added though and they  
look ok. Is there some way to avoid this or is this a bug? This is on  
10.5.x


Thank you.

Alexander



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 [EMAIL PROTECTED]

Issue with the preference window

2008-12-11 Thread Arnab Ganguly
Hi All,
I am trying out for the preference window.It is a simple app, and under the
main menu when I click on the preference it shows the preference menu popup.
But when I quit the preference window my app seemed to getting hang.I am not
able to quit the application and also the main menu also becoms inactive.

I have linked the "Preference" menu with  function  "makeKeyAndOrderFront"
in the IB. But in the IB Tool in case of the Preference window under the
Panel Connetions corresponding to makeKeyAndOrderFront i see some number 121
, is it ok?
Anybody came across similar issues?
Thanks in advance
Arnab
___

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 [EMAIL PROTECTED]


Re: PAM module

2008-12-11 Thread Jean-Daniel Dupas


Is PAM a Cocoa Project ? As we are on cocoa-dev, I assume it's one,  
isn't it ?
If not, you can try to post your question on a more appropriate list,  
like darwin-dev


Le 10 déc. 08 à 16:30, Macarov Anatoli a écrit :


How to compile a PAM module?
Where to download libpam-dev or files pam_appl.h, libpam.so?
I'd like to get PAM module from yubico-pam.c, here what I'm guided  
by:http://code.google.com/p/yubico-pam/wiki/ReadMe.

This is error when compiling:
"configure: error: PAM header files not found, install libpam-dev"


___

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 [EMAIL PROTECTED]


Re: Wizard development on Mac

2008-12-11 Thread Ronny Reichmann
Go to Apps > Utilities > Airport Assistant. Open the package and look  
at one of the Nibs in Resources to see how this is done and has to  
looke like.






Hi,
I have a MS Windows based Application Wizard written in C#. It is a  
typical

Next-Next-Finish types Wizard. I want to develop a similar Application
Wizard for Mac OS X 10.5.4.

I have gone through a number of applications from the Developer
documentation but I was not able to figure out which control to be  
used to

achieve the above navigation effect. Can any one help me in this?

Also, I have not seen such kind of navigation in any Mac  
Application. Is
this feature not standard on the Mac Platform? Is there an alternate  
way to

do this?

--
Regards,
Shraddha
___

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/reichmann.ronny62%40googlemail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


NSKeyedArchiever and XML Format

2008-12-11 Thread Patrick Mau

Good morning

For the last day I have pulled my hair over NSKeyedArchiever and  
friends to load and save small data objects.
I mainly use this feature for debugging, so the output format is set  
to XML.


Normally, one would write an object 'p' in binary format, using:

[NSKeyedArchiver archiveRootObject:p toFile:@"/Users/mau/Desktop/ 
archiveRoot.plist"];


Reading the object again would be done using:

p = [NSKeyedUnarchiver unarchiveObjectWithFile:@"/Users/mau/ 
Desktop/archiveRoot.plist"];


To set the output format one cannot use the convenience methods above,  
but the following:


NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *a = [[NSKeyedArchiver alloc]  
initForWritingWithMutableData:data];


[a setOutputFormat:NSPropertyListXMLFormat_v1_0];
[a encodeObject:p forKey:@"root"];
[a finishEncoding];
[data writeToFile:@"/Users/mau/Desktop/encodeRoot.plist"  
atomically:YES];

[a release];

The property list editor shows the root object key as "Root", but in  
fact the key is saved as 'root'.


I was unable to unarchieve my objects using 'unarchiveObjectWithFile'  
until I finally created a
hex-dump and figured out that the only difference between the files  
was 'root' versus 'Root':


Did I miss a convenience method to create a compatible XML file?

I did not find the  '[a encodeObject:p forKey:@"root"];' in the  
documentation,

it is based on my investigation.

Regards,
Patrick

PS: Somehow copy & paste from Xcode created this colorful message. I  
hope it is readable.



___

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 [EMAIL PROTECTED]


Re: NSOutlineView problem with Text cells.

2008-12-11 Thread rajesh




On Dec 10, 2008, at 6:09 PM, Arun wrote:


Hi

I have an App in which i use NSOutlineView in the left hand side for
Navigational controls.
The Root and child's have text cells. I am have changed the font  
size for

the texts in the text cells.
are these cells customized ? I mean , Is there any class handling  
there behavior ?
If yes, try setting the attributed properly in it. I guess you can  
find the text alignment methods easily.


After this the text in the cells are not aligned. The leave a lot of  
space

in the bottom and looks as if they were moved up.


May be the height and font size are not in proportion to accommodate  
the font change.


This also happens in the NSTableView.
Is there any way in which i can allign the text to the center of the  
cells


I am not sure of this but it looks something like this  
"NSCenterTextAlignment"



so that the text exactly reside in the center and leaves equal  
spaces w.r.t

the text cell height.

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/rajesh%40vangennep.nl

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-11 Thread Steven Hamilton
Great stuff. Thanks Guys. What I've done is register as an observer of  
the arrangedObjects keypath in my windowDidLoad method. Then when it  
changes I set the correct selectedIncomeEnvelope and remove the  
observer. Job done.


On 09/12/2008, at 9:51 PM, Volker in Lists wrote:


Hi Steven,

as far as I know, the fect happens in the next run loop. So you  
would need to set the selection then. This is possible for example  
via the performSelector:withObject:afterDelay: and a delay of 0.0 on  
self (?).



Cheers,
Volker









Ah, I understand. I've implemented the correct property now but I  
still have the problem of arrangedObjects returning an empty array  
when called in windowDidLoad. So I can't set my property as I have  
nothing to set it with. Any ideas why arrangedObjects would return  
zero? It's like the window and controls and initialised before Core  
Data can return the fetch.

___





___

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 [EMAIL PROTECTED]


Safari Download Security Alerts

2008-12-11 Thread Dave

Hi All,

I have an application that is downloaded from the web by Safari. When  
the user double-clicks on the .dmg file to open the a Warning Dialog  
is displayed. My question is, is there anyway of stopping the dialog  
from appearing? My boss doesn't like it and wants me to look into  
ways of getting rid of it, but I'm not sure where to start!


Thanks in Advance, All the Best Dave
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 [EMAIL PROTECTED]


Re: Core Data warning: to-many relation does not have an inverse

2008-12-11 Thread Ben Trumbull



Consultant.interestingEmployees -- to-many relationship does not
have an inverse: this is an advanced setting (no object can be in
multiple destinations for a specific relationship)

This error doesn't make sense to me. Is it trying to say an object
can only "belong" to one to-many relationship?


It says no object can be in multiple destinations for a specific  
relationship (no inverse relationship, btw, fully modeled  
relationships don't have this issue, because they're fully modeled).   
If you have Department 0->> People (no inverse to many to People) with  
D1 and D2 being department objects and P1 being a Person, you cannot  
have both D1->>{ P1 } and D2->> { P1 }  If Department had several no  
inverse to-many relationships to People, like goodPeople and  
lazyPeople, then P1 could belong once in each across all the  
Department objects.


It means you cannot pretend your no inverse to-many is like a many-to- 
many relationship.  If you try, you'll corrupt your data, and we told  
you not to.  You explicitly failed to model the part we needed to  
verify whether or not your schema is correct, so this was as helpful  
as we could be about your future undefined intentions.


If you sit down and think about how one implements many-to-many  
relationships in a database, it should be clear why this is the case.   
If that didn't make sense, then please, just model the inverse like  
the compiler is suggesting.


"this is an advanced setting" == "if you didn't understand this  
message, you're going the wrong way.  Otherwise, you're probably going  
the wrong way"



The other problem is that I do want to define an inverse for
Employee.company, but I can't set it to *both*
Company.currentEmployees and .previousEmployees. I think the answer is
to maintain the Employee.company relationship field myself without any
inverse, but then I get two more warnings for each of the Company to-
many relationships.


Why are you trying to solve that problem ?  In the obvious case,  
Employee.company needs to be the inverse for currentEmployees because  
it's the current company, and the alternatives semantically don't make  
any sense.  Then, previousEmployees has a separate inverse, if only  
for bookkeeping purposes (e.g. so Core Data maintains everything for  
you)


If you're trying to model companies and employees having an audit  
record all of their previous employments, then you need to do that  
explicitly instead of trying to be too clever.  I'd recommend a many- 
to-many relationship between Employee and Company for "previous  
employers" to match "previous employees".  You could go with  
"lastPreviousEmployer" and make it a one-to-many.



This model was easy to implement in Foundation, I just created a bunch
of Employee objects and just made sure they were in the proper sets
(current/previous/interesting).


... and they were different sets. What you're trying to do is like  
having each of the three sets only retain the object once, and promise  
on the honor system not to hork everything up when any one of the 4  
objects is deallocated.  Naturally, Foundation doesn't let you  
perpetuate such a sin upon NSSet, although you are free to hurt  
yourself like that with CFSet.  We split the difference and give you a  
compiler warning saying we think it's a pretty bad plan for most  
people most of the time.



I also have a Consultant. It has a to-many relationship to
interestingEmployees. Nobody talking to an Employee needs to have
access to the Consultant, so there is no inverse relationship.


It would probably be better to define that kind of logic on the  
Objective-C class (NSManagedObject subclass) for the entity.  You  
could have an inverse to-many in the model, but not expose it as  
public API for your class.  A lot of people forget that the Objective- 
C class doesn't have to resemble the Entity's schema.  Data modeling ! 
= class modeling.  There are things you can do much more efficiently  
with protocols compared to entity inheritance for example.


If you have lots and lots of these objects (many thousands), then you  
might decide the convenience of the automatic book keeping isn't worth  
it, and have a no inverse relationship here.  However, you will have  
to be VERY EXTREMELY careful to fix up these relationships on  
Consultant whenever an Employee is deleted.  You'll probably also need  
to accommodate undo & redo across saves for deleted employees and  
other scenarios.  Depending on usage patterns and deftness of coding  
you may end up wasting more performance cleaning up the Consultants by  
hand.


If you don't have many thousands of objects, then just model the  
inverse and be done with it.  If you have 10^4 or more objects then  
the answer is that it depends, but it's usually easier to start with  
the inverse and get rid of it later if performance data shows it  
problematic.



There's no compelling reason why relationships should necessarily have
an inverse (and there

Re: Safari Download Security Alerts

2008-12-11 Thread rajesh
As far as I know, even the "Apple" supplied applications prompts user   
and annoy him with the warning

It's more of a security check from OS end.

Would be great to know if it can be bypassed...


On Dec 11, 2008, at 11:53 AM, Dave wrote:


Hi All,

I have an application that is downloaded from the web by Safari.  
When the user double-clicks on the .dmg file to open the a Warning  
Dialog is displayed. My question is, is there anyway of stopping the  
dialog from appearing? My boss doesn't like it and wants me to look  
into ways of getting rid of it, but I'm not sure where to start!


Thanks in Advance, All the Best Dave
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/rajesh%40vangennep.nl

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Safari Download Security Alerts

2008-12-11 Thread Andrew Farmer

On 11 Dec 08, at 02:53, Dave wrote:
I have an application that is downloaded from the web by Safari.  
When the user double-clicks on the .dmg file to open the a Warning  
Dialog is displayed. My question is, is there anyway of stopping the  
dialog from appearing? My boss doesn't like it and wants me to look  
into ways of getting rid of it, but I'm not sure where to start!


If you're referring to the error which begins

  The application MyApplication was downloaded from example.com at  
02:53 today...


then no, you can't "get rid of it". This is an intentional security  
feature; any way of avoiding it in a newly downloaded application is a  
bug.


If you'd like to keep it from appearing on upgrades, signing your  
application will have this effect.

___

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 [EMAIL PROTECTED]


Re: Safari Download Security Alerts

2008-12-11 Thread Jeremy Pereira



On 11 Dec 2008, at 10:53, Dave wrote:


Hi All,

I have an application that is downloaded from the web by Safari.  
When the user double-clicks on the .dmg file to open the a Warning  
Dialog is displayed. My question is, is there anyway of stopping the  
dialog from appearing? My boss doesn't like it and wants me to look  
into ways of getting rid of it, but I'm not sure where to start!


I guess you could start by explaining to your boss that it is a  
security feature designed to help prevent users from accidentally  
executing malicious software that they downloaded from the Internet.   
If there was a way for developers (which necessarily includes  
developers of malicious software) to circumvent that feature, it would  
make it about as effective as a chocolate fireguard, but not nearly so  
tasty.





Thanks in Advance, All the Best Dave
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/adc%40jeremyp.net

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?

2008-12-11 Thread Chunk 1978
thanks everyone for the answers.

i agree that Ashley's method is far more readable than using modulus
calculations, so i'll look into that further as i can't seem to get it
working yet.

currently, i have this working using modulus calculations, but it
starts at 00 for the hours and minutes...

-=-=-=-=-
-(int)timeMenuSelection
{
return [[menu selectedItem] tag];
}

- (IBAction)startTimer:(id)sender
{
startTime = [NSDate timeIntervalSinceReferenceDate];

[killTimer invalidate];
[killTimer release];
killTimer = nil;

killTimer = [[NSTimer scheduledTimerWithTimeInterval:30 target:self
selector:@selector(updateTime:) userInfo:nil repeats:YES] retain];
}

- (void)updateTime:(NSTimer *)theTimer
{
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
NSTimeInterval interval = now - startTime;
int second = (int)interval;

//Tag #1 x 3600 Seconds = 3600 Seconds = 2 Hours.
//Tag #2 x 3600 Seconds = 7200 Seconds = 2 Hours.
//Tag #3 x 3600 Seconds = 10800 Seconds = 3 Hours.

int hoursSelected = ([self timeMenuSelection] * 3600);

if (second <= hoursSelected)
{
NSLog(@"%.2d %.2d %.2d ", (hoursSelected-second)/3600,
(hoursSelected*60-second/60)%60, (hoursSelected*3600-second)%60);
}
else
{
NSLog(@"TIME'S UP!");
[killTimer invalidate];
[killTimer release];
killTimer = nil;
}
}
-=-=-=-=-=-

here's a sample output when the first minute of counting down is about
to change:

2008-12-11 07:28:02.028 timerTest[27467:10b] 00 00 04
2008-12-11 07:28:03.028 timerTest[27467:10b] 00 00 03
2008-12-11 07:28:04.028 timerTest[27467:10b] 00 00 02
2008-12-11 07:28:05.028 timerTest[27467:10b] 00 00 01
2008-12-11 07:28:06.028 timerTest[27467:10b] 00 59 00
2008-12-11 07:28:07.028 timerTest[27467:10b] 00 59 59
2008-12-11 07:28:08.028 timerTest[27467:10b] 00 59 58
2008-12-11 07:28:09.028 timerTest[27467:10b] 00 59 57
2008-12-11 07:28:10.028 timerTest[27467:10b] 00 59 56
2008-12-11 07:28:11.029 timerTest[27467:10b] 00 59 55
2008-12-11 07:28:12.028 timerTest[27467:10b] 00 59 54

ideally, it would be nice to have that start at 00 59 00 instead of 00
00 00, otherwise it's adding an additional minute (i think) and won't
look appropriate at the beginning... a user selecting 1 hour will
first read "Time Remaining:  00 Hours 00 Minutes 00 Seconds"



On Thu, Dec 11, 2008 at 12:36 AM, Ashley Clark <[EMAIL PROTECTED]> wrote:
> On Dec 10, 2008, at 8:06 PM, Nick Zitzmann wrote:
>
>> On Dec 10, 2008, at 6:41 PM, Chunk 1978 wrote:
>>
>>> i read in the docs that the use of NSCalandarDate is discouraged
>>> because it's going to be depreciated for OS X 10.6... i'm not really
>>> sure if depreciated means that any code with NSCalandarDate will no
>>> longer function with the new OS or if it will just be considered out
>>> dated...
>>
>>
>> The OP said NSDateComponents, not NSCalendarDate. NSDateComponents will
>> not be deprecated any time soon. And despite what the docs say, I don't
>> think NSCalendarDate is going away soon, because only NSCalendarDate
>> supports encapsulating a time zone within a date.
>>
>> In any case, if you can avoid using NSCalendar/NSDateComponents to make a
>> calendrical calculation, I'd recommend you do so. NSCalendar is quite slow
>> to make even the most basic of calculations, especially on PPC Macs.
>
>
> Certainly in a tight loop it might not be appropriate to use NSCalendar but
> the OP was using them for display in a timer that only fired once a second.
> I'd argue that the NSCalendar/NSDateComponns method calls are more readable
> than modulo arithmetic for most people.
>
> I'd be interested in knowing what kind of performance you saw on PPC Macs
> though that would cause you to write them off in all situations. I've not
> come across that in my testing.
>
>
> Ashley
>
>
___

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 [EMAIL PROTECTED]


Re: Safari Download Security Alerts

2008-12-11 Thread Dave

Hi ,

I did that already! I 99% suspected this would be the answer but had  
to make the effort to find out.


Thanks a lot,
All the Best
Dave

On 11 Dec 2008, at 12:08, Jeremy Pereira wrote:




On 11 Dec 2008, at 10:53, Dave wrote:


Hi All,

I have an application that is downloaded from the web by Safari.  
When the user double-clicks on the .dmg file to open the a Warning  
Dialog is displayed. My question is, is there anyway of stopping  
the dialog from appearing? My boss doesn't like it and wants me to  
look into ways of getting rid of it, but I'm not sure where to start!


I guess you could start by explaining to your boss that it is a  
security feature designed to help prevent users from accidentally  
executing malicious software that they downloaded from the  
Internet.  If there was a way for developers (which necessarily  
includes developers of malicious software) to circumvent that  
feature, it would make it about as effective as a chocolate  
fireguard, but not nearly so tasty.





Thanks in Advance, All the Best Dave
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/adc%40jeremyp.net

This email sent to [EMAIL PROTECTED]





___

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 [EMAIL PROTECTED]


Can't launch a new Window at click of a button

2008-12-11 Thread Shraddha Karwan
Hi,I am a newbie in Cocoa application development on Mac OS X 10.5.4. I just
want to launch a new Window when a button of my main window is clicked. I am
absolutely not able to find a good tutorial to begin with. Also there is no
example named "SimpleMultiWindow" in the /Developer/Examples folder. Is
there any other equivalent example I can follow? Can some one point me to
some useful links to start with.
Thanks in advance.

-- 
Regards,
Shraddha
___

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 [EMAIL PROTECTED]


Re: Can't launch a new Window at click of a button

2008-12-11 Thread rajesh

May be its good to follow a printed material first.
This link got basic some stuff in it,  
http://developer.apple.com/documentation/cocoa/conceptual/objctutorial/01Introduction/chapter_1_section_1.html

~Rajesh
On Dec 11, 2008, at 2:02 PM, Shraddha Karwan wrote:

Hi,I am a newbie in Cocoa application development on Mac OS X  
10.5.4. I just
want to launch a new Window when a button of my main window is  
clicked. I am
absolutely not able to find a good tutorial to begin with. Also  
there is no
example named "SimpleMultiWindow" in the /Developer/Examples folder.  
Is
there any other equivalent example I can follow? Can some one point  
me to

some useful links to start with.
Thanks in advance.

--
Regards,
Shraddha
___

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/rajesh%40vangennep.nl

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Can't launch a new Window at click of a button

2008-12-11 Thread Shraddha Karwan
Thanks for the reply but I have gone through this tutorial, it doesn't talk
about advanced stuff of adding multiple windows and the nib files, file
owners etc in detail.

On Thu, Dec 11, 2008 at 6:48 PM, rajesh <[EMAIL PROTECTED]> wrote:

> May be its good to follow a printed material first.
> This link got basic some stuff in it,
> http://developer.apple.com/documentation/cocoa/conceptual/objctutorial/01Introduction/chapter_1_section_1.html
>
> ~Rajesh
>
>
-- 
Regards,
Shraddha
___

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 [EMAIL PROTECTED]


Resizing an image

2008-12-11 Thread Glenn Bloom
Can anyone recommend a best practice for resizing an image to reduce its
size in terms of both bytes and visible dimensions, retaining the new
smaller image and eliminating the original from memory?  In how I go about
this now, I am concerned about memory and efficiency.

thanks in advance for any help,

Glenn
___

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 [EMAIL PROTECTED]


Re: TIFFRepresentation makes big file!

2008-12-11 Thread Jean-Daniel Dupas



Le 11 déc. 08 à 14:05, Caroline a écrit :


Hello all,
I have some Questions.

1. I try to write NSImage to file.

NSImage *image = [NSImage imageNamed:@"test.png"];
NSBitmapImageRep *imageRep;
imageRep = [[NSBitmapImageRep alloc] initWithData:[image  
TIFFRepresentation]];

NSData *imageData;
imageData = [imageRep representationUsingType:NSPNGFileType  
properties:nil];

[imageData writeToFile:@"result.png" atomically:YES];

I got "result.png".
But!!
"result.png" has diffrent size with "test.png".

When I try to NSLog(@"image info : %@",test.png); and NSLog(@"image  
info : %@",result.png);
Then, test.png (original image) size is {1599.8, 1199.85} and  
result.png size is {1600,1200}.


Why?
Why do they have different file size?
Where is wrong? or TIFFRepresentation rounded up?



NSImage size is not the pixel size, but the screen size. This size is  
computed using image resolution and image pixel size.


According to the original size, I think NSImage use 72.01 ppi for the  
resolution. Converting to TIFF and then back to PNG probably affect  
the resolution and change it to 72.

But the actual image size in pixel does not change.



2. And, Some original/saved files have same width, height size, But  
they have different file size!!
Although 'test.png' and 'result.png' are {1600,1200}, But they have  
500KB(test.png) and 700KB(result.png).
I know the PNG file doesn't compress, so I don't know why they have  
different file size...




What make you think so ?

http://en.wikipedia.org/wiki/Portable_Network_Graphics#Compression



3. Last one,
when I use JPEG file, I have to know the compression of original  
image.

(When I save the new image, compression is needed.)
How can I know/get the compression of JPEG file?


I don't think the compression factor is saved in the file (and I don't  
think it is relevant, as it is compressor dependent).
NSImage does not provide lossless jpeg editing, and you have to  
recompress the file if you change it .
This recompression will alter the image quality whatever your  
compression factor is, and whatever the original factor was.
You should probably either use a default value you choose, or ask the  
use what he want to use (as all compressor 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 [EMAIL PROTECTED]


Re: Safari Download Security Alerts

2008-12-11 Thread Peter Blazejewicz

hi Dave,
that's not Safari unique feature. That's system-wide component.
In your Xcode documentation window type "file quarantine" or navigate  
to Guides>Security>Security Overview>Security Services #File Quarantine


regards,
Peter Blazejewicz

On Dec 11, 2008, at 11:53 AM, Dave wrote:


Hi All,

I have an application that is downloaded from the web by Safari.  
When the user double-clicks on the .dmg file to open the a Warning  
Dialog is displayed. My question is, is there anyway of stopping the  
dialog from appearing? My boss doesn't like it and wants me to look  
into ways of getting rid of it, but I'm not sure where to start!


Thanks in Advance, All the Best Dave
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/peter.blazejewicz%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Wow - what happened to IB

2008-12-11 Thread Ian H Stewart

OK so it has been a long long time since I did anything in IB.
So I started an app like I did at NeXT -  70% of my app is GUI.

I created a new project in xcode, I then got into IB
and created my layout - buttons,
text fields, etc. connected them all together with actions
and defined my outlets, then tried to get the details back
into xcode and found out you can no longer sync from IB to xcode,
but only the other way around.

Am I missing something?

This is one of the 2 complaints I have since the NeXT days.
You should be able to develop in both directions (xcode to IB
and IB to xcode) and Apple needs to bring back the uninstall option  
for Installer.app

like we had in 1993.

Thanks for your patience and any tips!

Ian


___

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 [EMAIL PROTECTED]


TIFFRepresentation makes big file!

2008-12-11 Thread Caroline

Hello all,
I have some Questions.
 
1. I try to write NSImage to file.
 
NSImage *image = [NSImage imageNamed:@"test.png"];
NSBitmapImageRep *imageRep;
imageRep = [[NSBitmapImageRep alloc] initWithData:[image TIFFRepresentation]];
NSData *imageData;
imageData = [imageRep representationUsingType:NSPNGFileType properties:nil];
[imageData writeToFile:@"result.png" atomically:YES];
 
I got "result.png".
But!!
"result.png" has diffrent size with "test.png".
 
When I try to NSLog(@"image info : %@",test.png); and NSLog(@"image info : 
%@",result.png);
Then, test.png (original image) size is {1599.8, 1199.85} and result.png size 
is {1600,1200}.
 
Why?
Why do they have different file size?
Where is wrong? or TIFFRepresentation rounded up?
 
2. And, Some original/saved files have same width, height size, But they have 
different file size!!
 Although 'test.png' and 'result.png' are {1600,1200}, But they have 
500KB(test.png) and 700KB(result.png).
 I know the PNG file doesn't compress, so I don't know why they have different 
file size...
 
 
3. Last one,
 when I use JPEG file, I have to know the compression of original image.
 (When I save the new image, compression is needed.)
 How can I know/get the compression of JPEG file?
 
 
 
Plz let me know.
ThankYou.
___

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 [EMAIL PROTECTED]

Re: Can't launch a new Window at click of a button

2008-12-11 Thread jmunson
I second the printed material.  Search for menu implementations as a  
way to get started.  Also, a book like Hillegass' "Cocoa Programming  
for Mac OS X Third Edition" is a good place to start.


However, for expedience's sake, here's a kick start with but one way  
to open another window from a seperate nib (you will need to know how  
to create a controller class, etc., for the other nib):


In your implementation header file add (near the top, under the imports):

@class MyNextWindowControllerClass;

In the same file, add in your implementation section:

MyNextWindowControllerClass *myNextWindow;

In your implementation file add (under the main imports)
#import ""

In your code that the button will call:

- (IBAction)showMyNextWindow:(id)sender
{
 // myNextWindow nil?
if (!myNextWindow)
{
// create a new needle window
myNextWindow = [[MyNextWindowController alloc] init];
}
// display the window
[myNextWindow showWindow:self];
}

This may not be the absolute best way but it does work.

Do review the calls, etc., as I'm sure you'll have follow-on questions.

Peace, Love, and Light,

/s/ Jon C. Munson II

Quoting Shraddha Karwan <[EMAIL PROTECTED]>:


Thanks for the reply but I have gone through this tutorial, it doesn't talk
about advanced stuff of adding multiple windows and the nib files, file
owners etc in detail.

On Thu, Dec 11, 2008 at 6:48 PM, rajesh <[EMAIL PROTECTED]> wrote:


May be its good to follow a printed material first.
This link got basic some stuff in it,
http://developer.apple.com/documentation/cocoa/conceptual/objctutorial/01Introduction/chapter_1_section_1.html

~Rajesh



--
Regards,
Shraddha
___

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/jmunson%40his.com

This email sent to [EMAIL PROTECTED]





___

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 [EMAIL PROTECTED]


Re: Multithreading and Mach ports

2008-12-11 Thread Nathan Day
NSPort represents both ends of the communication channel you only  
create one NSPort.


On 11/12/2008, at 4:58 AM, John Love wrote:


Reference:

http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/chapter_6_section_5.html#/ 
/apple_ref/doc/uid/1057i-CH16-SW7




While I'm trying to piece your replies together, I have a quick  
question .. reference Listing 5-15 and, in particular, the comment:


// Create and configure the worker thread port.

It appears that the passed (NSPort*)outPort is also the worker, or  
background, thread port.  If true, then are we sending from a  
background port to another background port???


Thanks for this in-between request.

___

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/nathan_day%40mac.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


How to enable horizontal resizing of the NSOutline view with a minimum width?

2008-12-11 Thread Arun
Hi
How to enable horizontal resizing of the NSOutline view with a minimum
width?


any idea?

Thanks
-Arun
___

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 [EMAIL PROTECTED]


Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?

2008-12-11 Thread Chunk 1978
sorry, i meant to say:

ideally, it would be nice to have that start at 00 59 59 instead of 00
00 59.

:)

On Thu, Dec 11, 2008 at 7:32 AM, Chunk 1978 <[EMAIL PROTECTED]> wrote:
> thanks everyone for the answers.
>
> i agree that Ashley's method is far more readable than using modulus
> calculations, so i'll look into that further as i can't seem to get it
> working yet.
>
> currently, i have this working using modulus calculations, but it
> starts at 00 for the hours and minutes...
>
> -=-=-=-=-
> -(int)timeMenuSelection
>{
>return [[menu selectedItem] tag];
>}
>
> - (IBAction)startTimer:(id)sender
>{
>startTime = [NSDate timeIntervalSinceReferenceDate];
>
>[killTimer invalidate];
>[killTimer release];
>killTimer = nil;
>
>killTimer = [[NSTimer scheduledTimerWithTimeInterval:30 target:self
> selector:@selector(updateTime:) userInfo:nil repeats:YES] retain];
>}
>
> - (void)updateTime:(NSTimer *)theTimer
>{
>NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
>NSTimeInterval interval = now - startTime;
>int second = (int)interval;
>
>//Tag #1 x 3600 Seconds = 3600 Seconds = 2 Hours.
>//Tag #2 x 3600 Seconds = 7200 Seconds = 2 Hours.
>//Tag #3 x 3600 Seconds = 10800 Seconds = 3 Hours.
>
>int hoursSelected = ([self timeMenuSelection] * 3600);
>
>if (second <= hoursSelected)
>{
>NSLog(@"%.2d %.2d %.2d ", (hoursSelected-second)/3600,
> (hoursSelected*60-second/60)%60, (hoursSelected*3600-second)%60);
>}
>else
>{
>NSLog(@"TIME'S UP!");
>[killTimer invalidate];
>[killTimer release];
>killTimer = nil;
>}
>}
> -=-=-=-=-=-
>
> here's a sample output when the first minute of counting down is about
> to change:
>
> 2008-12-11 07:28:02.028 timerTest[27467:10b] 00 00 04
> 2008-12-11 07:28:03.028 timerTest[27467:10b] 00 00 03
> 2008-12-11 07:28:04.028 timerTest[27467:10b] 00 00 02
> 2008-12-11 07:28:05.028 timerTest[27467:10b] 00 00 01
> 2008-12-11 07:28:06.028 timerTest[27467:10b] 00 59 00
> 2008-12-11 07:28:07.028 timerTest[27467:10b] 00 59 59
> 2008-12-11 07:28:08.028 timerTest[27467:10b] 00 59 58
> 2008-12-11 07:28:09.028 timerTest[27467:10b] 00 59 57
> 2008-12-11 07:28:10.028 timerTest[27467:10b] 00 59 56
> 2008-12-11 07:28:11.029 timerTest[27467:10b] 00 59 55
> 2008-12-11 07:28:12.028 timerTest[27467:10b] 00 59 54
>
> ideally, it would be nice to have that start at 00 59 00 instead of 00
> 00 00, otherwise it's adding an additional minute (i think) and won't
> look appropriate at the beginning... a user selecting 1 hour will
> first read "Time Remaining:  00 Hours 00 Minutes 00 Seconds"
>
>
>
> On Thu, Dec 11, 2008 at 12:36 AM, Ashley Clark <[EMAIL PROTECTED]> wrote:
>> On Dec 10, 2008, at 8:06 PM, Nick Zitzmann wrote:
>>
>>> On Dec 10, 2008, at 6:41 PM, Chunk 1978 wrote:
>>>
 i read in the docs that the use of NSCalandarDate is discouraged
 because it's going to be depreciated for OS X 10.6... i'm not really
 sure if depreciated means that any code with NSCalandarDate will no
 longer function with the new OS or if it will just be considered out
 dated...
>>>
>>>
>>> The OP said NSDateComponents, not NSCalendarDate. NSDateComponents will
>>> not be deprecated any time soon. And despite what the docs say, I don't
>>> think NSCalendarDate is going away soon, because only NSCalendarDate
>>> supports encapsulating a time zone within a date.
>>>
>>> In any case, if you can avoid using NSCalendar/NSDateComponents to make a
>>> calendrical calculation, I'd recommend you do so. NSCalendar is quite slow
>>> to make even the most basic of calculations, especially on PPC Macs.
>>
>>
>> Certainly in a tight loop it might not be appropriate to use NSCalendar but
>> the OP was using them for display in a timer that only fired once a second.
>> I'd argue that the NSCalendar/NSDateComponns method calls are more readable
>> than modulo arithmetic for most people.
>>
>> I'd be interested in knowing what kind of performance you saw on PPC Macs
>> though that would cause you to write them off in all situations. I've not
>> come across that in my testing.
>>
>>
>> Ashley
>>
>>
>
___

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 [EMAIL PROTECTED]


Re: how to pass arguments by reference

2008-12-11 Thread glenn andreas


On Dec 10, 2008, at 10:11 AM, Mark Woollard wrote:

You can't use passing by reference in C or Objective-C, you can with  
C++ or Objective-C 2.0, for example the following will compile:

// Method using reference
- (int)func:(int&)a;





Note that references aren't fully supported by the lower level runtime  
(though this may have improved).  This includes using @encode on a  
structure that has field that is a reference, and introspection of  
method parameters.  The latter mean that NSInvocation can't be used  
with methods that use references (and since the undo mechanism is  
based around NSInvocation, you can't use methods with invocations with  
the undo manager).


There are/were similar problems with AltiVec/SSE vectors as well (and  
other issues with templates).


Glenn Andreas  [EMAIL PROTECTED]
  wicked fun!
JSXObjC | the easy way to unite JavaScript and Objective C




___

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 [EMAIL PROTECTED]


Re: Wow - what happened to IB

2008-12-11 Thread Timothy Reaves


On Dec 11, 2008, at 7:36 AM, Ian H Stewart wrote:


OK so it has been a long long time since I did anything in IB.
So I started an app like I did at NeXT -  70% of my app is GUI.

I created a new project in xcode, I then got into IB
and created my layout - buttons,
text fields, etc. connected them all together with actions
and defined my outlets, then tried to get the details back
into xcode and found out you can no longer sync from IB to xcode,
but only the other way around.

Am I missing something?

This is one of the 2 complaints I have since the NeXT days.
You should be able to develop in both directions (xcode to IB
and IB to xcode) and Apple needs to bring back the uninstall option  
for Installer.app

like we had in 1993.

Thanks for your patience and any tips!

Ian



	Well, for a starter tip, read the documentation.  It does a decent  
enough job of explaining things.

___

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 [EMAIL PROTECTED]


Tracking down issue; Bad call?

2008-12-11 Thread jmunson

Namaste!

In my app I have the following (a Save Panel call):

[sp beginSheetForDirectory:sDefDir
  file:@""
modalForWindow:[self window]
 modalDelegate:self
didEndSelector:@selector(didEndSaveFileSheet:
  returnCode:contextInfo:)
 contextInfo:nil];


That call then calls this:

- (void)setDownloadPathName:(NSString *)aString
{
 [self willChangeValueForKey:@"mDownloadFolderPath"];
 mDownloadFolderPath = aString;
 [self didChangeValueForKey:@"mDownloadFolderPath"];
}

sDefDir is a class member NSString that is set on awakeFromNIB (set to  
NSHomeDirectory).  I know it has a value because it is used to prior  
to any of this stuff and works fine.  It is only set in awakeFromNIB  
and remains unchanged otherwise.


When I run the program and watch the call, hovering over the variable  
shows me its value is "invalid."  Other runs show it has garbage data.  
 I assume this is why the Save Panel call jumps to where it does,  
although why there I haven't a clue.


'Course this leads to me ask WHY is sDefDir invalid???  What happened  
to it and where did it happen?  I don't have any other place in the  
code that sets sDefDir - only awakeFromNIB.


Anyone have a clue???

Thanks in advance!

Peace, Love, and Light,
/s/ Jon C. Munson II



___

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 [EMAIL PROTECTED]


Re: Wow - what happened to IB

2008-12-11 Thread Jason Stephenson

Ian H Stewart wrote:

I created a new project in xcode, I then got into IB
and created my layout - buttons,
text fields, etc. connected them all together with actions
and defined my outlets, then tried to get the details back
into xcode and found out you can no longer sync from IB to xcode,
but only the other way around.

Am I missing something?


File->Write Class Files...

As Timothy suggested, you might want to check the documentation. The 
basic workflow in Xcode/Interface Builder is the reverse of what you're 
trying to do. These days, you typically write your code in Xcode and IB 
sees the class files automatically, but the reverse is not true.


You can still work the way you want, but its just not as well supported 
as in the past.


Jason
___

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 [EMAIL PROTECTED]


Re: Tracking down issue; Bad call?

2008-12-11 Thread Andy Lee

On Dec 11, 2008, at 10:20 AM, [EMAIL PROTECTED] wrote:
'Course this leads to me ask WHY is sDefDir invalid???  What  
happened to it and where did it happen?  I don't have any other  
place in the code that sets sDefDir - only awakeFromNIB.


Are you retaining it when you set it?  The symptoms sound like you  
aren't.


--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 [EMAIL PROTECTED]


Re: Tracking down issue; Bad call?

2008-12-11 Thread I. Savant
On Thu, Dec 11, 2008 at 10:20 AM,  <[EMAIL PROTECTED]> wrote:
> sDefDir is a class member NSString that is set on awakeFromNIB (set to
> NSHomeDirectory).  I know it has a value because it is used to prior to any
> of this stuff and works fine.  It is only set in awakeFromNIB and remains
> unchanged otherwise.
...
> 'Course this leads to me ask WHY is sDefDir invalid???  What happened to it
> and where did it happen?  I don't have any other place in the code that sets
> sDefDir - only awakeFromNIB.

  How can we know? You never show us where or how you create "sDefDir".

--
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 [EMAIL PROTECTED]


Re: Tracking down issue; Bad call?

2008-12-11 Thread jmunson

Thank you for the reply.

For clarification:

- (void)awakeFromNib
{
 //...

 sDefDir = NSHomeDirectory();
 [sDefDir retain];

 //...

}

I added the retain per a different response and that cleared up my issue.

Knowing about the retain also added some clarity as to how the overall  
system operates too...


Thanks guys!

Peace, Love, and Light,

/s/ Jon C. Munson II

Quoting "I. Savant" <[EMAIL PROTECTED]>:


On Thu, Dec 11, 2008 at 10:20 AM,  <[EMAIL PROTECTED]> wrote:

sDefDir is a class member NSString that is set on awakeFromNIB (set to
NSHomeDirectory).  I know it has a value because it is used to prior to any
of this stuff and works fine.  It is only set in awakeFromNIB and remains
unchanged otherwise.



'Course this leads to me ask WHY is sDefDir invalid???  What happened to it
and where did it happen?  I don't have any other place in the code that sets
sDefDir - only awakeFromNIB.


  How can we know? You never show us where or how you create "sDefDir".

--
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 [EMAIL PROTECTED]


Design for showing ridiculously huge number of images in Table View

2008-12-11 Thread rajesh

Hi All,

I implemented NStableView which contains few "columns" with  
NSImageCells , there are huge number of rows ( for the nightmare )  
images are requested over the network and hence images are never  
readily available.


but part of my framework intimates me whenever an image is downloaded  
and i precisely know for which of the rows  image has been downloaded. 
( so far good ).


I am trying to register an observer in the custom cell class of the  
ImageCell I  mentioned.


So whenever display is requested on the cell , it checks for the image  
in downloads , if it isn't available it draws empty image else it  
places an request and waits for the image.

After image is downloaded observer tries to invoke the drawing again.

This way only cells which are actually in "screen display" get drawn ,  
hence I am supposing there would less traffic and leads to efficient  
drawing.


Is this a right practice ? or completely unethical ?

Thanks
Rajesh

___

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 [EMAIL PROTECTED]


How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Russ

Is there an official Apple-supplied list of which Macs (PPC and Intel) are 
capable of running 64-bit applications? I need something to refer customers to 
so they can verify whether their machine is 64-bit capable or not. Obviously I 
could supply a tiny app to tell them, but it's a bit pointless and politically 
incorrect to have to have a download for this.

So even better, is there a convenient GUI-based way for a user to check this? I 
don't see anything in "About this Mac". Since there are no running 64-bit 
processes by default, I can't tell them to check Activity Monitor. A standard 
app that will always start in 64-bit mode so it can be checked from Application 
Monitor? (These are ordinary users, no Developer Tools or command-line methods).

It's important for this information to be readily available --- it's hard to 
push 64-bit apps if no one can tell if their machine can really run one or not.

Also: how can a customer easily choose to run the 32-bit version of a 32/64 
universal app? This may prove occasionally necessary to accommodate missing 
QTKit functionality.

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 [EMAIL PROTECTED]


Re: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Jean-Daniel Dupas

Le 11 déc. 08 à 18:07, Russ a écrit :



Is there an official Apple-supplied list of which Macs (PPC and  
Intel) are capable of running 64-bit applications? I need something  
to refer customers to so they can verify whether their machine is 64- 
bit capable or not. Obviously I could supply a tiny app to tell  
them, but it's a bit pointless and politically incorrect to have to  
have a download for this.


So even better, is there a convenient GUI-based way for a user to  
check this? I don't see anything in "About this Mac". Since there  
are no running 64-bit processes by default, I can't tell them to  
check Activity Monitor. A standard app that will always start in 64- 
bit mode so it can be checked from Application Monitor? (These are  
ordinary users, no Developer Tools or command-line methods).




IIRC, Chess.app launch as 64bits app in Leopard on 64 bits compatible  
computers.
You can then check in the Activity Monitor to see if this is a 64 bit  
process.


It's important for this information to be readily available --- it's  
hard to push 64-bit apps if no one can tell if their machine can  
really run one or not.


Also: how can a customer easily choose to run the 32-bit version of  
a 32/64 universal app? This may prove occasionally necessary to  
accommodate missing QTKit functionality.


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 [EMAIL PROTECTED]


Re: Design for showing ridiculously huge number of images in Table View

2008-12-11 Thread Jean-Daniel Dupas


Le 11 déc. 08 à 17:55, rajesh a écrit :


Hi All,

I implemented NStableView which contains few "columns" with  
NSImageCells , there are huge number of rows ( for the nightmare )  
images are requested over the network and hence images are never  
readily available.


but part of my framework intimates me whenever an image is  
downloaded and i precisely know for which of the rows  image has  
been downloaded.( so far good ).


I am trying to register an observer in the custom cell class of the  
ImageCell I  mentioned.


So whenever display is requested on the cell , it checks for the  
image in downloads , if it isn't available it draws empty image else  
it places an request and waits for the image.

After image is downloaded observer tries to invoke the drawing again.

This way only cells which are actually in "screen display" get  
drawn , hence I am supposing there would less traffic and leads to  
efficient drawing.


Is this a right practice ? or completely unethical ?

Thanks
Rajesh



Did you try to simply use a table view data source and the built-in  
optimization mechanism before trying to do such complex things ?
For example, NSScrollView, and so NSTableView (which are generally  
embedded in scrollview) only draw the visible part, and ask data  
source only the visible value.


So write a simple data source that returns the image or nothing if it  
is not available in the -getValue method.
And when you receive an image, just call setNeedDisplayInRect: on your  
table view passing the rect of the cell you want to refresh as argument.








___

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 [EMAIL PROTECTED]


Re: efficiency of Xquery vs NSXMLElement attributes

2008-12-11 Thread Michael Ash
On Thu, Dec 11, 2008 at 1:00 AM, Kieren Eaton <[EMAIL PROTECTED]> wrote:
> Hi All
>
> I know there are always several ways to do things and have come across
> something which puzzles me as to
> the efficiency of these 2 ways of getting the same data from an NSXMLNode
> object.
>
> for this exercise assume theNode is an NSXMLNode object which has been
> initialized and contains data and an attribute called class with something
> in it.
>
> Scenario 1
>
> NSXMLElement *nodeAsElement = (NSXMLElement *)theNode;
> NSString *attribContent = [[nodeAsElement attributeForName:@"class"]
> stringValue];
> NSLog(@"class contains %@",attribContent);
>
> Scenario 2
>
> NSString *attribContent = [[theNode objectsForXQuery:@"data(@class)"
> error:nil] objectAtIndex:0];
> NSLog(@"class contains %@",attribContent);
>
> these will and do produce the same data but for my own personal knowledge I
> would like to know which is more efficient.
> I use both in my code but am leaning more towards the xquery style for
> readability and maintainability of larger more nested structures.
>
> Comments appreciated

I'd guess that #1 is going to be faster, simply because #2 has to
parse the string and #1 does not.

However, does it matter? Unless you're doing this over and over again
in a tight loop, it probably doesn't make any difference which one you
use, so go for the one you think is more readable.

If it really does make a difference then you're in a perfect situation
to find out for yourself. Try both, and measure how much time each one
takes, and you will have your answer.

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 [EMAIL PROTECTED]


Re: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Nick Zitzmann


On Dec 11, 2008, at 10:07 AM, Russ wrote:

Is there an official Apple-supplied list of which Macs (PPC and  
Intel) are capable of running 64-bit applications?


No, but I wrote one in a message to this group a while ago. The 64-bit  
capable Macintoshes are:


1. All Xserves, except for the very first model
2. All Power Mac G5s
3. All Mac Pros
4. All MacBooks, except for the first edition
5. All MacBook Pros, except for the first edition
6. All MacBook Airs
7. All iMacs, except for the CRT-based models, "iLamps", and the first  
two Intel-based models

8. All Mac minis starting with the fifth model (mid-2007)
9. All VMware virtual machines running OS X Server in X86-64 mode
10. All unauthorized Hackintoshes with an X86-64 CPU (Core 2 Duo,  
Xeon, Athalon 64, etc.)


Basically, every non-laptop and non-mini released between 2003 and  
2005 is 64-bit, and all Macs made since mid-2007 are 64-bit.


So even better, is there a convenient GUI-based way for a user to  
check this?


Yes; have them get info on /Applications/Chess.app. If a check box  
appears saying "open in 32-bit mode", then they are using a 64-bit Mac.



I don't see anything in "About this Mac".


Well, it does list the CPU type. If the CPU type is Core 2 Duo, Xeon,  
or PowerPC G5, then it's 64-bit.


Since there are no running 64-bit processes by default, I can't tell  
them to check Activity Monitor.


There are four apps that come with Leopard that are 64-bit that I know  
of: Chess, Xcode (which, by default, runs as a 32-bit app), Apache,  
and MySQL (Server only).


Also: how can a customer easily choose to run the 32-bit version of  
a 32/64 universal app? This may prove occasionally necessary to  
accommodate missing QTKit functionality.



Get Info on the app in the Finder. From there, it becomes obvious. :)

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 [EMAIL PROTECTED]


Re: Design for showing ridiculously huge number of images in Table View

2008-12-11 Thread Corbin Dunn


On Dec 11, 2008, at 8:55 AM, rajesh wrote:


Hi All,

I implemented NStableView which contains few "columns" with  
NSImageCells , there are huge number of rows ( for the nightmare )  
images are requested over the network and hence images are never  
readily available.


but part of my framework intimates me whenever an image is  
downloaded and i precisely know for which of the rows  image has  
been downloaded.( so far good ).


I am trying to register an observer in the custom cell class of the  
ImageCell I  mentioned.


So whenever display is requested on the cell , it checks for the  
image in downloads , if it isn't available it draws empty image else  
it places an request and waits for the image.

After image is downloaded observer tries to invoke the drawing again.

This way only cells which are actually in "screen display" get  
drawn , hence I am supposing there would less traffic and leads to  
efficient drawing.


Is this a right practice ? or completely unethical ?


I think it is okay. Some applications watch the scrolling and cancel  
previous requests that are no longer needed.


I strongly recommend implementing the type select delegate methods to  
avoid loading images on cells for type selection.


Also see this demo (I'm going to see how many times I can reference it):



Which does what you want -- except, it loads images in a background  
thread using CG, but the concepts are the same.


corbin


___

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 [EMAIL PROTECTED]


Re: Design for showing ridiculously huge number of images in Table View

2008-12-11 Thread Corbin Dunn


On Dec 11, 2008, at 9:21 AM, Jean-Daniel Dupas wrote:



Le 11 déc. 08 à 17:55, rajesh a écrit :


Hi All,

I implemented NStableView which contains few "columns" with  
NSImageCells , there are huge number of rows ( for the nightmare )  
images are requested over the network and hence images are never  
readily available.


but part of my framework intimates me whenever an image is  
downloaded and i precisely know for which of the rows  image has  
been downloaded.( so far good ).


I am trying to register an observer in the custom cell class of the  
ImageCell I  mentioned.


So whenever display is requested on the cell , it checks for the  
image in downloads , if it isn't available it draws empty image  
else it places an request and waits for the image.

After image is downloaded observer tries to invoke the drawing again.

This way only cells which are actually in "screen display" get  
drawn , hence I am supposing there would less traffic and leads to  
efficient drawing.


Is this a right practice ? or completely unethical ?

Thanks
Rajesh



Did you try to simply use a table view data source and the built-in  
optimization mechanism before trying to do such complex things ?
For example, NSScrollView, and so NSTableView (which are generally  
embedded in scrollview) only draw the visible part, and ask data  
source only the visible value.


So write a simple data source that returns the image or nothing if  
it is not available in the -getValue method.


This will work, and it sounds like what rajesh is proposing.

The disadvantage of this approach is that type selection will attempt  
to load a preparedCellAtColumn:row: -- that includes touching off - 
willDisplayCell and -objectValue, which will cause the datasource to  
unnecessarily load the image.


There are two easy work arounds to avoid that performance problem:
1. Turn off type selection: setAllowsTypeSelect:NO
2. Implement the delegate method:

- (NSString *)tableView:(NSTableView *)tableView  
typeSelectStringForTableColumn:(NSTableColumn *)tableColumn row: 
(NSInteger)row AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;


corbin


___

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 [EMAIL PROTECTED]


Blunt edges to Window

2008-12-11 Thread Arun
Hi,

How to create a blunt corned window edges? Is there any control which will
provide the same?
any idea?

-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 [EMAIL PROTECTED]


Re: Blunt edges to Window

2008-12-11 Thread Volker in Lists

Hi,

do you have an example? A good source for information might be Apple  
Guide to the UI or HIG -> available through your Xcode installations  
documentation.


Cheers,
Volker

Am 11.12.2008 um 18:41 schrieb Arun:


Hi,

How to create a blunt corned window edges? Is there any control  
which will

provide the same?
any idea?

-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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Sherm Pendley

On Dec 11, 2008, at 12:07 PM, Russ wrote:

So even better, is there a convenient GUI-based way for a user to  
check this? I don't see anything in "About this Mac".


Actually - yes. "About this Mac" *will* tell you. If it says "G5" or  
"Core 2", and 10.5.*, it's a 64-bit capable Mac. If it's running any  
earlier OS release, a G3 or G4, or first-generation Core, it's 32-bit  
only.


sherm--

___

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 [EMAIL PROTECTED]


Re: Starting Cocoa apps from the command line

2008-12-11 Thread Shayne Wissler
Thanks for all the varied answers! It sounds like no one actually
knows architecturally what is going on here or why! Is there perhaps
some "dissonance" between the UNIX design aspects and the Apple design
aspects of OSX?

But it sounds like I can hack my way through given your suggestions,
thanks again.


Shayne Wissler

On Wed, Dec 10, 2008 at 2:47 PM, Shayne Wissler <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a Cocoa application that I am compiling in the traditional UNIX
> manner using Makefiles and I want to be able to invoke it with
> command-line arguments and without creating/installing it like
> traditional OSX apps, as in "x.app/Contents/MacOS/x". When I tried the
> usual thing that works on UNIX, compiling to binary and just running
> it, my application got mouse events but no keyboard events, among
> other strange things.
>
> Is there a way to do this without making some kind of wrapper caller
> that generates the directory and a script or some such? Or is it
> wholly frowned upon to do what I'm wanting, and if so, why does it
> half-work rather than fail with a decent error message?
>
>
> Shayne Wissler
>
___

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 [EMAIL PROTECTED]


Re: Blunt edges to Window

2008-12-11 Thread Arun
The example i have in my mind is Finder, iTunes etc.
These have a blunt corned window.


On Thu, Dec 11, 2008 at 11:35 PM, Volker in Lists <[EMAIL PROTECTED]>wrote:

> Hi,
>
> do you have an example? A good source for information might be Apple Guide
> to the UI or HIG -> available through your Xcode installations
> documentation.
>
> Cheers,
> Volker
>
> Am 11.12.2008 um 18:41 schrieb Arun:
>
>  Hi,
>>
>> How to create a blunt corned window edges? Is there any control which will
>> provide the same?
>> any idea?
>>
>> -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/volker_lists%40ecoobs.de
>>
>> This email sent to [EMAIL PROTECTED]
>>
>
>
___

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 [EMAIL PROTECTED]


Re: Starting Cocoa apps from the command line

2008-12-11 Thread Eric Schlegel

Jumping in late here...

It sounds like what you want to create is just a flat-file binary that  
does not use the bundle hierarchy that is typical for a Mac OS X app.  
I.e., you want your app to just be a single file "MyApp" rather than a  
hierarchy "MyApp.app/Contents/MacOS/MyApp". Is that correct?


If so, then the problem is that the process management system on Mac  
OS X, by default, only makes bundled applications capable of receiving  
keyboard focus. By default, unbundled applications are not capable of  
receiving keyboard focus. Normally, this is what you want; if you run  
gcc, you don't want the gcc process to become the foreground app.


However, once your app is launched, you can enable it to receive  
keyboard focus and become the frontmost app by calling the  
TransformProcessType API in the CoreServices Process Manager header:


#include 
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType( &psn, kProcessTransformToForegroundApplication );

-eric

On Dec 11, 2008, at 10:07 AM, Shayne Wissler wrote:


Thanks for all the varied answers! It sounds like no one actually
knows architecturally what is going on here or why! Is there perhaps
some "dissonance" between the UNIX design aspects and the Apple design
aspects of OSX?

But it sounds like I can hack my way through given your suggestions,
thanks again.


Shayne Wissler

On Wed, Dec 10, 2008 at 2:47 PM, Shayne Wissler <[EMAIL PROTECTED]>  
wrote:

Hello,

I have a Cocoa application that I am compiling in the traditional  
UNIX

manner using Makefiles and I want to be able to invoke it with
command-line arguments and without creating/installing it like
traditional OSX apps, as in "x.app/Contents/MacOS/x". When I tried  
the

usual thing that works on UNIX, compiling to binary and just running
it, my application got mouse events but no keyboard events, among
other strange things.

Is there a way to do this without making some kind of wrapper caller
that generates the directory and a script or some such? Or is it
wholly frowned upon to do what I'm wanting, and if so, why does it
half-work rather than fail with a decent error message?


Shayne Wissler


___

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/ericsc%40apple.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Starting Cocoa apps from the command line

2008-12-11 Thread Bill Bumgarner

On Dec 11, 2008, at 10:07 AM, Shayne Wissler wrote:

Thanks for all the varied answers! It sounds like no one actually
knows architecturally what is going on here or why! Is there perhaps
some "dissonance" between the UNIX design aspects and the Apple design
aspects of OSX?


Actually I'd wager that no one has directly answered your question  
because you haven't told us what you are trying to do.   The answers  
you receiver were correct and equally as vague as your question.



I have a Cocoa application that I am compiling in the traditional UNIX
manner using Makefiles and I want to be able to invoke it with
command-line arguments and without creating/installing it like
traditional OSX apps, as in "x.app/Contents/MacOS/x".


If your makefile is constructing a .app wrapper with the binary and  
Info.plist located in the correct spots and containing the correct  
contents, then it should just work.


There is absolutely nothing proprietary or secret about how Xcode  
builds projects other than the projects and build system are optimized  
to building Cooca applications;  you can do the same thing from  
makefiles, shell scripts, or manually, if re-inventing that wheel is  
required (and it sometimes is!).



When I tried the
usual thing that works on UNIX, compiling to binary and just running
it, my application got mouse events but no keyboard events, among
other strange things.


That indicates that you didn't build your app wrapper correctly.   
Either you didn't correctly set up the Info.plist or your application,  
itself, isn't starting up the GUI bits correctly.


Or maybe you are trying to eliminate the .app part.  Definitely  
neither supported nor encouraged, but it can be done.


In any case, you didn't provide enough information for anyone to  
answer a question with architectural specifics.



Is there a way to do this without making some kind of wrapper caller
that generates the directory and a script or some such? Or is it
wholly frowned upon to do what I'm wanting, and if so, why does it
half-work rather than fail with a decent error message?


There is -- see Eric's followup for a clue -- but is wholly frowned  
upon and will lead to a non-standard user experience.


Without knowing what you have done, it is hard to tell why it half- 
works.


You can either post more details about what you have done and continue  
down this path.


Or you could give a bit of information about what you are trying to do  
and see if someone might suggest a path that is a bit more standard  
and, subsequently, considerably easier.


In Cocoa, if something seems absurdly hard to do, it is most likely  
because the something is wrong.


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 [EMAIL PROTECTED]


Re: Blunt edges to Window

2008-12-11 Thread Stéphane Sudre


On Dec 11, 2008, at 7:12 PM, Arun wrote:


The example i have in my mind is Finder, iTunes etc.
These have a blunt corned window.


There's an API in the AppKit (NSWindow) to have rounded or square  
corners.


Is this what you're referring to?

___

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


[SOLVED] Re: NSTextField setStringValue not updating properly

2008-12-11 Thread jmunson
I am posting this for the benefit of those who are coming into this  
area as new folk.  Thanks to anyone who provided help.  This is a  
short description of how I solved my issue and not meant to be a  
tutorial of any kind.


After staring at it for multitudes of hours, I decided a different  
approach was necessary.


What I ended up doing was implementing KVC and KVO for the variable  
with which I was experiencing trouble.  This is (at least) done by  
creating a property, or by implementing the getter(s)/setter(s) w/ the  
appropriate key-value observing structure.


There are probably a number of examples out there.  Hillegass  
demonstrates that in his book (I keep touting it - it's good).


I bound the textfield's value to the member of the class that was  
used.  That addressed the issue of keeping the textfield up-to-date  
with the value of the variable as required.


I did, however, run into another issue:  the run loop.

Coming from the VB world, I hadn't really needed any sort of variables  
(extremely rarely, if ever) that "hung around."  Most everything I did  
there stuck by nature of the beast (depending upon where it was  
declared).


Here, however, one has to deal with "the run loop."  I may not have a  
complete understanding of it, however, the part that matters for this  
thread is that given a set of code it will only execute that code once  
and only on the information it has at the time of execution.  Thus, if  
you need to pass data from one execution loop to another (think  
callback), it needs to persist.  That's done either through the  
keyword static or, in the case of an NSObject of some kind, retain.


In summary, changing over to KVC w/ KVO plus the retention factor  
fixed my issues.  So, if you are having trouble with setStringValue,  
make sure you are going the KVC w/ KVO route & check your bindings.


Peace, Love, and Light,

/s/ Jon C. Munson II

___

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: Starting Cocoa apps from the command line

2008-12-11 Thread Shayne Wissler
On Thu, Dec 11, 2008 at 11:18 AM, Eric Schlegel  wrote:
> Jumping in late here...
>
> It sounds like what you want to create is just a flat-file binary that does
> not use the bundle hierarchy that is typical for a Mac OS X app. I.e., you
> want your app to just be a single file "MyApp" rather than a hierarchy
> "MyApp.app/Contents/MacOS/MyApp". Is that correct?

Yes, that is exactly what I want, and your solution worked brilliantly! Thanks!

Can you perhaps suggest a book from which I would have learned this
and other architectural nuances of systems programming on the Mac?


Shayne
___

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: Starting Cocoa apps from the command line

2008-12-11 Thread Shayne Wissler
Hi Bill,

I've got an application that isn't specifically for the Mac, and I
want the same standard user-experience whether they are on the Mac or
on Windows or on Linux. I want them to be able to run this program
from the command line by directly using the binary (without calling
"open"), to have it print messages to their terminal (something open
doesn't do), etc. Just like an X application would work on Linux. I
don't want for it to be required to have a .app directory with plists
or nibs or anything other than just my binary.


Shayne

On Thu, Dec 11, 2008 at 11:22 AM, Bill Bumgarner  wrote:
>> Is there a way to do this without making some kind of wrapper caller
>> that generates the directory and a script or some such? Or is it
>> wholly frowned upon to do what I'm wanting, and if so, why does it
>> half-work rather than fail with a decent error message?
>
> There is -- see Eric's followup for a clue -- but is wholly frowned upon and
> will lead to a non-standard user experience.
>
> Without knowing what you have done, it is hard to tell why it half-works.
>
> You can either post more details about what you have done and continue down
> this path.
>
> Or you could give a bit of information about what you are trying to do and
> see if someone might suggest a path that is a bit more standard and,
> subsequently, considerably easier.
>
> In Cocoa, if something seems absurdly hard to do, it is most likely because
> the something is wrong.
>
> 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: Starting Cocoa apps from the command line

2008-12-11 Thread Bruce Martin
If it has an interface then I would suggest following the HIG. However  
it sounds like you have a tool for the commandline and there is an  
option to create that in Xcode, AFAIK.


Bruce Martin
The Martin Solution
br...@martinsolution.com
http://www.martinsolution.com
http://externals.martinsolution.com

On Dec 11, 2008, at 1:42 PM, Shayne Wissler wrote:


Hi Bill,

I've got an application that isn't specifically for the Mac, and I
want the same standard user-experience whether they are on the Mac or
on Windows or on Linux. I want them to be able to run this program
from the command line by directly using the binary (without calling
"open"), to have it print messages to their terminal (something open
doesn't do), etc. Just like an X application would work on Linux. I
don't want for it to be required to have a .app directory with plists
or nibs or anything other than just my binary.


Shayne

On Thu, Dec 11, 2008 at 11:22 AM, Bill Bumgarner  wrote:

Is there a way to do this without making some kind of wrapper caller
that generates the directory and a script or some such? Or is it
wholly frowned upon to do what I'm wanting, and if so, why does it
half-work rather than fail with a decent error message?


There is -- see Eric's followup for a clue -- but is wholly frowned  
upon and

will lead to a non-standard user experience.

Without knowing what you have done, it is hard to tell why it half- 
works.


You can either post more details about what you have done and  
continue down

this path.

Or you could give a bit of information about what you are trying to  
do and

see if someone might suggest a path that is a bit more standard and,
subsequently, considerably easier.

In Cocoa, if something seems absurdly hard to do, it is most likely  
because

the something is wrong.

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/bmartin%40mac.com

This email sent to bmar...@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: Starting Cocoa apps from the command line

2008-12-11 Thread Jason Stephenson

Shayne Wissler wrote:


I've got an application that isn't specifically for the Mac, and I
want the same standard user-experience whether they are on the Mac or
on Windows or on Linux. I want them to be able to run this program
from the command line by directly using the binary (without calling
"open"), to have it print messages to their terminal (something open
doesn't do), etc. Just like an X application would work on Linux. I
don't want for it to be required to have a .app directory with plists
or nibs or anything other than just my binary.


It may or may not be perfectly legitimate for you to want to do that, 
and I don't intend to debate that with you.


However, speaking as someone who works on/with several cross platform, 
F/OSS projects on Mac OS X, I can assure you that what you are trying to 
do is not what any of the others do. Most projects attempt to look and 
to work as much like a native application as possible, including having 
nibs, plists, app bundles, etc.


If you want your Mac OS X version to work like a X application, then 
make X a requirement for the Mac OS X version. There you will get the 
exact interface, etc., that you expect and you won't shock your users 
who may be more accustomed to Mac OS X applications.


NOTE: I say the above knowing absolutely nothing about your user base.

Jason
___

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: Starting Cocoa apps from the command line

2008-12-11 Thread Sherm Pendley

On Dec 11, 2008, at 1:35 PM, Shayne Wissler wrote:

On Thu, Dec 11, 2008 at 11:18 AM, Eric Schlegel   
wrote:

Jumping in late here...

It sounds like what you want to create is just a flat-file binary  
that does
not use the bundle hierarchy that is typical for a Mac OS X app.  
I.e., you
want your app to just be a single file "MyApp" rather than a  
hierarchy

"MyApp.app/Contents/MacOS/MyApp". Is that correct?


Yes, that is exactly what I want


May I ask *why* you want that? It's not what your users - assuming  
they're familiar with Macs - will expect. If you want to provide a  
command-line tool along with your app, there are better (i.e. more Mac- 
like) ways to accomplish that goal, than the one you're proposing.


Case in point - BBEdit. It's a normal .app bundle in all respects, but  
it *also* comes with a command-line tool that's a non-bundled  
executable that uses /usr/bin/open to launch the app.


sherm--

___

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: Starting Cocoa apps from the command line

2008-12-11 Thread Eric Schlegel


On Dec 11, 2008, at 10:35 AM, Shayne Wissler wrote:

Yes, that is exactly what I want, and your solution worked  
brilliantly! Thanks!


Great!


Can you perhaps suggest a book from which I would have learned this
and other architectural nuances of systems programming on the Mac?


I can't, partly because I haven't done an exhaustive survey of all  
programming books on Mac OS X topics. But mostly because this is an  
uncommon case, and as Bill says, the standard approach is to create a  
bundled application, so there's probably little discussion of this  
case, which is relatively rare.


Although not so rare that it hasn't been discussed multiple times on  
both the Carbon and Cocoa programming lists; you're not the first  
person to run into this, and it's a fairly common desire especially  
for authors of scripting language runtimes who might want to be able  
to run a script from the command line that becomes a UI-capable  
application later.


You could certainly file a bug with Apple asking for explicit  
documentation about this usage case.


-eric

___

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: [SOLVED] Re: NSTextField setStringValue not updating properly

2008-12-11 Thread mmalc Crawford

For the benefit of others with the same issue:


On Dec 10, 2008, at 8:31 AM, jmun...@his.com wrote:
Anytime the value for the text field needs to change, I call  
[NSTextField setStringValue:(NSString *)aString].
After searching through the message archives, I either find bound  
fields or something else.  The messages that address stuff close  
this stipulate using the above call.
I have also tried validateEditing and display, both to no avail.  I  
can't seem to locate another viable method to get the data stored  
(like a "refresh").
What appears to happen (in terms as best I can describe it, not  
necessarily technically correct) is that the text is written to the  
control's view, but, isn't saved to the underlying data structure.


Assuming that you're using bindings, the problem is described and  
answered in the troubleshooting article here:





"Changing the value in the user interface programmatically is not  
reflected in the model
If you change the value of an item in the user interface  
programmatically, for example sending an NSTextField a setStringValue:  
message, the model is not updated with the new value.


This is the expected behavior. Instead you should change the model  
object using a key-value-observing compliant manner."




If you're not using bindings, then the same general point applies --  
simply updating a view does not cause the change to be propagated to  
the underlying model object; you have to do that yourself.



On Dec 11, 2008, at 10:28 AM, jmun...@his.com wrote:

What I ended up doing was implementing KVC and KVO for the variable  
with which I was experiencing trouble.  This is (at least) done by  
creating a property, or by implementing the getter(s)/setter(s) w/  
the appropriate key-value observing structure.


In general, you should not have to "implement KVC and KVO" for  
properties, you should simply adhere to appropriate KVC naming  
conventions and use the automatic KVO support you then get for free:


	
	
		



I bound the textfield's value to the member of the class that was  
used.  That addressed the issue of keeping the textfield up-to-date  
with the value of the variable as required.

I did, however, run into another issue:  the run loop.
Coming from the VB world, I hadn't really needed any sort of  
variables (extremely rarely, if ever) that "hung around."  Most  
everything I did there stuck by nature of the beast (depending upon  
where it was declared).
Here, however, one has to deal with "the run loop."  I may not have  
a complete understanding of it, however, the part that matters for  
this thread is that given a set of code it will only execute that  
code once and only on the information it has at the time of  
execution.  Thus, if you need to pass data from one execution loop  
to another (think callback), it needs to persist.  That's done  
either through the keyword static or, in the case of an NSObject of  
some kind, retain.


This is so vague and misleading it's difficult to frame a response  
beyond simply:
If you're using Cocoa, you should adhere to the basic memory  
management rules as given in this document:


	

and summarised in this article:
	


To understand where the run loop fits in to this, see:
	


In particular, if you need to maintain instance variables, don't  
sprinkle your code with retain and release, but instead adhere to the  
advice given here:
	

see "Using Accessor Methods"


This is all fundamental, basic, required reading for any Cocoa  
developer.



In summary, changing over to KVC w/ KVO plus the retention factor  
fixed my issues.  So, if you are having trouble with setStringValue,  
make sure you are going the KVC w/ KVO route & check your bindings.


If you are having trouble with setStringValue:, and you're using  
bindings, then per the Troubleshooting Guide you're almost certainly  
doing the wrong thing.  The answer is *not* to diddle with anything to  
do with "KVC/KVO", but to instead Do the Right Thing: use the  
technology the way it was designed -- change the model value, and  
allow that to propagate to the UI.


mmalc



__

Re: Starting Cocoa apps from the command line

2008-12-11 Thread Shayne Wissler
On Thu, Dec 11, 2008 at 11:55 AM, Eric Schlegel  wrote:

>> Can you perhaps suggest a book from which I would have learned this
>> and other architectural nuances of systems programming on the Mac?
>
> I can't, partly because I haven't done an exhaustive survey of all
> programming books on Mac OS X topics. But mostly because this is an uncommon
> case, and as Bill says, the standard approach is to create a bundled
> application, so there's probably little discussion of this case, which is
> relatively rare.

Maybe you should write the book! A comprehensive "internals"-type book
would probably be popular.

> Although not so rare that it hasn't been discussed multiple times on both
> the Carbon and Cocoa programming lists; you're not the first person to run
> into this, and it's a fairly common desire especially for authors of
> scripting language runtimes who might want to be able to run a script from
> the command line that becomes a UI-capable application later.

Heh, you nailed me. That's precisely what I have.

Thanks again!


Shayne
___

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: Starting Cocoa apps from the command line

2008-12-11 Thread Sherm Pendley

On Dec 11, 2008, at 1:42 PM, Shayne Wissler wrote:


Just like an X application would work on Linux. I
don't want for it to be required to have a .app directory with plists
or nibs or anything other than just my binary.


If you want something that looks and acts like an X11 app, why bother  
porting to Cocoa at all? Macs can run X11 apps quite well, and Xcode  
includes all of the headers and libraries required to build them.


sherm--

___

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: Starting Cocoa apps from the command line

2008-12-11 Thread Shayne Wissler
On Thu, Dec 11, 2008 at 12:03 PM, Sherm Pendley  wrote:
> On Dec 11, 2008, at 1:42 PM, Shayne Wissler wrote:
>
>> Just like an X application would work on Linux. I
>> don't want for it to be required to have a .app directory with plists
>> or nibs or anything other than just my binary.
>
> If you want something that looks and acts like an X11 app, why bother
> porting to Cocoa at all? Macs can run X11 apps quite well, and Xcode
> includes all of the headers and libraries required to build them.

1. Fullscreen mode for X is apparently broken on OSX.

2. I ran into apparent bugs in the OSX implementation of X when using
threads and OpenGL. I figured being on a more widely used platform
(Cocoa) would mean it was more stable/usable, so far that looks to be
true.

3. I didn't want an extra layer between me and the native OS, why have
the overhead of the X server if I don't need to?

4. My application might evolve to *support* behaving like a standard
Cocoa app without requiring it to, so Cocoa is a better foundation for
my OSX port.


Shayne Wissler
___

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


Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Gustavo Pizano
Well not that you mentioned, I was reading about the 64bit changes  
that OS X and Cocoa api has, and how to convert my current 32 bit app  
to 64 bit app.
In an apple doc I read that mos of leopard app doesn't need to convert  
to 64 bit architecture, but later on the document its says something  
like, that in the future  the apps should take advantage of the new 64  
bit api and frameworks, or that what I understood, so, I was  
wondering, if Im starting a new app (small one), should I build it for  
a 64 bit architecture or no?, if so what should I take care of?,  
instead of using int use NSInteger or NSUInteger, alos instead of  
float use CGFloat, take care of the way I encode and decode ? I guess  
im missing lots,  and what else should I change the build target to be  
64 bit architecture?


any guidance? or should I just "let it be, let it be"


Gus



On 11.12.2008, at 19:08, Sherm Pendley wrote:


On Dec 11, 2008, at 12:07 PM, Russ wrote:

So even better, is there a convenient GUI-based way for a user to  
check this? I don't see anything in "About this Mac".


Actually - yes. "About this Mac" *will* tell you. If it says "G5" or  
"Core 2", and 10.5.*, it's a 64-bit capable Mac. If it's running any  
earlier OS release, a G3 or G4, or first-generation Core, it's 32- 
bit only.


sherm--

___

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/gustavxcodepicora%40gmail.com

This email sent to gustavxcodepic...@gmail.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: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?

2008-12-11 Thread Ashley Clark

On Dec 11, 2008, at 6:32 AM, Chunk 1978 wrote:


thanks everyone for the answers.

i agree that Ashley's method is far more readable than using modulus
calculations, so i'll look into that further as i can't seem to get it
working yet.

currently, i have this working using modulus calculations, but it
starts at 00 for the hours and minutes...


/* snip */


- (void)updateTime:(NSTimer *)theTimer
{
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
NSTimeInterval interval = now - startTime;

//Tag #1 x 3600 Seconds = 3600 Seconds = 2 Hours.
//Tag #2 x 3600 Seconds = 7200 Seconds = 2 Hours.
//Tag #3 x 3600 Seconds = 10800 Seconds = 3 Hours.

int hoursSelected = ([self timeMenuSelection] * 3600);


NSTimeInterval remaining = hoursSelected - second;

if (remaining >= 0)
{
int hours = remaining / 3600;
int minutes = (remaining / 60) % 60;
int seconds = remaining % 60;

NSLog(@"%.2d %.2d %.2d ", hours, minutes, seconds);


}
else
{
NSLog(@"TIME'S UP!");
[killTimer invalidate];
[killTimer release];
killTimer = nil;
}
}

___

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: Resizing an image

2008-12-11 Thread Steve Christensen

On Dec 11, 2008, at 5:43 AM, Glenn Bloom wrote:

Can anyone recommend a best practice for resizing an image to  
reduce its

size in terms of both bytes and visible dimensions, retaining the new
smaller image and eliminating the original from memory?  In how I  
go about

this now, I am concerned about memory and efficiency.


How about something like this?

NSImage* oldImage = GetSomeImage(...);
NSSize   newSize = GetDesiredNewSize(oldImage, ...);

NSImage* newImage = [[NSImage alloc] initWithSize:newSize];

[newImage lockFocus];
[oldImage drawInRect:NSMakeRect(0, 0, newSize.width, newSize.height)
fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
[newImage unlockFocus];

[oldImage release];


And depending on how important the resized image quality is, you may  
also want to do the following just before the drawInRect call:


[[NSGraphicsContext currentContext]  
setImageInterpolation:NSImageInterpolationHigh];


___

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: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Sherm Pendley

On Dec 11, 2008, at 2:16 PM, Gustavo Pizano wrote:

In an apple doc I read that mos of leopard app doesn't need to  
convert to 64 bit architecture, but later on the document its says  
something like, that in the future  the apps should take advantage  
of the new 64 bit api and frameworks, or that what I understood, so,  
I was wondering, if Im starting a new app (small one), should I  
build it for a 64 bit architecture or no?


I wouldn't want to build *exclusively* for 64-bit at this point -  
there's still a lot of 1st-generation Core Macs out there, and even  
some G4s, as well as some machines running Tiger. So IMHO it seems a  
little premature to go 32-bit only.


That said, it's not an all-or-nothing proposal. Universal binaries can  
include both 32- and 64-bit binaries. For a smooth transition, you  
could start supporting 64-bit right now, without necessarily having to  
require it. Eventually, the time will come when it's appropriate to  
drop support for 32-bit machines and OS versions.


, if so what should I take care of?, instead of using int use  
NSInteger or NSUInteger, alos instead of float use CGFloat, take  
care of the way I encode and decode ? I guess im missing lots,  and  
what else should I change the build target to be 64 bit architecture?


any guidance?


As usual, Apple's own docs are a good place to start:





or should I just "let it be, let it be"


Great song. :-)

sherm--


___

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: How to detect a paste request for file copy/paste?

2008-12-11 Thread Ling Li
Thanks for help. I tried that but still not work. Actually what you said is 
right with DnD. In my code the promised drag works perfectly well, but this is 
for file copy/paste :) What is want is that if user click 'paste' in Finder, my 
app should get notice with destination directory and start file copy (like 
promised drag did). Can I call dragPromisedFilesOfTypes for copy/paste instead 
of DnD? I think dragPromisedFilesOfTypes  just start a promised drag, not put 
something into general pasteboard. Or OSX does not support promised paste at 
all?

Ling

> -Original Message-
> From: cocoa-dev-bounces+lingli=vmware@lists.apple.com 
> [mailto:cocoa-dev-bounces+lingli=vmware@lists.apple.com] 
> On Behalf Of Conor
> Sent: Wednesday, December 10, 2008 1:42 AM
> To: cocoa-dev@lists.apple.com
> Subject: Re: How to detect a paste request for file copy/paste?
> 
> You still need to give the pasteboard an array of the file 
> type for NSFilesPromisePboardType. Your missing the line:
> 
> [pboard setPropertyList:[NSArray arrayWithObjects:@"txt", 
> nil] forType:NSFilesPromisePboardType];
> 
> But I would recommend initiating the promised drag with the NSView's
> method:
> 
> - (BOOL)dragPromisedFilesOfTypes:(NSArray *)typeArray fromRect: 
> (NSRect)aRect source:(id)sourceObjectslideBack:(BOOL)slideBack event: 
> (NSEvent *)theEvent;
> 
> file:///Developer/Documentation/DocSets/com.apple.ADC_Referenc
> e_Library.CoreReference.docset/Contents/Resources/Documents/do
> cumentation/Cocoa/Conceptual/DragandDrop/Tasks/DraggingFiles.html
> 
> Conor
> http://www.bruji.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/lingli%40vmware.com
> 
> This email sent to lin...@vmware.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: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Nick Zitzmann


On Dec 11, 2008, at 12:16 PM, Gustavo Pizano wrote:

if Im starting a new app (small one), should I build it for a 64 bit  
architecture or no?, if so what should I take care of?,


It's a mixed bag. We've released one 64-bit app (iClipboard), so I can  
speak from some experience here.


The benefit of using 64-bit now is it will greatly increase the  
scalability of your app. If your app has the potential to manipulate  
and store very large files (hundreds of megabytes or larger), and  
streaming is not an option, then your app will greatly benefit from  
being 64-bit. It will also make it slightly faster on X86-64 due to  
improvements in the CPU architecture (e.g. arguments will no longer be  
placed on the stack 99% of the time).


But there are a few drawbacks:

1. The 32-bit frameworks have been around for more than a decade and  
are quite stable. The 64-bit frameworks have been around for only a  
year and a half, and have had interesting bugs. Some of them have been  
fixed in point releases, but every now and then, someone comes here  
talking about something odd happening in their 64-bit app that doesn't  
happen in their 32-bit app.


2. Because there are very, very few shipping 64-bit apps for Mac OS X  
right now, some users who watch Activity Monitor like a hawk see that  
the app uses 1.7 GB of VRAM on launch (33-34 GB if GC is on) and freak  
out, thinking there's a big memory leak and the app is wasting their  
hard disk space. This is because some people don't understand that VM ! 
= swap, but they used to be the same thing in Mac OS 7-9, so it's  
confusing. Anyway, there does seem to be public reluctance to adopt 64- 
bit apps.


3. It's been more than a year since Leopard has been released, and  
there still are a lot of frameworks out there that are closed-source  
and 32-bit only.


4. Not everything is available to 64-bit frameworks, but the majority  
of that stuff is stuff that is deprecated and shouldn't be used  
anymore (ATSUI, QuickDraw, FSSpec, HIToolbox, etc.). Still, this makes  
porting old code rather painful. Microsoft and Adobe in particular got  
screwed over the removal of HIToolbox.


Issues #1 and #2 will go away in the coming months, but they're  
something to keep in mind.


And I wouldn't build for 64-bit exclusively, unless you are developing  
an in-house app only, or you are doing something that absolutely  
cannot be done in a 32-bit space. There are still many first edition  
MacBook users out there who would not appreciate you doing that.


instead of using int use NSInteger or NSUInteger, alos instead of  
float use CGFloat, take care of the way I encode and decode ? I  
guess im missing lots,  and what else should I change the build  
target to be 64 bit architecture?


Yes. Even if you're not going to go 64-bit now, I would strongly  
recommend you at least get your code ready for it, because there will  
be a day when the i386 architecture gets deprecated. That means  
switching ints to NSIntegers, getting rid of FSSpec, etc.


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


Text layout responsibility

2008-12-11 Thread Rimas
Hello list,

I have performed quick search through  the list and couldn't find
answer to my question.

I am trying to implement editable text view which changes text
position (paragraphs positions, to be exact) according to the some
text attributes. I know, that NSTextContainer is responsible for line
rects calculation when text should be placed in known shape. Is it
responsible for this when position depends on text attributes also?
Reason I am asking is that in method
lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:
I do not have any information about glyphs or characters range to be
placed in proposed rect, only rect coordinates. Should I do this
manually by accessing container -> text view -> text storage? Maybe
NSLayoutManager or NSTypeSetter subclass would be better choice?

Another thing I'd like to ask, is where should I adjust text view/text
container size if this is necessary while typing? I have tried to do
this after getting NSTextStorageDidProcessEditingNotification
notification. But that raises an exception:

>> Exception raised during posting of notification.  Ignored.  exception: '*** 
>> NSRunStorage, _NSBlockNumberForIndex(): index (0) beyond array bounds (0)'  
>> invoked observer method: '*** -[MyTestController 
>> _TextStorageContentChanged:]'  observer: 0x14d60b10  notification name: 
>> 'NSTextStorageDidProcessEditingNotification'  <<

Any help is very appreciate.

Regards,
Rimas M.
___

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


Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Randall Meadows
Still fighting with the table view custom cell...sorry for the length  
of this, I'm trying to include as much info as I can to help you help  
me figure this out.


I have subclassed NSTextFieldCell (NSTFC) so that I can do custom  
drawing in my table cells (basically multiple text strings within the  
cell).  My datasource object maintains an NSMutableArray, which gets  
populated each time the user selects a something in the rest of the UI.


-numberOfRowsInTableView: simply returns the number of objects in the  
array.


-tableView:objectValueForTableColumn:tableColumn:row: simply returns  
the object at index "row" of the table.


In -tableView:willDisplayCell:aCellforTableColumn:aTableColumn:row:, I  
set a couple of instance variables in my NSTFC subclass using  
properties that are set to (readwrite, retain), so they are available  
in the -drawInteriorWithFrame:inView: method, such as 	 
aCell.cellObject = [tableValues objectAtIndex:rowIndex];.



I have implemented -copyWithZone in my NSTFC subclass as such:

- (id)copyWithZone:(NSZone *)zone
{
   MyTableCell  *copy = [super copyWithZone:zone];
   copy.cellObject = [self.cellObject copy];
   copy.gridController = [self.ViewController copy];

   return copy;
}

All the rows fit into the visible area of the table (no scrolling).

Everything fine so far?

I can get it to crash by selecting a third row of the table.  First  
selection, OK; 2nd selection, OK; 3rd selection, boom:


-[GFController release]: message sent to deallocated instance 0x16d97890

Doesn't happen if I select row 1, then 2, and then 1 again; it has to  
be 3 different rows.


Here's the stack trace:

#0  0x94568907 in ___forwarding___
#1  0x94568a12 in __forwarding_prep_0___
#2  0x938c320f in NSPopAutoreleasePool
#3  0x95dc7b8c in -[NSApplication run]

I can also get it to crash with this message: "[GFController name]:  
message sent to deallocated instance" simply by resizing the window.   
This crash happens in my -tableView:heightOfRow: delegate method.


I have NSZombieEnabled turned on.  I'm obviously over-releasing  
something, but I've added in a bunch of retains trying to create a  
leak, but I'm still stuck with this zombie.


Anyone got any more tips on how to track this down?  (I thought I  
recalled seeing a pretty good tutorial on how to use NSZombieEnabled  
and friends and get a stack trace of where the zombie instance came  
from, but now I can't find it.  I thought it was part of TN2124, but I  
don't see it in there now.  For instance, if I turn on  
MallocStackLogging, how then do I get the malloc trace?)


Thanks!
randy
___

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: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Nick Zitzmann


On Dec 11, 2008, at 1:15 PM, Nick Zitzmann wrote:


But there are a few drawbacks:



I missed a spot:

5. Good luck trying to debug 64-bit apps. As of Xcode 3.1.2, the  
debugger often fails to respond to commands correctly when a 64-bit  
app is loaded, Shark doesn't work correctly with them, and MallocDebug  
doesn't work with them at all (though Instruments works fine).


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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Randall Meadows
Of course, right after posting I figured something out.  If I return a  
retained object from -tableView:objectValueForTableColumn:row:, all  
the crashes go away.  I took out all my extra retains I added in, and  
it's still behaving.


But now I'm confused.  Based on the standard memory management rules,  
I should be returning an autoreleased (or a non-retained?) object,  
right?  Is the table view doing a release on the value I return, or is  
there still something I should be tracking down?


I'm sure I must be missing something, but I sure would like to be  
educated.


Thanks.
randy

On Dec 11, 2008, at 1:24 PM, Randall Meadows wrote:

Still fighting with the table view custom cell...sorry for the  
length of this, I'm trying to include as much info as I can to help  
you help me figure this out.


I have subclassed NSTextFieldCell (NSTFC) so that I can do custom  
drawing in my table cells (basically multiple text strings within  
the cell).  My datasource object maintains an NSMutableArray, which  
gets populated each time the user selects a something in the rest of  
the UI.


-numberOfRowsInTableView: simply returns the number of objects in  
the array.


-tableView:objectValueForTableColumn:tableColumn:row: simply returns  
the object at index "row" of the table.


In -tableView:willDisplayCell:aCellforTableColumn:aTableColumn:row:,  
I set a couple of instance variables in my NSTFC subclass using  
properties that are set to (readwrite, retain), so they are  
available in the -drawInteriorWithFrame:inView: method, such as 	 
aCell.cellObject = [tableValues objectAtIndex:rowIndex];.



I have implemented -copyWithZone in my NSTFC subclass as such:

- (id)copyWithZone:(NSZone *)zone
{
  MyTableCell   *copy = [super copyWithZone:zone];
  copy.cellObject = [self.cellObject copy];
  copy.gridController = [self.ViewController copy];

  return copy;
}

All the rows fit into the visible area of the table (no scrolling).

Everything fine so far?

I can get it to crash by selecting a third row of the table.  First  
selection, OK; 2nd selection, OK; 3rd selection, boom:


-[GFController release]: message sent to deallocated instance  
0x16d97890


Doesn't happen if I select row 1, then 2, and then 1 again; it has  
to be 3 different rows.


Here's the stack trace:

#0  0x94568907 in ___forwarding___
#1  0x94568a12 in __forwarding_prep_0___
#2  0x938c320f in NSPopAutoreleasePool
#3  0x95dc7b8c in -[NSApplication run]

I can also get it to crash with this message: "[GFController name]:  
message sent to deallocated instance" simply by resizing the  
window.  This crash happens in my -tableView:heightOfRow: delegate  
method.


I have NSZombieEnabled turned on.  I'm obviously over-releasing  
something, but I've added in a bunch of retains trying to create a  
leak, but I'm still stuck with this zombie.


Anyone got any more tips on how to track this down?  (I thought I  
recalled seeing a pretty good tutorial on how to use NSZombieEnabled  
and friends and get a stack trace of where the zombie instance came  
from, but now I can't find it.  I thought it was part of TN2124, but  
I don't see it in there now.  For instance, if I turn on  
MallocStackLogging, how then do I get the malloc trace?)


Thanks!
randy
___

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/cocoa-dev%40not- 
pc.com


This email sent to cocoa-...@not-pc.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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Markus Spoettl

On Dec 11, 2008, at 12:24 PM, Randall Meadows wrote:
-[GFController release]: message sent to deallocated instance  
0x16d97890



Overwrite GFController's -release and -autorelease, simply calling  
[super release] and [super autorelease] (ensure you get the signatures  
exactly right). Set a breakpoint in both and debug the app. When the  
debugger hits the breakpoints you will see exactly who called it in  
the call stack. You can then go a figure out if that was on purpose.


Regards
Markus
--
__
Markus Spoettl



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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Benjamin Stiglitz

I have implemented -copyWithZone in my NSTFC subclass as such:

- (id)copyWithZone:(NSZone *)zone
{
  MyTableCell   *copy = [super copyWithZone:zone];
  copy.cellObject = [self.cellObject copy];
  copy.gridController = [self.ViewController copy];

  return copy;
}


NSCells use NSCopyObject to do their copies, which ends up setting the  
values of cellObject and gridController in your copies, but not  
retaining them. You need to nil them out before setting the values in  
your properties. This is a long-standing misbehavior of NSCell that  
probably won’t be changing anytime soon.


-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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread j o a r


On Dec 11, 2008, at 1:02 PM, Markus Spoettl wrote:

Overwrite GFController's -release and -autorelease, simply calling  
[super release] and [super autorelease] (ensure you get the  
signatures exactly right). Set a breakpoint in both and debug the  
app. When the debugger hits the breakpoints you will see exactly who  
called it in the call stack. You can then go a figure out if that  
was on purpose.



Don't do that - Use the ObjectAlloc Instrument, it provides this  
information out of the box.


j o a r


___

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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread mmalc Crawford


On Dec 11, 2008, at 1:06 PM, Benjamin Stiglitz wrote:

NSCells use NSCopyObject to do their copies, which ends up setting  
the values of cellObject and gridController in your copies, but not  
retaining them. You need to nil them out before setting the values  
in your properties.





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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread j o a r


On Dec 11, 2008, at 4:06 PM, Benjamin Stiglitz wrote:

NSCells use NSCopyObject to do their copies, which ends up setting  
the values of cellObject and gridController in your copies, but not  
retaining them. You need to nil them out before setting the values  
in your properties. This is a long-standing misbehavior of NSCell  
that probably won’t be changing anytime soon.



This is indeed a problem. The documentation covers it, for the most  
part, but it could still be improved:


	
	


j o a r


___

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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Markus Spoettl

On Dec 11, 2008, at 1:11 PM, j o a r wrote:
Overwrite GFController's -release and -autorelease, simply calling  
[super release] and [super autorelease] (ensure you get the  
signatures exactly right). Set a breakpoint in both and debug the  
app. When the debugger hits the breakpoints you will see exactly  
who called it in the call stack. You can then go a figure out if  
that was on purpose.



Don't do that - Use the ObjectAlloc Instrument, it provides this  
information out of the box.



So it stops the debugger and shows you the call stack *at the exact  
time it's being called* and gives to an opportunity to walk back the  
call stack before continuing? How so? Please do tell me how to do that.


Markus
--
__
Markus Spoettl



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: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Jesper Storm Bache

Yes. Even if you're not going to go 64-bit now, I would strongly
recommend you at least get your code ready for it, because there will
be a day when the i386 architecture gets deprecated. That means
switching ints to NSIntegers, getting rid of FSSpec, etc.


Minor point to be aware of when you go to 64 bit.
Apple uses LP64 - meaning that long and pointers are 64 bit, but int's  
are 32 bit (see http://en.wikipedia.org/wiki/LP64).


A potential source of confusing is that NSInteger in 64 bit is not an  
int, but a long. This means that NSInteger is 64 bit on 64 bit systems.
A general switch from int to NSInteger is therefore probably not  
appropriate, but a switch to NSInteger is needed when you want to  
store the result of any API that returns an NSInteger.


Jesper Storm Bache
___

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: Resizing an image

2008-12-11 Thread douglas welton

Hi Glenn,

Your answers a little bit non-specific, so at best I will have to give  
you a non-specific response.


Two suggestions:

1)  Core Image is your friend!  In your case, CICrop and  
CILanczosScaleTransform may be of some help.


2)  CGImageRef is your other friend!  In particular, see the  
documentation on creating images of a particular size.


If you have more details about what you are trying to accomplish and/ 
or what you have tried already, then we may be able to provide a more  
complete set of suggestions on how to go forward.


regards,

douglas


On Dec 11, 2008, at 8:43 AM, Glenn Bloom wrote:

Can anyone recommend a best practice for resizing an image to reduce  
its

size in terms of both bytes and visible dimensions, retaining the new
smaller image and eliminating the original from memory?  In how I go  
about

this now, I am concerned about memory and efficiency.

thanks in advance for any help,

Glenn

___

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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Corbin Dunn


On Dec 11, 2008, at 1:30 PM, Markus Spoettl wrote:


On Dec 11, 2008, at 1:11 PM, j o a r wrote:
Overwrite GFController's -release and -autorelease, simply calling  
[super release] and [super autorelease] (ensure you get the  
signatures exactly right). Set a breakpoint in both and debug the  
app. When the debugger hits the breakpoints you will see exactly  
who called it in the call stack. You can then go a figure out if  
that was on purpose.



Don't do that - Use the ObjectAlloc Instrument, it provides this  
information out of the box.



So it stops the debugger and shows you the call stack *at the exact  
time it's being called* and gives to an opportunity to walk back the  
call stack before continuing? How so? Please do tell me how to do  
that.


Sure does! (obviously, aside from stopping the debugger..)

http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/

corbin
___

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: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Nick Zitzmann


On Dec 11, 2008, at 2:50 PM, Jesper Storm Bache wrote:

A potential source of confusing is that NSInteger in 64 bit is not  
an int, but a long. This means that NSInteger is 64 bit on 64 bit  
systems.
A general switch from int to NSInteger is therefore probably not  
appropriate, but a switch to NSInteger is needed when you want to  
store the result of any API that returns an NSInteger.



You're correct when it comes to handling formats of fixed size, but if  
you need a primitive's size to be the same no matter what, then you  
should probably be using int8_t, int32_t, int64_t, etc. instead of  
either int or NSInteger...


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: Resizing an image

2008-12-11 Thread Glenn Bloom
Steve, thank you - I just tested your recommendation - it appears to work
well.  Doug, I just got your recommendation and will look into CICrop and
CILanczosScaleTransform, and CGImageRef documentation on creating images of
a particular size.  I'm in fact about to run out to a Cocoaheads meeting, so
will get back to this in the AM maybe with more thoughts as well and will
post again.  Thank you both.

On Thu, Dec 11, 2008 at 2:44 PM, Steve Christensen  wrote:

> On Dec 11, 2008, at 5:43 AM, Glenn Bloom wrote:
>
> Can anyone recommend a best practice for resizing an image to reduce its
>> size in terms of both bytes and visible dimensions, retaining the new
>> smaller image and eliminating the original from memory?  In how I go about
>> this now, I am concerned about memory and efficiency.
>>
>
> How about something like this?
>
> NSImage* oldImage = GetSomeImage(...);
> NSSize   newSize = GetDesiredNewSize(oldImage, ...);
>
> NSImage* newImage = [[NSImage alloc] initWithSize:newSize];
>
> [newImage lockFocus];
> [oldImage drawInRect:NSMakeRect(0, 0, newSize.width, newSize.height)
>fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
> [newImage unlockFocus];
>
> [oldImage release];
>
>
> And depending on how important the resized image quality is, you may also
> want to do the following just before the drawInRect call:
>
> [[NSGraphicsContext currentContext]
> setImageInterpolation:NSImageInterpolationHigh];
>
>
___

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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Markus Spoettl

On Dec 11, 2008, at 1:56 PM, Corbin Dunn wrote:
Don't do that - Use the ObjectAlloc Instrument, it provides this  
information out of the box.



So it stops the debugger and shows you the call stack *at the exact  
time it's being called* and gives to an opportunity to walk back  
the call stack before continuing? How so? Please do tell me how to  
do that.


Sure does! (obviously, aside from stopping the debugger..)



Sure but the stopping-in-the-debugger-feature is what the essential  
part of the procedure I was describing is. Essential for me anyway.


Markus
--
__
Markus Spoettl



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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Corbin Dunn


On Dec 11, 2008, at 2:17 PM, Markus Spoettl wrote:


On Dec 11, 2008, at 1:56 PM, Corbin Dunn wrote:
Don't do that - Use the ObjectAlloc Instrument, it provides this  
information out of the box.



So it stops the debugger and shows you the call stack *at the  
exact time it's being called* and gives to an opportunity to walk  
back the call stack before continuing? How so? Please do tell me  
how to do that.


Sure does! (obviously, aside from stopping the debugger..)



Sure but the stopping-in-the-debugger-feature is what the essential  
part of the procedure I was describing is. Essential for me anyway.


I have tried both approaches; generally, I have found that -retain/- 
release/-autorelease get called so often that it is difficult to  
figure out what is wrong by simply placing a breakpoint on them. My  
main point is that Instruments can record the callstacks (I've  
discovered many people don't know this); and, provided you have  
source, double clicking on a callstack item will take you to the  
source. For this type of problem (an overlease), it is almost as close  
to as debugging, and much faster when trying to find the extra - 
release (or -autorelease).


corbin
___

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: efficiency of Xquery vs NSXMLElement attributes

2008-12-11 Thread Kieren Eaton

Thanks Mike

On 12/12/2008, at 2:24 AM, Michael Ash wrote:

On Thu, Dec 11, 2008 at 1:00 AM, Kieren Eaton   
wrote:

Hi All

I know there are always several ways to do things and have come  
across

something which puzzles me as to
the efficiency of these 2 ways of getting the same data from an  
NSXMLNode

object.

for this exercise assume theNode is an NSXMLNode object which has  
been
initialized and contains data and an attribute called class with  
something

in it.

Scenario 1

NSXMLElement *nodeAsElement = (NSXMLElement *)theNode;
NSString *attribContent = [[nodeAsElement attributeForName:@"class"]
stringValue];
NSLog(@"class contains %@",attribContent);

Scenario 2

NSString *attribContent = [[theNode objectsForXQuery:@"data(@class)"
error:nil] objectAtIndex:0];
NSLog(@"class contains %@",attribContent);

these will and do produce the same data but for my own personal  
knowledge I

would like to know which is more efficient.
I use both in my code but am leaning more towards the xquery style  
for

readability and maintainability of larger more nested structures.

Comments appreciated


I'd guess that #1 is going to be faster, simply because #2 has to
parse the string and #1 does not.

However, does it matter? Unless you're doing this over and over again
in a tight loop, it probably doesn't make any difference which one you
use, so go for the one you think is more readable.
The strng gets checked on a random basis from about every couple of  
seconds to a couple of minutes depending on the length of the audio  
its associated with.


Thanks and I am using the more readable version with comments of course.

Kieren


If it really does make a difference then you're in a perfect situation
to find out for yourself. Try both, and measure how much time each one
takes, and you will have your answer.

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/kierene%40gmail.com

This email sent to kier...@gmail.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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread j o a r


On Dec 11, 2008, at 2:17 PM, Markus Spoettl wrote:

So it stops the debugger and shows you the call stack *at the  
exact time it's being called* and gives to an opportunity to walk  
back the call stack before continuing? How so? Please do tell me  
how to do that.


Sure does! (obviously, aside from stopping the debugger..)


Sure but the stopping-in-the-debugger-feature is what the essential  
part of the procedure I was describing is. Essential for me anyway.



Not essential for troubleshooting this type of problem in general  
though, that's the only thing I was referring to. If you have special  
needs, it might well be that you have to use something else, but this  
should be your first approach (IMO).


j o a r


___

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: Arggg...overrelease in table view cell, but where?

2008-12-11 Thread Stuart Rogers



I have implemented -copyWithZone in my NSTFC subclass as such:

- (id)copyWithZone:(NSZone *)zone
{
 MyTableCell*copy = [super copyWithZone:zone];
 copy.cellObject = [self.cellObject copy];
 copy.gridController = [self.ViewController copy];

 return copy;
}


NSCells use NSCopyObject to do their copies, which ends up setting the
values of cellObject and gridController in your copies, but not
retaining them. You need to nil them out before setting the values in
your properties. This is a long-standing misbehavior of NSCell that
probably won’t be changing anytime soon.


Just in case Corbin misses the opportunity to reference it yet again,
see ImagePreviewCell.m in:



Stuart

___

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


[ANN] AppKiDo{-for-iPhone} 0.982

2008-12-11 Thread Andy Lee

Release notes to come later -- gotta run to CocoaHeads...

http://homepage.mac.com/aglee/downloads/AppKiDo-0.982.tgz
http://homepage.mac.com/aglee/downloads/AppKiDo-for-iPhone-0.982.tgz

Same source code for both:

http://homepage.mac.com/aglee/downloads/AppKiDo-src-0.982.tgz

--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: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?

2008-12-11 Thread Chunk 1978
thanks a lot Ashley... works great!

On Thu, Dec 11, 2008 at 2:35 PM, Ashley Clark  wrote:
> Sorry forgot to mention you'll probably have to cast things to integer for
> modulo to work. My compiler flags make me at least.
>
> Ashley
>
>
> On Dec 11, 2008, at 1:25 PM, Ashley Clark wrote:
>
>> On Dec 11, 2008, at 6:32 AM, Chunk 1978 wrote:
>>
>>> thanks everyone for the answers.
>>>
>>> i agree that Ashley's method is far more readable than using modulus
>>> calculations, so i'll look into that further as i can't seem to get it
>>> working yet.
>>>
>>> currently, i have this working using modulus calculations, but it
>>> starts at 00 for the hours and minutes...
>>
>> /* snip */
>>
>>> - (void)updateTime:(NSTimer *)theTimer
>>>{
>>>NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
>>>NSTimeInterval interval = now - startTime;
>>>
>>>//Tag #1 x 3600 Seconds = 3600 Seconds = 2 Hours.
>>>//Tag #2 x 3600 Seconds = 7200 Seconds = 2 Hours.
>>>//Tag #3 x 3600 Seconds = 10800 Seconds = 3 Hours.
>>>
>>>int hoursSelected = ([self timeMenuSelection] * 3600);
>>
>> NSTimeInterval remaining = hoursSelected - second;
>>
>> if (remaining >= 0)
>>{
>>int hours = remaining / 3600;
>
>
>>int minutes = (int)(remaining / 60) % 60;
>>int seconds = (int)remaining % 60;
>
>
>>NSLog(@"%.2d %.2d %.2d ", hours, minutes, seconds);
>>
>>>}
>>>else
>>>{
>>>NSLog(@"TIME'S UP!");
>>>[killTimer invalidate];
>>>[killTimer release];
>>>killTimer = nil;
>>>}
>>>}
>>
>> ___
>>
>> 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/aclark%40ghoti.org
>>
>> This email sent to acl...@ghoti.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


Drag & Drop: PREVENT file move

2008-12-11 Thread Houdah - ML Pierre Bernard

Hi!

My application shows a list of files in a table view.

I have implemented drag and drop so that users may drag files from the  
list. I could envision them dragging the files onto other applications  
for viewing or dragging them on a removable media to create archive  
copies.


The problem occurs when the user drags the file to another folder on  
the same disk. By default, the Finder then wants to move the file. I  
need to prevent just that as it will cause havoc. For one, I would  
lose track of the file.


Is there a way for the originating application to control the allowed  
drag operations?


Best,
Pierre Bernard
___

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 the time every 30 minutes

2008-12-11 Thread Mr. Gecko
Hell I'm trying to find out how to announce the time every 30 minutes,  
I'm guessing I have to do it with NSTimer and and than have the time  
interval set to NSDate interval from now to the time which is like  
7:30 or 8:00. but I'm not sure.


Thanks for the help,
Mr. Gecko
___

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: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Clark Cox
On Thu, Dec 11, 2008 at 1:50 PM, Jesper Storm Bache  wrote:
>> Yes. Even if you're not going to go 64-bit now, I would strongly
>> recommend you at least get your code ready for it, because there will
>> be a day when the i386 architecture gets deprecated. That means
>> switching ints to NSIntegers, getting rid of FSSpec, etc.
>
> Minor point to be aware of when you go to 64 bit.
> Apple uses LP64 - meaning that long and pointers are 64 bit, but int's are
> 32 bit (see http://en.wikipedia.org/wiki/LP64).
>
> A potential source of confusing is that NSInteger in 64 bit is not an int,
> but a long. This means that NSInteger is 64 bit on 64 bit systems.
> A general switch from int to NSInteger is therefore probably not
> appropriate,

For function/method parameters and return types, an unconditional
switch to NSInteger/NSUInteger is fine (the registers are all 64-bit,
so you lose nothing by doing so; a 32-bit type would still take up the
entire 64-bit register)

> but a switch to NSInteger is needed when you want to store the
> result of any API that returns an NSInteger.

Indeed. For structures and arrays especially, you should consider
carefully whether or not you *need* a 64-bit type, as the doubling in
size can become significant there.

-- 
Clark S. Cox III
clarkc...@gmail.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: Drag & Drop: PREVENT file move

2008-12-11 Thread Nathan Vander Wilt


On Dec 11, 2008, at 3:11 PM, Houdah - ML Pierre Bernard wrote:


Hi!

My application shows a list of files in a table view.

I have implemented drag and drop so that users may drag files from  
the list. I could envision them dragging the files onto other  
applications for viewing or dragging them on a removable media to  
create archive copies.


The problem occurs when the user drags the file to another folder on  
the same disk. By default, the Finder then wants to move the file. I  
need to prevent just that as it will cause havoc. For one, I would  
lose track of the file.


Is there a way for the originating application to control the  
allowed drag operations?



Check out NSDraggingSource protocol's - 
draggingSourceOperationMaskForLocal:. You should be able to return  
something like (NSDragOperationCopy | NSDragOperationLink) if you want  
to make sure the original file stays in the same place. If you don't  
mind the file being moved so long as you know its no longer available,  
you could instead implement -(void)draggedImage:(NSImage*)anImage  
endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation to be  
notified when a move/delete is completed.



hope this helps,
-natevw

___

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: Announce the time every 30 minutes

2008-12-11 Thread Andrew Farmer

On 11 Dec 08, at 15:14, Mr. Gecko wrote:
Hell I'm trying to find out how to announce the time every 30  
minutes, I'm guessing I have to do it with NSTimer and and than have  
the time interval set to NSDate interval from now to the time which  
is like 7:30 or 8:00. but I'm not sure.


That's correct - you will need to figure out the next time you want to  
make an announcement, given the current time, and calculate how far in  
the future that is. Keep in mind that NSTimers don't guarantee exact  
timing; they may fire slightly before or significantly after the  
target date. (In other words, be careful about handling "missed"  
announcements, especially in cases such as the computer going to sleep  
or the user adjusting the time or time zone.)

___

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: Announce the time every 30 minutes

2008-12-11 Thread M Pulis
If you don't "need" this function "in" your app, or don't want to  
have your app running all the time just to do the chime, you could  
setup system preferences to let OSX do it for you. There may even be  
a command line that can be executed under control of your app.


Gary

On Dec 11, 2008, at 4:49 PM, Andrew Farmer wrote:


On 11 Dec 08, at 15:14, Mr. Gecko wrote:
Hell I'm trying to find out how to announce the time every 30  
minutes, I'm guessing I have to do it with NSTimer and and than  
have the time interval set to NSDate interval from now to the time  
which is like 7:30 or 8:00. but I'm not sure.


That's correct - you will need to figure out the next time you want  
to make an announcement, given the current time, and calculate how  
far in the future that is. Keep in mind that NSTimers don't  
guarantee exact timing; they may fire slightly before or  
significantly after the target date. (In other words, be careful  
about handling "missed" announcements, especially in cases such as  
the computer going to sleep or the user adjusting the time or time  
zone.)

___

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/toothpic%40fastq.com

This email sent to tooth...@fastq.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: Core Data warning: to-many relation does not have an inverse

2008-12-11 Thread Nathan Vander Wilt
Sorry if this ends up showing twice, but the original message has been  
moderator-queued for length since early this morning. Being several  
steps behind in even *asking* Core Data questions has been frustrating  
me all day, as I try to press on in no less ignorance than yesterday.


On Dec 11, 2008, at 2:38 AM, Ben Trumbull wrote:

Consultant.interestingEmployees -- to-many relationship does not
have an inverse: this is an advanced setting (no object can be in
multiple destinations for a specific relationship)
[snip]


It says no object can be in multiple destinations for a specific  
relationship (no inverse relationship, btw, fully modeled  
relationships don't have this issue, because they're fully  
modeled).  If you have Department 0->> People (no inverse to many to  
People) with D1 and D2 being department objects and P1 being a  
Person, you cannot have both D1->>{ P1 } and D2->> { P1 }  If  
Department had several no inverse to-many relationships to People,  
like goodPeople and lazyPeople, then P1 could belong once in each  
across all the Department objects.


It means you cannot pretend your no inverse to-many is like a many- 
to-many relationship.  If you try, you'll corrupt your data, and we  
told you not to.  You explicitly failed to model the part we needed  
to verify whether or not your schema is correct, so this was as  
helpful as we could be about your future undefined intentions.


If you sit down and think about how one implements many-to-many  
relationships in a database, it should be clear why this is the  
case.  If that didn't make sense, then please, just model the  
inverse like the compiler is suggesting.


"this is an advanced setting" == "if you didn't understand this  
message, you're going the wrong way.  Otherwise, you're probably  
going the wrong way"


I apologize if there was something in my previous message that  
suggested I thought the warning, and not my model, was wrong. However,  
I would like to figure out what makes my way the wrong way, and what  
the right way would be.


I hope that by "corrupt data" in the case of a many-to-many  
relationship, you mean that if one isn't careful they may end up with  
a row that links a foreign key from one table to a non-existent key in  
another. In that case, I am not too worried, unless I should be? I am  
already managing my object graph and undo management on my own, and  
mostly need to use Core Data so that when I'm using the SQLite store I  
don't have to overwrite the entire graph on disk if few or no objects  
have actually changed. I am willing to improve my model's architecture  
where it is incompatible, but if Core Data will bail out if I ever try  
to cross a particular street on my own, I'll need to learn which  
streets to avoid and why.




The other problem is that I do want to define an inverse for
Employee.company, but I can't set it to *both*
Company.currentEmployees and .previousEmployees. [snip]


Why are you trying to solve that problem ?  In the obvious case,  
Employee.company needs to be the inverse for currentEmployees  
because it's the current company, and the alternatives semantically  
don't make any sense.  Then, previousEmployees has a separate  
inverse, if only for bookkeeping purposes (e.g. so Core Data  
maintains everything for you)


If you're trying to model companies and employees having an audit  
record all of their previous employments, then you need to do that  
explicitly instead of trying to be too clever.  I'd recommend a many- 
to-many relationship between Employee and Company for "previous  
employers" to match "previous employees".  You could go with  
"lastPreviousEmployer" and make it a one-to-many.



Maybe I need to clarify my model a bit. Just to be clear, all names  
have been changed to protect the innocent and any resemblance to a  
real Company with real Employees is unintentional. Perhaps it would  
help to tweak my example a bit.


The odd thing about my "Company" is that it likes to move "Desks"  
around. So when an "Employee" comes in for work, he must ask the  
"Company" where his "Desk" is that morning. There are really three  
kinds of Employees, "Outgoing", "Current" and "Interesting". In order  
to be Interesting, an employee must also be Current. The Outgoing  
Employees still need to be be able to ask the Company where their Desk  
is, so they can clean their stuff out of the drawers before they say  
goodbye.


The reason I want to implement "Outgoing" and "Current" as  
relationships from a "Company" and "Interesting" as a relationship  
from a separate "Consultant" is for performance and for information  
hiding. Employees aren't in charge of whether they're Outgoing/Current  
and don't need to know if they're considered Interesting. Further, the  
Consultant shouldn't have to know all Employees, just the interesting  
ones. Organizing it this way also means I have a ready-to-go list of  
each type, so I don't have to filter down to, say, all

Help reading cocoa docs - finding info about return objects and autorelease / memory management.

2008-12-11 Thread aaron smith
Hey All,

Quick question, what is the best way to determine what kind of cleanup
I need to do with objects that were returned from other objects'
methods, or class methods.

For example, the NSTextField has a method called (NSString
*)stringValue - which returns a string of the value in the text box.
how do I know if that NSString will have a retain count of 1 when
returned to me, or if it was autoreleased before being returned to me.

Beyond just that example, is there any other cheat sheets, or more
documentation in the cocoa docs about those types of concerns?

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: Help reading cocoa docs - finding info about return objects and autorelease / memory management.

2008-12-11 Thread Wyatt Webb
Have a look at the Memory Management Programming Guide for Cocoa.  
Especially the section on Object Ownership and Disposal. The trick is  
in the name of the methods you call to get the reference. Generally,  
methods with "alloc", "new", or "copy" in the name are making you  
responsible for releasing. Others do not and you would need to retain  
if you expect to hang on to them for a while.


http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#/ 
/apple_ref/doc/uid/2043-BEHDEDDB


Wyatt

On Dec 11, 2008, at 4:13 PM, aaron smith wrote:


Hey All,

Quick question, what is the best way to determine what kind of cleanup
I need to do with objects that were returned from other objects'
methods, or class methods.

For example, the NSTextField has a method called (NSString
*)stringValue - which returns a string of the value in the text box.
how do I know if that NSString will have a retain count of 1 when
returned to me, or if it was autoreleased before being returned to me.

Beyond just that example, is there any other cheat sheets, or more
documentation in the cocoa docs about those types of concerns?

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/wwebb%40inspiration.com

This email sent to ww...@inspiration.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


  1   2   >