Re: Alternative startup for application

2010-04-06 Thread Jean-Daniel Dupas

Le 3 avr. 2010 à 05:13, Michael Nickerson a écrit :

 
 On Apr 02, 2010, at 10:12 PM, Gideon King wrote:
 
 That's the instance method. New in 10.6 is the class method of the same 
 name, which is what I need in this case, since I don't have an event to work 
 with.
 
 On 03/04/2010, at 12:09 PM, Klaus Backert wrote:
 
 
 On 3 Apr 2010, at 01:15, Gideon King wrote:
 
 Excellent, I like the new way of doing it using NSEvent directly, but I do 
 need to support Leopard.
 
 - (NSUInteger)modifierFlags
 
 Available in Mac OS X v10.0 and later.
 
 
 
 
 You can use CGEventSourceKeyState( kCGEventSourceStateCombinedSessionState, 
 0x3A ).  That function will get the key down state at the time of the call, 
 and 0x3A is the key code for the option key.
 
 

altDown =  (kCGEventFlagMaskAlternate == 
(CGEventSourceFlagsState(kCGEventSourceStateCombinedSessionState)  
NSDeviceIndependentModifierFlagsMask));

___

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 do I get a file reference w/o relying on the path?

2010-04-06 Thread Jean-Daniel Dupas

Le 4 avr. 2010 à 19:50, Jens Alfke a écrit :

 You're saying that if I have a FSRef to a file, then the file is moved, the 
 FSRef will still reference the moved file and not the location where it used 
 to be?
 
 That's surprising to me, because FSRefs were created as a replacement for 
 FSSpecs, which do not have that property (they were a struct {volume ID, dir 
 ID, filename}.)
 
 Anyway, note that a file inode ID is more fragile than an alias/bookmark, 
 because it won't survive the common practice of replacing an old copy of a 
 file with a new one (safe save) unless the code doing the replace is 
 careful to propagate metadata to the new file. 

FSExchangeObjects and exchangedata(2) do not exchange the file ID.
The new file will have the same ID than the old one, and so, the FSRef will 
point on the new file automatically.

-- Jean-Daniel


___

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


Using Core Data ManagedObjectIDs to uniquely name files

2010-04-06 Thread Ken Tabb

Morning folks,

I have a Snow Leopard non-document based Core Data app (currently XML  
based, but will be SQLite upon release). Supposing I have an entity  
(Employee) that would like to store an auxiliary file (a tiff of their  
mugshot), then as I see it I have the following options:


[1] Store the tiff within the Core Data store as a binary attribute.
Pros - presumably the easiest route.
Cons - it would generate much Time Machine activity I would assume, as  
that single file will get big and be constantly updated every time  
anything (images or any normal attribute) gets changed, so Time  
Machine would basically be copying all the images each time when  
perhaps it didn't need to (maybe the only difference since the last  
backup is an Employee's name changed). Making for an unnecessarily  
full Time Machine backup disk / terrible app performance if the user's  
home directory isn't local.


[2] Store each mugshot as a separate file in a known folder (eg. a  
subfolder of the app's Application Support folder, where the store is  
also hanging out), and manually keep a tally of unique filenames  
within the store / entity so that nothing clashes.
Pros - Less unnecessary backup activity / home directory accessing  
etc. than the monolithic file in method [1].
Cons - My model doesn't have / need a unique ID as a modelled (by me)  
attribute. Seems like a lot of unnecessary housekeeping work.


[3] Same as [2] but I could use the timestamp when the Employee record  
was created as the filename

Pros - Less housekeeping
Cons - can I guarantee that, at some point, some bright spark won't re- 
import the whole dataset on a fast machine and manage to get 2  
different Employees created during the same slice of time (thus  
sharing the same mugshot filename attribute, and overwriting each  
other on the filesystem whenever either updates their pic)?


[4] Basically the same as [2] but using all or part of the Employee's  
objectID as the filename, so that I can derive a built in unique  
filename and don't have to do housekeeping. If I ensure I get a  
permanent ID using the context's -obtainPermanentIDsForObjects:error:  
method, and remembering that this isn't a document based app, so it's  
happy assigning permanent IDs even on the first launch of the app,  
then I get an objectID URI looking like:


x-coredata://3756AD1D-C658-409C-9EDD-E3EED0C898B1/Employee/p101

... and successive Employee objects differ only in that they end with  
p102, p103 etc.


If it makes any difference, during testing I'm sticking with an XML  
store, but for shipping it'll be an SQLite store. Also, it's only  
Employee objects that will need to store any files, so I'm not worried  
about the existence of Department/p101 objects etc. clashing.


My questions are:

[1] Presuming that my Employee objects all have permanent objectIDs,  
can I rely upon using myEmployee] objectID] URIRepresentation]  
lastPathComponent] as a unique filename for that object? i.e. so that  
I end up with p101.tiff, p102.tiff images.


[2] Is an object's permanent ID truly permanent (for that saved  
object, in that store, on that app, on that machine), or might it get  
changed when an app's managed model gets modified (eg. when I start  
making Company entities too, or if I add a 'shoesize' attribute to an  
Employee) or during a future version of Core Data?


[3] Are the SQLite-based objectIDs similarly easy to get to the unique  
bit (and similarly can I rely upon always being able to use them)?


Or is there a better way of doing what I'm trying to do? The docs seem  
rather thin on the ground in terms of permitted (read-only) uses of  
the objectID, besides testing for equality, and for permanence. As I  
say, the app is working fine at the moment (on a development release  
XML store), but I just want to check if I'm making safe assumptions as  
it feels almost as dirty and sneaky as playing with private APIs, and  
I'd rather not base a shipping app on something just because it  
happens to work right now for me on my machine :)


As ever, thanks in advance for any help you can give,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac  UNIX Developer - Health  Human Sciences
Machine Vision  Neural Network researcher - School of Computer Science
University of Hertfordshire, UK


___

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: Using Core Data ManagedObjectIDs to uniquely name files

2010-04-06 Thread Gideon King
Hi Ken

If someone created another copy of your database, I imagine the last path 
component could be duplicated, since it would not know about the other copy and 
create the same primary key. 

I believe that the URI is made up of the store id / entity / reference object. 
With a document based application, the store id changes when you do a save as, 
but I presume a non-document based app would remain constant. 

I entity related changes are identified in the metadata via a hash, and I don't 
think they would affect the URI, but I haven't had cause to check that.

Another option for naming your files may be based on a UUID you store in your 
data, or perhaps something like a SHA1 hash of the file, which would also let 
you know if the file had changed, if that was of interest to you.

HTH

Gideon

On 06/04/2010, at 9:27 PM, Ken Tabb wrote:

 My questions are:
 
 [1] Presuming that my Employee objects all have permanent objectIDs, can I 
 rely upon using myEmployee] objectID] URIRepresentation] 
 lastPathComponent] as a unique filename for that object? i.e. so that I end 
 up with p101.tiff, p102.tiff images.
 
 [2] Is an object's permanent ID truly permanent (for that saved object, in 
 that store, on that app, on that machine), or might it get changed when an 
 app's managed model gets modified (eg. when I start making Company entities 
 too, or if I add a 'shoesize' attribute to an Employee) or during a future 
 version of Core Data?
 
 [3] Are the SQLite-based objectIDs similarly easy to get to the unique bit 
 (and similarly can I rely upon always being able to use them)?
 
 Or is there a better way of doing what I'm trying to do? The docs seem rather 
 thin on the ground in terms of permitted (read-only) uses of the objectID, 
 besides testing for equality, and for permanence. As I say, the app is 
 working fine at the moment (on a development release XML store), but I just 
 want to check if I'm making safe assumptions as it feels almost as dirty and 
 sneaky as playing with private APIs, and I'd rather not base a shipping app 
 on something just because it happens to work right now for me on my machine :)
 
 As ever, thanks in advance for any help you can give,
 Ken
 

___

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

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

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

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


Re: Implied use of Properties

2010-04-06 Thread Dave


On 2 Apr 2010, at 22:21, Klaus Backert wrote:


Hi, Dave

There are some typing errors in this code, I think, but anyway,  
this might be a case of lazy creation of an object inside a getter  
of another object. You will find the same e.g. in Apple's code  
examples about OpenGL, where the OpenGL context is an instance  
variable of the OpenGL view. Accessing the context is managed by a  
getter method or property, respectively, of the view, where, in the  
case of the instance variable being nil, the context is created,  
stored in the instance variable, and eventually returned. I call  
the creation lazy, because it is done at the latest point during  
execution, immediately before it is needed. For me this practice is  
normal.


But, may be, I don't understand your question correctly.


Yes, there were a couple of typeo's in my example. I found the code I  
in an Apple Developer Sample App and was wondering if it were  
considered best practice since for me hiding the allocate in an  
Accessor method doesn't do anything for readability of the code. Also  
as far as I can see, there are a couple of draw-backs to doing it  
this way. In the example:


-(ClassY*) mClassY
{
if (mClassY == nil)
{
mClassY = [[ClassY alloc] initWithData:someData]:
}
return mClassY;
}

The reasons I don't like this are:

1.  someData is hardwired and it's impossible to pass a parameter  
to mClassY since it's a getter.


2.  If either the alloc or initWithData methods fail there is no way  
to pass the error back to the caller except by passing nil as the  
Class Selector. And if this were done in a statement like:


self.mClassY. mClassYValue = someValue;

I'm not sure what would happen but it wouldn't be good news!

Putting the allocation in an init  method would solve the above  
problems, In the sample application it was unclear where/if ClassY  
was released, I would have thought that at the very least the  
following code would have been added:


-(ClassY*) SetmClassY (ClassY* theClassY)
{
if (theClassY == nil)
   [mClassy release]

mClassY = theClassY;
}

It's no biggie either way really, it's just I'm working on a new  
project and it would be nice to do the right thing now, rather than  
later on when I have loads more code to worry about.


All the Best
Dave










___

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

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

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

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


What does console message unhandled property type encoding mean?

2010-04-06 Thread Sean McBride
Hi all,

In 10.5.8 (but not 10.6.x) I see the following in Console.app when
running my app:

unhandled property type encoding: `{?
=minXValuedmaxXValuedminYValuedmaxYValued}'

I have a CALayer subclass that has a property:

typedef struct
{
double minXValue;
double maxXValue;
double minYValue;
double maxYValue;
} RRXYPlotLayerValueRange;

@property (readwrite) RRXYPlotLayerValueRange cachedValueRange;

@synthesize cachedValueRange = _cachedValueRange;

This all seems to work at runtime, what's the warning about?  It does
seem related to CALayer, is there something special about adding
@property to subclasses of CALayer?

This exact question has gone unanswered before:
http://lists.apple.com/archives/Cocoa-dev//2008/Apr/msg00199.html

Thanks,

--

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


___

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

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

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

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


Re: Using Core Data ManagedObjectIDs to uniquely name files

2010-04-06 Thread Sean McBride
On Tue, 6 Apr 2010 12:27:18 +0100, Ken Tabb said:

I have a Snow Leopard non-document based Core Data app (currently XML
based, but will be SQLite upon release). Supposing I have an entity
(Employee) that would like to store an auxiliary file (a tiff of their
mugshot), then as I see it I have the following options:

You could make your file format a package and store within it the TIFFs
and the CoreData persistent store.  You can add a 'uuid' string
attribute to your Employee entity and use that as the filename.

--

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


___

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

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

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

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


Re: How do I get a file reference w/o relying on the path?

2010-04-06 Thread Jon Pugh
At 9:54 AM +0200 4/6/10, Jean-Daniel Dupas wrote:
Le 4 avr. 2010 à 19:50, Jens Alfke a écrit :

 You're saying that if I have a FSRef to a file, then the file is moved, the 
 FSRef will still reference the moved file and not the location where it used 
 to be?

 That's surprising to me, because FSRefs were created as a replacement for 
 FSSpecs, which do not have that property (they were a struct {volume ID, dir 
 ID, filename}.)

 Anyway, note that a file inode ID is more fragile than an alias/bookmark, 
 because it won't survive the common practice of replacing an old copy of a 
 file with a new one (safe save) unless the code doing the replace is 
 careful to propagate metadata to the new file.

FSExchangeObjects and exchangedata(2) do not exchange the file ID.
The new file will have the same ID than the old one, and so, the FSRef will 
point on the new file automatically.

Unfortunately, FSRefs don't survive the common practice of manually replacing 
the file in the Finder. This *does* change the file id and invalidates the 
FSRef. I had to change to explicitly saving an AliasRecord in an NSData to keep 
track of a file properly.

Jon
___

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: Wondering about that iPad page curling

2010-04-06 Thread Laurent Daudelin
So, no other response from the regular crowd of resident experts on how Apple 
engineers did this?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

On Apr 5, 2010, at 18:32, Alex Kac wrote:

 Except CIFilter doesn't exist on the iPad in a public SDK setting.
 
 On Apr 5, 2010, at 8:22 PM, Laurent Daudelin wrote:
 
 On Apr 5, 2010, at 18:02, Graham Cox wrote:
 
 CIFilter has a page curl transition effect. Just map the 't' value to the 
 mouse/finger location.
 
 --Graham
 
 
 On 06/04/2010, at 10:55 AM, Laurent Daudelin wrote:
 
 I got my hands on an iPad today. I was really impressed with the built-in 
 book reader. When you flip the page while holding your finger down, the 
 page will curl and follow your finger. Very impressive! Anybody has any 
 idea how one would be able to achieve such effect?
 
 
 It's that easy?
 
 -Laurent.
 

___

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

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

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

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


Re: Wondering about that iPad page curling

2010-04-06 Thread Alex Kac
Well they may have done it with a private API for CoreImage if that exists (not 
sure). THey may have done it with OpenGL. They may have taken their CoreImage 
code on desktop and ported a part of it to iBooks and used that. 

For you, most likely the best way to do it is using OpenGL.

On Apr 6, 2010, at 10:56 AM, Laurent Daudelin wrote:

 So, no other response from the regular crowd of resident experts on how 
 Apple engineers did this?
 
 -Laurent.
 -- 
 Laurent Daudelin
 AIM/iChat/Skype:LaurentDaudelin   
 http://nemesys.dyndns.org
 Logiciels Nemesys Software
 laurent.daude...@gmail.com
 Photo Gallery Store: 
 http://laurentdaudelin.shutterbugstorefront.com/g/galleries
 
 On Apr 5, 2010, at 18:32, Alex Kac wrote:
 
 Except CIFilter doesn't exist on the iPad in a public SDK setting.
 
 On Apr 5, 2010, at 8:22 PM, Laurent Daudelin wrote:
 
 On Apr 5, 2010, at 18:02, Graham Cox wrote:
 
 CIFilter has a page curl transition effect. Just map the 't' value to the 
 mouse/finger location.
 
 --Graham
 
 
 On 06/04/2010, at 10:55 AM, Laurent Daudelin wrote:
 
 I got my hands on an iPad today. I was really impressed with the built-in 
 book reader. When you flip the page while holding your finger down, the 
 page will curl and follow your finger. Very impressive! Anybody has any 
 idea how one would be able to achieve such effect?
 
 
 It's that easy?
 
 -Laurent.
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
 
 This email sent to a...@webis.net

Alex Kac - President and Founder
Web Information Solutions, Inc.

The optimist proclaims that we live in the best of all possible worlds; and 
the pessimist fears this is true.
-- James Clabell




___

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

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

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

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


How could I make the first row not to be edited or moved in UITableView

2010-04-06 Thread Kalyanraju M




How could I make the first row not to be edited or moved in UITableView
 
I know that with 
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath 
*)indexPath
the first row could be set not to move but if another cell is dropped above the 
first one this will we moved down so is moving in the end.






Thanks in advance for your help



___

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

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

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

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


NSPopUpButton items disabled

2010-04-06 Thread Frédéric Testuz
Hi,

I have a pulldown button (NSPopUpButton) in an accessory view of a save panel. 
Before displaying the panel, I populate the popup with the name of the recent 
documents. My question is about the enable state of the pulldown menu items.

In IB, I connect the action of the popup to a controller. But the items stays 
disabled. If I set autoEnabled to NO, the items are enabled and the action 
method is called.

Is disabling autoEnabled is the only way to go? I thought that the automatic 
validation should enable the items because the action seems to work.

Frédéric___

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: Wondering about that iPad page curling

2010-04-06 Thread Laurent Daudelin
Thanks, Alex.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

On Apr 6, 2010, at 09:10, Alex Kac wrote:

 Well they may have done it with a private API for CoreImage if that exists 
 (not sure). THey may have done it with OpenGL. They may have taken their 
 CoreImage code on desktop and ported a part of it to iBooks and used that. 
 
 For you, most likely the best way to do it is using OpenGL.
 
 On Apr 6, 2010, at 10:56 AM, Laurent Daudelin wrote:
 
 So, no other response from the regular crowd of resident experts on how 
 Apple engineers did this?
 
 -Laurent.
 -- 
 Laurent Daudelin
 AIM/iChat/Skype:LaurentDaudelin  
 http://nemesys.dyndns.org
 Logiciels Nemesys Software   
 laurent.daude...@gmail.com
 Photo Gallery Store: 
 http://laurentdaudelin.shutterbugstorefront.com/g/galleries
 
 On Apr 5, 2010, at 18:32, Alex Kac wrote:
 
 Except CIFilter doesn't exist on the iPad in a public SDK setting.
 
 On Apr 5, 2010, at 8:22 PM, Laurent Daudelin wrote:
 
 On Apr 5, 2010, at 18:02, Graham Cox wrote:
 
 CIFilter has a page curl transition effect. Just map the 't' value to the 
 mouse/finger location.
 
 --Graham
 
 
 On 06/04/2010, at 10:55 AM, Laurent Daudelin wrote:
 
 I got my hands on an iPad today. I was really impressed with the 
 built-in book reader. When you flip the page while holding your finger 
 down, the page will curl and follow your finger. Very impressive! 
 Anybody has any idea how one would be able to achieve such 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 arch...@mail-archive.com


Re: Using Core Data ManagedObjectIDs to uniquely name files

2010-04-06 Thread Ken Tabb

Hi Sean,

thanks for the reply. Aye I'd thought of packaging it all up in a  
package so that only deliberate saboteurs could harm the integrity of  
my lovely lovely app. In terms of UUIDs, I think you're right, it'll  
be safer - or rather I'll know that it's definitely my fault if it  
isn't working, rather than trying to figure out if the Core Data  
objectID naming system has changed between versions!


Thanks for your help,
Ken


On 6 Apr 2010, at 4:17, Sean McBride wrote:


On Tue, 6 Apr 2010 12:27:18 +0100, Ken Tabb said:


I have a Snow Leopard non-document based Core Data app (currently XML
based, but will be SQLite upon release). Supposing I have an entity
(Employee) that would like to store an auxiliary file (a tiff of  
their

mugshot), then as I see it I have the following options:


You could make your file format a package and store within it the  
TIFFs

and the CoreData persistent store.  You can add a 'uuid' string
attribute to your Employee entity and use that as the filename.

--

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




- - - - - - - - - -
Dr. Ken Tabb
Mac  UNIX Developer - Health  Human Sciences
Machine Vision  Neural Network researcher - School of Computer Science
University of Hertfordshire, UK


___

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 do I get a file reference w/o relying on the path?

2010-04-06 Thread Jon Pugh
At 8:43 AM -0700 4/6/10, Jon Pugh wrote:
I had to change to explicitly saving an AliasRecord in an NSData to keep track 
of a file properly.

I should probably clean up and share my code too.  This uses an alias relative 
to your home folder. The alias is stored in NSUserDefaults under the specified 
key. You probably want to retain or copy the path you get from loadPathFromKey 
since it's autoreleased or nil.

Enjoy.

Jon


- (void) savePath: (NSString*) path forKey: (NSString*) key
{
FSRef fsFile, fsHome;
AliasHandle aliasHandle;
NSString* homePath = [@~ stringByExpandingTildeInPath];
OSStatus status = FSPathMakeRef((unsigned char*)[homePath 
cStringUsingEncoding: NSUTF8StringEncoding], fsHome, NULL);
NSAssert(status == 0, @FSPathMakeRef fsHome failed);
status = FSPathMakeRef((unsigned char*)[path cStringUsingEncoding: 
NSUTF8StringEncoding], fsFile, NULL);
NSAssert(status == 0, @FSPathMakeRef failed);
OSErr err = FSNewAlias(fsHome, fsFile, aliasHandle);
NSAssert(err == noErr, @FSNewAlias failed);
NSData* aliasData = [NSData dataWithBytes: *aliasHandle length: 
GetAliasSize(aliasHandle)];
[[NSUserDefaults standardUserDefaults] setObject: aliasData forKey: 
key];
}


- (NSString*) loadPathFromKey: (NSString*) key
{
NSData* aliasData = [[NSUserDefaults standardUserDefaults] dataForKey: 
key];
int aliasLen = [aliasData length];
if (aliasLen  0)
{
FSRef fsFile, fsHome;
AliasHandle aliasHandle;
OSErr err = PtrToHand([aliasData bytes], (Handle*)aliasHandle, 
aliasLen);
NSAssert(err == noErr, @PtrToHand failed);
NSString* homePath = [@~ stringByExpandingTildeInPath];
OSStatus status = FSPathMakeRef((unsigned char*)[homePath 
cStringUsingEncoding: NSUTF8StringEncoding], fsHome, NULL);
NSAssert(status == 0, @FSPathMakeRef fsHome failed);
Boolean changed;
err = FSResolveAlias(fsHome, aliasHandle, fsFile, changed);
if (err == noErr)
{
char pathC[2*1024];
status = FSRefMakePath(fsFile, (UInt8*) pathC, 
sizeof(pathC));
NSAssert(status == 0, @FSRefMakePath failed);
return [NSString stringWithCString: pathC encoding: 
NSUTF8StringEncoding];
}
}
else
{
NSLog(@CardCollectionUserDefault was zero length);
[NSAlert alertWithMessageText: nil
defaultButton: nil
  alternateButton: nil
  otherButton: nil
informativeTextWithFormat: @CardCollectionUserDefault 
was zero length];
}
return 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: [iPhone]Is it possible for apps to use the file sharing directory?

2010-04-06 Thread Matt Neuburg
On Sun, 4 Apr 2010 18:16:14 -0700, Kyle Sluder kyle.slu...@gmail.com said:
On Sun, Apr 4, 2010 at 5:26 PM, Eli Bach eba...@gmail.com wrote:
 The 3.2 SDK is now under the 'regular' nda, as it's no longer
beta/prerelease.  It's a small 2.4 Gb download...

Historically, Scott has needed to give the go-ahead before discussion
of anything new is allowed on this list. This applies to desktop OS
releases as well as iPhone OS releases.

Anyone can read the iPad docs at Apple's site, without logging in. This is
public information, so it's open to discussion anywhere. m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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


NSPrintSavePath not working correctly?

2010-04-06 Thread Brian Postow
I'm trying to set up a print dialog, so that if the user tries to save to PDF, 
it gets a reasonable filename.

I currently have:

NSPrintInfo* pi = [NSPrintInfo sharedPrintInfo];
NSMutableDictionary *dict = [pi dictionary];
[dict setObject: name forKey: NSPrintSavePath];
[dict setObject: name forKey: @NSPrintSavePath];
NSPrintOperation *op = [pdfDoc getPrintOperationForPrintInfo:pi
   
autoRotate:YES];
[op runOperation];

the NSPrintSave field in the dictionary IS correct, but the textbox keeps 
coming up with .pdf.pdf 

any thoughts on where that's coming from?

Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

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


Trying to get data from the AB

2010-04-06 Thread Development
I am using the following: 

[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonFirstNameProperty) forKey:@First Name];
[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonLastNameProperty) forKey:@Last Name];
//
ABMutableMultiValueRef multiValue = ABRecordCopyValue(person, 
kABPersonAddressProperty);

**Crashes here*** CFDictionaryRef dict = 
ABMultiValueCopyValueAtIndex(multiValue, 0);

CFStringRef street = CFDictionaryGetValue(dict, 
kABPersonAddressStreetKey);
CFStringRef abcity = CFDictionaryGetValue(dict, 
kABPersonAddressCityKey);
CFStringRef abstate = CFDictionaryGetValue(dict, 
kABPersonAddressStateKey);
CFStringRef abzip = CFDictionaryGetValue(dict, kABPersonAddressZIPKey);
NSLog(@%@,(NSDictionary*)dict);
CFRelease(dict);
[settings setObject:(NSString *)street forKey:@City];
[settings setObject:(NSString *)abstate forKey:@State];
[settings setObject:(NSString *)abzip forKey:@Zip];
[settings setObject:(NSString *)street forKey:@Address];
//
[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonPhoneMainLabel) forKey:@Phone];
[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonPhoneWorkFAXLabel) forKey:@Fax];
[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonURLProperty) forKey:@URL];
[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonEmailProperty) forKey:@Email];
[settings setObject:(NSString *)ABRecordCopyValue(person, 
kABPersonOrganizationProperty) forKey:@Business];

To get information from the address book and insert it in to the preferences. 
But the Application is crashing when I attempt to copy the data to the 
CFDictionary.

Are there any examples of doing this I could look 
at?___

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: [iPhone]Is it possible for apps to use the file sharing directory?

2010-04-06 Thread Kyle Sluder
On Tue, Apr 6, 2010 at 11:12 AM, Matt Neuburg m...@tidbits.com wrote:
 Anyone can read the iPad docs at Apple's site, without logging in. This is
 public information, so it's open to discussion anywhere. m.

The entire reason I mentioned it is because there have been cases in
the past where, despite the documentation and devtools being public,
Scott has required us to hold off on discussing them:
http://lists.apple.com/archives/cocoa-dev//2007/Oct/msg01275.html

I'm just looking out for those who might not be aware that the rules
of this list are *not* covered by the same rules of the NDA.

--Kyle Sluder
___

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

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

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

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


Re: Wondering about that iPad page curling

2010-04-06 Thread Gleb Dolgich
http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html

-- 
Gleb Dolgich
http://pixelespressoapps.com

On 6 Apr 2010, at 16:56, Laurent Daudelin wrote:

 So, no other response from the regular crowd of resident experts on how 
 Apple engineers did this?
 
 -Laurent.
 -- 
 Laurent Daudelin
 AIM/iChat/Skype:LaurentDaudelin   
 http://nemesys.dyndns.org
 Logiciels Nemesys Software
 laurent.daude...@gmail.com
 Photo Gallery Store: 
 http://laurentdaudelin.shutterbugstorefront.com/g/galleries
 
 On Apr 5, 2010, at 18:32, Alex Kac wrote:
 
 Except CIFilter doesn't exist on the iPad in a public SDK setting.
 
 On Apr 5, 2010, at 8:22 PM, Laurent Daudelin wrote:
 
 On Apr 5, 2010, at 18:02, Graham Cox wrote:
 
 CIFilter has a page curl transition effect. Just map the 't' value to the 
 mouse/finger location.
 
 --Graham
 
 
 On 06/04/2010, at 10:55 AM, Laurent Daudelin wrote:
 
 I got my hands on an iPad today. I was really impressed with the built-in 
 book reader. When you flip the page while holding your finger down, the 
 page will curl and follow your finger. Very impressive! Anybody has any 
 idea how one would be able to achieve such effect?
 
 
 It's that easy?
 
 -Laurent.
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/gleb%40proggle.com
 
 This email sent to g...@proggle.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: Wondering about that iPad page curling

2010-04-06 Thread glenn andreas
That relies on undocumented private APIs, which is both off topic for this 
list, and, more importantly, grounds for getting your app rejected when 
submitted to the AppStore.


On Apr 6, 2010, at 2:00 PM, Gleb Dolgich wrote:

 http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html
 
 -- 
 Gleb Dolgich
 http://pixelespressoapps.com
 
 On 6 Apr 2010, at 16:56, Laurent Daudelin wrote:
 
 So, no other response from the regular crowd of resident experts on how 
 Apple engineers did this?

Glenn Andreas  gandr...@gandreas.com 
The most merciful thing in the world ... is the inability of the human mind to 
correlate all its contents - HPL

___

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: Wondering about that iPad page curling

2010-04-06 Thread Alex Kac
Although from the comments it seems to have garnered a job offer from Apple on 
the Core Animation team. Kind of interesting really.

On Apr 6, 2010, at 2:26 PM, glenn andreas wrote:

 That relies on undocumented private APIs, which is both off topic for this 
 list, and, more importantly, grounds for getting your app rejected when 
 submitted to the AppStore.
 
 
 On Apr 6, 2010, at 2:00 PM, Gleb Dolgich wrote:
 
 http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html
 
 -- 
 Gleb Dolgich
 http://pixelespressoapps.com
 
 On 6 Apr 2010, at 16:56, Laurent Daudelin wrote:
 
 So, no other response from the regular crowd of resident experts on how 
 Apple engineers did this?
 
 Glenn Andreas  gandr...@gandreas.com 
 The most merciful thing in the world ... is the inability of the human mind 
 to correlate all its contents - HPL
 
 ___
 
 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/alex%40webis.net
 
 This email sent to a...@webis.net

Alex Kac - President and Founder
Web Information Solutions, Inc.

The optimist proclaims that we live in the best of all possible worlds; and 
the pessimist fears this is true.
-- James Clabell




___

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


NSImageView Will Not Alias Images

2010-04-06 Thread Chris Tracewell
I am trying to get NSImageView to alias dropped images, but it  
refuses. Just spent an hour looking and trying several variations to  
no avail. Here's what I have done in a subclass of NSImageView.


-(void)drawRect:(NSRect)rect
{   
	[[NSGraphicsContext currentContext]  
setImageInterpolation:NSImageInterpolationHigh];

[[NSGraphicsContext currentContext] setShouldAntialias:YES];

[super drawRect:rect];
}

I have assigned the ImageView in IB my subclass and used NSLog to  
verify that it is drawing through the above drawRect method of my  
subclass - but the images (PNG screen captures) will not alias.


Any suggestions?
___

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: Alternative Location of Cocoa ID3 Framework??

2010-04-06 Thread Jens Alfke


On Apr 5, 2010, at 9:10 PM, Chase Meadors wrote:

I've been searching google for a while, and have repeatedly stumbled  
across mention of an Objective-C ID3 framework


I looked at it a while back and might still have a copy somewhere;  
I'll look for it.


What do you need the tags for? If you just want read-only access to  
the basic tags (track name, artist, album...) you can use either  
Spotlight or QuickTime APIs to get those. But if you want arbitrary  
tags, or the ability to change tags, then yeah, you'd want that  
framework.


—Jens___

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: Implied use of Properties

2010-04-06 Thread Klaus Backert


On 6 Apr 2010, at 16:19, Dave wrote:

Also as far as I can see, there are a couple of draw-backs to doing  
it this way. In the example:


-(ClassY*) mClassY
{
if (mClassY == nil)
{
mClassY = [[ClassY alloc] initWithData:someData]:
}
return mClassY;
}

The reasons I don't like this are:

1.  someData is hardwired and it's impossible to pass a parameter  
to mClassY since it's a getter.


Yes, and in the OpenGL example a gave, there is indeed something  
hardwired: the attributes of the pixel format the OpenGL context is  
built upon -- which is no problem for this kind of application.


2.  If either the alloc or initWithData methods fail there is no way  
to pass the error back to the caller except by passing nil as the  
Class Selector. And if this were done in a statement like:


self.mClassY. mClassYValue = someValue;

I'm not sure what would happen but it wouldn't be good news!


After getting the OpenGL context property, I always have an assertion  
in the debug configuration (see below). And I almost never concatenate  
several invocations of methods, including properties. For debugging  
purposes I have a lot of assertions in between (may be, I'm a little  
bit paranoid, but, well, what would you expect from a mathematician ;-).


@interface MyCustomView : NSView
{
@private
NSOpenGLContext * mContext;
}
...
@property (readonly, retain) NSOpenGLContext *myContext;
...
@end

@implementation MyCustomView
...
@dynamic myContext;
...
- (NSOpenGLContext *) myContext
{
if (mContext == nil)
{
		mContext = [[NSOpenGLContext alloc] initWithFormat:  
self.myPixelFormat shareContext: nil];

}
return mContext;
}
...
- (void)mySomethingOne
{
NSOpenGLContext *theContext = self. myContext;
MY_ASSERT(theContext != nil);
...
}
- (void)mySomethingTwo
{
NSOpenGLContext *theContext = self. myContext;
MY_ASSERT(theContext != nil);
...
}
@end

There is, of course, a release (and setting to nil) in dealloc, in  
order to balance the retain by alloc-init.


Whatever is called first, mySomethingOne or mySomethingTwo, the  
context is created at that point during the execution.



-(ClassY*) SetmClassY (ClassY* theClassY)



This should be

- (void)setmClassY: (ClassY *)theClassY

regards
Klaus

___

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: NSImageView Will Not Alias Images

2010-04-06 Thread Jens Alfke


On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote:

I am trying to get NSImageView to alias dropped images, but it  
refuses.


Nitpick: you mean antialias. Aliasing is what creates the jaggies,  
antialiasing smooths them away.


Just spent an hour looking and trying several variations to no  
avail. Here's what I have done in a subclass of NSImageView.


I remember having to deal with this too, years ago. It's too bad  
AppKit hasn't added support for this yet :(


The problem is that NSImageView internally keeps a scaled copy of the  
image. So the actual scaling that creates the aliasing isn't done in  
the drawRect: method at all.


I can't remember now how I solved this. I may hve re-implemented - 
drawRect: completely, i.e. added the code to draw [self image] into  
[self bounds] and not called super. Another possibility is to override  
-setImage: and keep the original image yourself in a new ivar, scale  
it down smoothly, and call [super setImage:] with the smooth-scaled  
version.


—Jens___

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: Trying to get data from the AB

2010-04-06 Thread Jens Alfke


On Apr 6, 2010, at 11:48 AM, Development wrote:

	ABMutableMultiValueRef multiValue = ABRecordCopyValue(person,  
kABPersonAddressProperty);
	**Crashes here*** CFDictionaryRef dict =  
ABMultiValueCopyValueAtIndex(multiValue, 0);


Did you check whether 'multiValue' is NULL? CF-based APIs don't like  
NULL inputs.


Also, do you know that there is an Objective-C AB API too? There's no  
reason to use the C API in a Cocoa app.


—Jens___

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


iPhone Programming For OS X Coders?

2010-04-06 Thread Jens Alfke
I have to confess that I haven't yet learned UIKit. The bits of iPhone  
development I've done so far have used networking and crypto APIs, and  
CoreAnimation, but hardly any of the UIKit classes.


What would be the best book for me to learn from? Obviously most of  
the books out there don't assume you know Objective-C or Foundation or  
even Xcode, and will take time teaching those. I'd rather not have to  
buy or skim through stuff like that. Are there any books that assume  
you already know Cocoa programming and just cover what's different on  
the iPhone OS?


—Jens___

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: Trying to get data from the AB

2010-04-06 Thread Development
There is??
OMG, I forgot to mention I'm on iPhone.



On Apr 6, 2010, at 3:00 PM, Jens Alfke wrote:

 
 On Apr 6, 2010, at 11:48 AM, Development wrote:
 
  ABMutableMultiValueRef multiValue = ABRecordCopyValue(person, 
 kABPersonAddressProperty);
  **Crashes here*** CFDictionaryRef dict = 
 ABMultiValueCopyValueAtIndex(multiValue, 0);
 
 Did you check whether 'multiValue' is NULL? CF-based APIs don't like NULL 
 inputs.
 
 Also, do you know that there is an Objective-C AB API too? There's no reason 
 to use the C API in a Cocoa app.
 
 —Jens

___

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: iPhone Programming For OS X Coders?

2010-04-06 Thread Jack Nutting
On Wed, Apr 7, 2010 at 12:29 AM, Jens Alfke j...@mooseyard.com wrote:
 I have to confess that I haven't yet learned UIKit. The bits of iPhone
 development I've done so far have used networking and crypto APIs, and
 CoreAnimation, but hardly any of the UIKit classes.

 What would be the best book for me to learn from? Obviously most of the
 books out there don't assume you know Objective-C or Foundation or even
 Xcode, and will take time teaching those. I'd rather not have to buy or skim
 through stuff like that. Are there any books that assume you already know
 Cocoa programming and just cover what's different on the iPhone OS?

I don't know of any books like that, unfortunately.  However, in my
opinion, there are really just a couple of critical things that
anybody coming from Cocoa needs to learn in order to handle Cocoa
Touch well:  The usage of UIViewControllers (which basically take the
place of a window controllers/delegates in Cocoa), including the
special view controllers in UIKit that exist only to organize other
controllers into tabs and navigation trees; And the proper use of
UITableView (which you'll often use to display all sorts of things,
even things that don't feel tabular, just because it makes it easy
to deal with arbitrary large lists of things that may need to scroll)
and UITableViewCell, which is both more limited than its Cocoa
equivalent in some ways (tables only have a single column, so the cell
must fill the entire width) and more flexible in others (since it's a
full-fledged subclass of UIView, you can easily display *anything* in
there).

All of these are pretty well documented by Apple.  Good luck!

-- 
// jack
// http://nuthole.com
// http://learncocoa.org
___

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

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

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

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


Re: iPhone Programming For OS X Coders?

2010-04-06 Thread Bob Estes
I think Dave Mark's iPhone programming books are just what you want.

On Apr 6, 2010, at 6:29 PM, Jens Alfke wrote:

 I have to confess that I haven't yet learned UIKit. The bits of iPhone 
 development I've done so far have used networking and crypto APIs, and 
 CoreAnimation, but hardly any of the UIKit classes.
 
 What would be the best book for me to learn from? Obviously most of the books 
 out there don't assume you know Objective-C or Foundation or even Xcode, and 
 will take time teaching those. I'd rather not have to buy or skim through 
 stuff like that. Are there any books that assume you already know Cocoa 
 programming and just cover what's different on the iPhone OS?
 
 —Jens___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.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


Tricky binding and continuous update problem

2010-04-06 Thread Chris Idou


I've got a problem that I had working, but my app suddenly seems broken, and 
I'm not sure if I did something or what. All I know is old versions of my app 
work, but now my code base doesn't.

I've got a UI with a NSTableView at the top, and some individual fields at the 
bottom. Typical UI where you click on a table row and it shows you the values 
in the fields.

Now one of the fields shown in the table is a derived value from the base 
fields. I have continuous update values set in the NSTextField at the bottom. 
So what I expect as you type in the field, the value in the table gets 
continuously updated also. (I'm using keyPathsForValuesAffecting etc for 
the derived field).

But what's happening is if I type in the lower field, the value gets sent to 
the derived field in the table, but then Text field gets immediately set back 
to the original value. So the effect is you type one character and it is lost 
as far as the lower field is concerned, but the derived value in the table is 
updated. You can only ever change one character. And also the lower text field 
loses focus.

I've put break points in all the setters and getters, and there seems like no 
reason for this odd behavior. I can't see how the field would get set back to 
the old value.

If I turn off Continuously  Update Value, it works sensibly, albeit not as nice 
since you've got to exit the field to have everything in synch.

Any thoughts?




___

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: iPhone Programming For OS X Coders?

2010-04-06 Thread David Rowland

On Apr 6, 2010, at 3:29 PM, Jens Alfke wrote:

 I have to confess that I haven't yet learned UIKit. The bits of iPhone 
 development I've done so far have used networking and crypto APIs, and 
 CoreAnimation, but hardly any of the UIKit classes.
 
 What would be the best book for me to learn from? Obviously most of the books 
 out there don't assume you know Objective-C or Foundation or even Xcode, and 
 will take time teaching those. I'd rather not have to buy or skim through 
 stuff like that. Are there any books that assume you already know Cocoa 
 programming and just cover what's different on the iPhone OS?

For starters take a look at,

http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CocoaFundamentals/WhatIsCocoa/WhatIsCocoa.html#//apple_ref/doc/uid/TP40002974-CH3-SW16

About halfway down is a discussion of Foundation Classes and a diagram showing 
which are implemented in MacOSX and iPhone OS.

Farther down are discussions of Application Kit and UIKit with diagrams showing 
their implementations. ___

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: NSImageView Will Not Alias Images

2010-04-06 Thread Ken Ferry
On Tue, Apr 6, 2010 at 2:58 PM, Jens Alfke j...@mooseyard.com wrote:


 On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote:

  I am trying to get NSImageView to alias dropped images, but it refuses.


 Nitpick: you mean antialias. Aliasing is what creates the jaggies,
 antialiasing smooths them away.


  Just spent an hour looking and trying several variations to no avail.
 Here's what I have done in a subclass of NSImageView.


 I remember having to deal with this too, years ago. It's too bad AppKit
 hasn't added support for this yet :(

 The problem is that NSImageView internally keeps a scaled copy of the
 image. So the actual scaling that creates the aliasing isn't done in the
 drawRect: method at all.


This was once true, but is out of date.  I'd like to see a test app.  For
example, how do you know you aren't getting antialiasing?  It may be that
you just don't like the output. :-)

It would also be good to know what OS you are working on.

-Ken


 I can't remember now how I solved this. I may hve re-implemented -drawRect:
 completely, i.e. added the code to draw [self image] into [self bounds] and
 not called super. Another possibility is to override -setImage: and keep the
 original image yourself in a new ivar, scale it down smoothly, and call
 [super setImage:] with the smooth-scaled version.

___

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: Wondering about that iPad page curling

2010-04-06 Thread Kiel Gillard
Can UIViewAnimationTransitionCurlUp/Down be of any use?

On 07/04/2010, at 2:10 AM, Alex Kac wrote:

 Well they may have done it with a private API for CoreImage if that exists 
 (not sure). THey may have done it with OpenGL. They may have taken their 
 CoreImage code on desktop and ported a part of it to iBooks and used that. 
 
 For you, most likely the best way to do it is using OpenGL.
 
 On Apr 6, 2010, at 10:56 AM, Laurent Daudelin wrote:
 
 So, no other response from the regular crowd of resident experts on how 
 Apple engineers did this?
 
 -Laurent.
 -- 
 Laurent Daudelin
 AIM/iChat/Skype:LaurentDaudelin  
 http://nemesys.dyndns.org
 Logiciels Nemesys Software   
 laurent.daude...@gmail.com
 Photo Gallery Store: 
 http://laurentdaudelin.shutterbugstorefront.com/g/galleries
 
 On Apr 5, 2010, at 18:32, Alex Kac wrote:
 
 Except CIFilter doesn't exist on the iPad in a public SDK setting.
 
 On Apr 5, 2010, at 8:22 PM, Laurent Daudelin wrote:
 
 On Apr 5, 2010, at 18:02, Graham Cox wrote:
 
 CIFilter has a page curl transition effect. Just map the 't' value to the 
 mouse/finger location.
 
 --Graham
 
 
 On 06/04/2010, at 10:55 AM, Laurent Daudelin wrote:
 
 I got my hands on an iPad today. I was really impressed with the 
 built-in book reader. When you flip the page while holding your finger 
 down, the page will curl and follow your finger. Very impressive! 
 Anybody has any idea how one would be able to achieve such effect?
 
 
 It's that easy?
 
 -Laurent.
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
 
 This email sent to a...@webis.net
 
 Alex Kac - President and Founder
 Web Information Solutions, Inc.
 
 The optimist proclaims that we live in the best of all possible worlds; and 
 the pessimist fears this is true.
 -- James Clabell
 
 
 
 
 ___
 
 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/kiel.gillard%40gmail.com
 
 This email sent to kiel.gill...@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: NSImageView Will Not Alias Images

2010-04-06 Thread Chris Tracewell


On Apr 6, 2010, at 4:50 PM, Ken Ferry wrote:



On Tue, Apr 6, 2010 at 2:58 PM, Jens Alfke j...@mooseyard.com wrote:

On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote:

I am trying to get NSImageView to alias dropped images, but it  
refuses.


Nitpick: you mean antialias. Aliasing is what creates the jaggies,  
antialiasing smooths them away.



Just spent an hour looking and trying several variations to no  
avail. Here's what I have done in a subclass of NSImageView.


I remember having to deal with this too, years ago. It's too bad  
AppKit hasn't added support for this yet :(


The problem is that NSImageView internally keeps a scaled copy of  
the image. So the actual scaling that creates the aliasing isn't  
done in the drawRect: method at all.


This was once true, but is out of date.  I'd like to see a test  
app.  For example, how do you know you aren't getting antialiasing?   
It may be that you just don't like the output. :-)


Well - NSImageInterpolationHigh and NSImageInterpolationNone produce  
the same exact result - screen shot copy (control-command-shift-4) the  
imageView built once using NSImageInterpolationHigh  and once using  
NSImageInterpolationNone then paste each into a Photoshop layer, align  
them perfectly and then turn the top layer off and on at 800% and  
there is not a single pixel that moves or changes color.


The dropped image is roughly 1000 x 1000 (a screen shot PNG) and the  
imageView size is 200x200


To make sure the currentContext was correct - I log  
[[NSGraphicsContext currentContext] imageInterpolation] for each build  
and it shows the correct values 3 and 1 respectively. And then just to  
be super sure I I log [[NSGraphicsContext currentContext]  
isDrawingToScreen] inside drawRect of my NSImageView subclass and get  
YES.


I did implement my own image sizing in drawRect and then used [self  
setImage] and it works great. Not sure what could be the issue.




It would also be good to know what OS you are working on.

-Ken



I'm using 10.5.8. - XCode   3.1.2 - iMac Core 2 Duo and the app is GC.
___

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: Problems with repetetive execution of netstat using NSTask and NSTimer

2010-04-06 Thread Adam R. Maxwell

On Apr 6, 2010, at 12:08 PM, Kazior Fukacz wrote:

 Thanks for your answers!
 
 By the way, are you using garbage collection?  If not, then you're leaking 
 several objects (those pointed to by 'netstat', 'pipe', and 'string').
 
 Yeah, I suspect that the pipes (and corresponding NSFileHandles) are indeed 
 leaking, and that's the real problem.  You may also want to create and 
 launch NSTask instances inside an exception handler, since it and 
 NSFileHandle/NSPipe can raise some unexpected exceptions.
 
 I'm coding under Tiger using XCode 2.5. As far as I know garbage collection 
 was introduced in XCode 3 which came with Objective-C 2.0, am I right?

It was introduced with Leopard, so you are definitely leaking objects in the 
code you posted.

 Anyway, I tried putting a NSAutoreleasePool and draining it every time my 
 method finishes its work.

Randomly adding NSAutoreleasePool instances is /not/ going to help; there's no 
magic here...

 I also tried releasing the pipe manually. Still no luck.

Read Ken's message again, and combine it with reading the Cocoa memory 
management docs:

http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/MemoryMgmt/index.html

Until you fix all of the leaks, you'll have problems.  I suggesting thinking 
about who owns the NSPipes that you create; once you understand the memory 
management rules in the docs, this will make sense.

 However, putting assert(pipe != null) right before [netstat 
 setStandardOutput: pipe]; ended up with (...)/IPShowX/IPShowX.m:32: failed 
 assertion `pipe != nil'. It happened about 15 minutes after launching. This 
 might be helpful in determining what the reason of this problem might be. As 
 we can see it is NSPipe-related. Something about allocation, initialization 
 and releasing?
 
 How is it that it starts to malfunction after such amount of time?

Because the leak builds up over time until you run out of file descriptors, and 
-[NSPipe init] finally starts returning 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: Tricky binding and continuous update problem

2010-04-06 Thread Jerry Krinock

On 2010 Apr 06, at 16:36, Chris Idou wrote:

 If I turn off Continuously  Update Value, it works sensibly,

Turn it off.  Look at any of Apple's Sample Code.  Also, Cocoa Design Rule #1: 
If something is off/on by default, don't change it unless you're knowingly 
doing something weird.

 albeit not as nice since you've got to exit the field to have everything in 
 synch.

That's the way most apps work.

You did not mention using an array controller.  To insure data integrity in 
case user tabs out, abruptly closes the window, etc., do not bind directly to 
the model.  Instead, bind your text fields (detail views) to an 
NSArrayController to which the table columns are also bound.  As a matter of 
fact, if you didn't use an array controller, you'd better look at Apple's 
DepartmentAndEmployees sample code and be prepared for a little re-work.  There 
may be a way to make it work without an array controller, but why bother?

The way I understand it, the NSArrayController superclass NSObjectController 
fulfills the same purpose of data integrity if you can't bind to an array 
controller, for example if you have an Inspector in another nib.  
NSObjectController seems like a heavy weight for this purpose, but it works.  
For an example of this, in DepartmentAndEmployees's MyDocument.nib, look at the 
NSObjectController named 'Department Controller'.  It seems like it's useless 
but it's not.

Probably someone else can give a more in-depth explanation.

___

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: Tricky binding and continuous update problem

2010-04-06 Thread Chris Idou


I am using an NSArrayController.

I don't know, it seems to me like having everything always in synch is nicer. 
The user can see immediately how changing one field is affecting the other. And 
it used to work.



- Original Message 
From: Jerry Krinock je...@ieee.org
To: Chris Idou idou...@yahoo.com
Sent: Wed, 7 April, 2010 10:24:18 AM
Subject: Re: Tricky binding and continuous update problem


On 2010 Apr 06, at 16:36, Chris Idou wrote:

 If I turn off Continuously  Update Value, it works sensibly,

Turn it off.  Look at any of Apple's Sample Code.  Also, Cocoa Design Rule #1: 
If something is off/on by default, don't change it unless you're knowingly 
doing something weird.

 albeit not as nice since you've got to exit the field to have everything in 
 synch.

That's the way most apps work.

You did not mention using an array controller.  To insure data integrity in 
case user tabs out, abruptly closes the window, etc., do not bind directly to 
the model.  Instead, bind your text fields (detail views) to an 
NSArrayController to which the table columns are also bound.  As a matter of 
fact, if you didn't use an array controller, you'd better look at Apple's 
DepartmentAndEmployees sample code and be prepared for a little re-work.  There 
may be a way to make your design paradigm work, but why bother?

The way I understand it, the NSArrayController superclass NSObjectController 
fulfills the same purpose of data integrity if you can't bind to an array 
controller, for example if you have an Inspector in another nib.  
NSObjectController seems like a heavy weight for this purpose, but it works.  
For an example of this, in DepartmentAndEmployees's MyDocument.nib, look at the 
NSObjectController named 'Department Controller'.  It seems like it's useless 
but it's not.

Probably someone else can give a more in-depth explanation.



___

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: NSImageView Will Not Alias Images

2010-04-06 Thread Laurent Daudelin

On Apr 6, 2010, at 17:24, Chris Tracewell wrote:

 On Apr 6, 2010, at 4:50 PM, Ken Ferry wrote:
 
 
 On Tue, Apr 6, 2010 at 2:58 PM, Jens Alfke j...@mooseyard.com wrote:
 
 On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote:
 
 I am trying to get NSImageView to alias dropped images, but it refuses.
 
 Nitpick: you mean antialias. Aliasing is what creates the jaggies, 
 antialiasing smooths them away.
 
 
 Just spent an hour looking and trying several variations to no avail. Here's 
 what I have done in a subclass of NSImageView.
 
 I remember having to deal with this too, years ago. It's too bad AppKit 
 hasn't added support for this yet :(
 
 The problem is that NSImageView internally keeps a scaled copy of the image. 
 So the actual scaling that creates the aliasing isn't done in the drawRect: 
 method at all.
 
 This was once true, but is out of date.  I'd like to see a test app.  For 
 example, how do you know you aren't getting antialiasing?  It may be that 
 you just don't like the output. :-)
 
 Well - NSImageInterpolationHigh and NSImageInterpolationNone produce the same 
 exact result - screen shot copy (control-command-shift-4) the imageView built 
 once using NSImageInterpolationHigh  and once using NSImageInterpolationNone 
 then paste each into a Photoshop layer, align them perfectly and then turn 
 the top layer off and on at 800% and there is not a single pixel that moves 
 or changes color.
 
 The dropped image is roughly 1000 x 1000 (a screen shot PNG) and the 
 imageView size is 200x200
 
 To make sure the currentContext was correct - I log [[NSGraphicsContext 
 currentContext] imageInterpolation] for each build and it shows the correct 
 values 3 and 1 respectively. And then just to be super sure I I log 
 [[NSGraphicsContext currentContext] isDrawingToScreen] inside drawRect of my 
 NSImageView subclass and get YES.
 
 I did implement my own image sizing in drawRect and then used [self setImage] 
 and it works great. Not sure what could be the issue.

Funny you're mentioning this problem as I've been trying to get a thumbnail 
icon of a pdf document and I get pretty much the same results. It doesn't seem 
to matter whether I use NSInterpolationHigh or NSInterpolationNone, at least I 
couldn't see any difference in the resulting image in Preview even when 
magnified.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

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: Tricky binding and continuous update problem

2010-04-06 Thread Kyle Sluder
On Tue, Apr 6, 2010 at 5:28 PM, Chris Idou idou...@yahoo.com wrote:
 I don't know, it seems to me like having everything always in synch is nicer. 
 The user can see immediately how changing one field is affecting the other. 
 And it used to work.

That will wreak havoc with Undo. Continuously updating values is not
pretty, and it's not how text fields behave on the Mac. Rich text does
behave as you describe, but you can't use bindings for that.

Avoid fighting the framework. ;-)

--Kyle Sluder
___

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

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

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

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


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-06 Thread Chase Meadors
I'd much appreciate it if you would look. That's precisely the purpose  
I need it for;  to edit  change tags.


Thanks a lot - Chase.

On Apr 6, 2010, at 4:36 PM, Jens Alfke wrote:



On Apr 5, 2010, at 9:10 PM, Chase Meadors wrote:

I've been searching google for a while, and have repeatedly  
stumbled across mention of an Objective-C ID3 framework


I looked at it a while back and might still have a copy somewhere;  
I'll look for it.


What do you need the tags for? If you just want read-only access to  
the basic tags (track name, artist, album...) you can use either  
Spotlight or QuickTime APIs to get those. But if you want arbitrary  
tags, or the ability to change tags, then yeah, you'd want that  
framework.


—Jens


___

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: Tricky binding and continuous update problem

2010-04-06 Thread Chris Idou


How does it wreak havoc with undo? Undo seems to work still. In something like 
TextExpander, you change the textfield where your expansion goes, and the table 
in the left hand side changes as you type. That's what I was aiming for.

But I've found why it suddenly stopped working. I stumbled upon the URL below. 
Apparently the Automatically rearrange content for the NSArrayController 
makes this all go awry. It seems like I can choose between auto rearrange 
content, or continuously update values, but not both. Don't know if this is a 
bug or if there is some reason for it.


http://stackoverflow.com/questions/1028700/core-data-strange-bindings-error-on-re-opening-a-document-help




- Original Message 
From: Kyle Sluder kyle.slu...@gmail.com
To: Chris Idou idou...@yahoo.com
Cc: Jerry Krinock je...@ieee.org; cocoa-dev@lists.apple.com
Sent: Wed, 7 April, 2010 11:21:28 AM
Subject: Re: Tricky binding and continuous update problem

On Tue, Apr 6, 2010 at 5:28 PM, Chris Idou idou...@yahoo.com wrote:
 I don't know, it seems to me like having everything always in synch is nicer. 
 The user can see immediately how changing one field is affecting the other. 
 And it used to work.

That will wreak havoc with Undo. Continuously updating values is not
pretty, and it's not how text fields behave on the Mac. Rich text does
behave as you describe, but you can't use bindings for that.

Avoid fighting the framework. ;-)

--Kyle Sluder





___

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

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

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

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


Re: iPhone Programming For OS X Coders?

2010-04-06 Thread Henry McGilton

On Apr 6, 2010, at 3:29 PM, Jens Alfke wrote:

 I have to confess that I haven't yet learned UIKit. The bits of iPhone 
 development I've done so far have used networking and crypto APIs, and 
 CoreAnimation, but hardly any of the UIKit classes.
 
 What would be the best book for me to learn from? Obviously most of the books 
 out there don't assume you know Objective-C or Foundation or even Xcode, and 
 will take time teaching those. I'd rather not have to buy or skim through 
 stuff like that. Are there any books that assume you already know Cocoa 
 programming and just cover what's different on the iPhone OS?


As Bob Estes said, the Dave Mark / Jeff LeMarche books are pretty good.

Apart from that, 

o   the programming concepts of the iPhone focus on presenting single screens 
of content
o   each screen of content is represented by a single UIView that is the root 
of a view hierarchy
o   each of those single views is in turn managed by a UIViewController or one 
of its sub-classes
o   there are various schemes for navigating between screens

So the architecture of a good iPhone application is determined by the screens 
of content and the
transitions between them.The logic of those transitions will end up being 
implemented via a network
of View Controllers.

Two of the primary navigation schemes are implemented by UITabBarController and 
UINavigationController
(usually in conjunction with a UITableViewController).

You see UITabBarController in action in the iPhone World Clock application.

You see UINavigationController (with UITableViewController) in the iPhone 
Settings application (and
many others).

The iPhone Weather application shows another navigational scheme known as Page 
Control, which
uses a UIScrollView as a 'paging' mechanism, and there's a UIPageControl widget 
on the bottom to
navigate that way if you wish to.

There's no NSBezierPath parallel on the phone, so you get down into Core 
Graphics a lot more than
with Appkit.

Core Data is available.  The phone does not have bindings, but does have KVC 
and KVO.

There's a lot more, of course, but you'll find many more similarities than 
differences (apart from 
UIWindow being a sub-class of UIView . . .). 

I think the UIKit team did a great job in 'lowering the barriers to entry' (to 
speak like a marketroid).

Cheers,
. . . . . . . .Henry___

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: NSImageView Will Not Alias Images

2010-04-06 Thread Ken Ferry
On Tue, Apr 6, 2010 at 5:24 PM, Chris Tracewell ch...@thinkcl.com wrote:


 On Apr 6, 2010, at 4:50 PM, Ken Ferry wrote:


 On Tue, Apr 6, 2010 at 2:58 PM, Jens Alfke j...@mooseyard.com wrote:


 On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote:

  I am trying to get NSImageView to alias dropped images, but it refuses.


 Nitpick: you mean antialias. Aliasing is what creates the jaggies,
 antialiasing smooths them away.


  Just spent an hour looking and trying several variations to no avail.
 Here's what I have done in a subclass of NSImageView.


 I remember having to deal with this too, years ago. It's too bad AppKit
 hasn't added support for this yet :(

 The problem is that NSImageView internally keeps a scaled copy of the
 image. So the actual scaling that creates the aliasing isn't done in the
 drawRect: method at all.


 This was once true, but is out of date.  I'd like to see a test app.  For
 example, how do you know you aren't getting antialiasing?  It may be that
 you just don't like the output. :-)


 Well - NSImageInterpolationHigh and NSImageInterpolationNone produce the
 same exact result - screen shot copy (control-command-shift-4)
 the imageView built once using NSImageInterpolationHigh  and once
 using NSImageInterpolationNone then paste each into a Photoshop layer, align
 them perfectly and then turn the top layer off and on at 800% and there is
 not a single pixel that moves or changes color.

 The dropped image is roughly 1000 x 1000 (a screen shot PNG) and the
 imageView size is 200x200

 To make sure the currentContext was correct - I log [[NSGraphicsContext
 currentContext] imageInterpolation] for each build and it shows the correct
 values 3 and 1 respectively. And then just to be super sure I I
 log [[NSGraphicsContext currentContext] isDrawingToScreen] inside drawRect
 of my NSImageView subclass and get YES.

 I did implement my own image sizing in drawRect and then used [self
 setImage] and it works great. Not sure what could be the issue.


 It would also be good to know what OS you are working on.

 -Ken



 I'm using 10.5.8. - XCode  3.1.2 - iMac Core 2 Duo and the app is GC.


What Jens is saying is probably true in 10.5, not in 10.6.  Nevertheless, I
would be interested to see a test app.

-Ken
Cocoa Frameworks
___

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


multiple-page print support in NSView

2010-04-06 Thread Rua Haszard Morris
I am trying to write an NSView subclass to render a multi-page printout. What I 
would like is to use the page/paper size in calculating the dimensions of each 
page; for example, if the printout is made up of N rows of items, each item 
rendering as 60-point-tall row.

So, assuming 10 rows of items, the rendered view needs to be 10 * 60 pt high, 
and the page boundaries need to be set appropriately - if the usable paper area 
is 120 points high, then we need 5 pages of 2 rows, and if the user specifies 
much larger paper, e.g. 240 points, then we need 3 pages, each with up to 4 
rows (the last page only having two rows).

How do I implement knowsPageRange, rectForPage, and locationOfPrintRect to 
achieve this?

I have tried implementing these methods to set up arbitrary rectangles for each 
page, and I find that the rendering I do in drawRect is scaled weirdly in the 
printout, with a huge (half the page) right margin and an even huger (more than 
half the page, proportional to the total number of pages) top margin.

A possibly related issue is that the view doesn't know it's actual size (i.e. 
frame) until it has rendered itself, because of the number of items, and the 
possibility of large items that take up more than a single row. There may be an 
interaction between a size given to the view at init time (if it isn't given a 
size then it doesn't render anything in the printout) and the actual size of 
the complete printout.

In general my problems involve the relationship between page coordinates and 
view coordinates - if I can relate these two sizes appropriately then I might 
be able to get somewhere.

Is there sample code or a tutorial somewhere that explains how to set up custom 
page coordinates? I have read through Printing Programming Topics for Cocoa, 
and it seems I'm missing something critical here.

Thanks
Rua HM.___

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: iPhone Programming For OS X Coders?

2010-04-06 Thread Philip Mobley
On Apr 6, 2010, at 7:06 PM, Henry McGilton wrote:

 There's no NSBezierPath parallel on the phone, so you get down into Core 
 Graphics a lot more than with Appkit.

iPhone 3.2 SDK just added UIBezierPath, but the 3.2 OS will only run on iPad 
right now.  Who knows if the iPhone will ever run 3.2 OS or if they will just 
wait until 4.0.

___

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: iPhone Programming For OS X Coders?

2010-04-06 Thread Kyle Sluder
On Tue, Apr 6, 2010 at 9:42 PM, Philip Mobley p...@dreystone.com wrote:
 iPhone 3.2 SDK just added UIBezierPath, but the 3.2 OS will only run on iPad 
 right now.  Who knows if the iPhone will ever run 3.2 OS or if they will just 
 wait until 4.0.

I imagine we'll find out on Thursday.

--Kyle Sluder
___

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

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

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

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


Xcode build settings (such as llvm-config)

2010-04-06 Thread Samuel Williams
Hello,

I want to execute a command to get a list of libraries for inclusion into my 
application

llvm-config --libs

Gives me: -lLLVMXCoreCodeGen -lLLVMXCoreAsmPrinter -lLLVMXCoreInfo 
-lLLVMSystemZCodeGen -lLLVMSystemZAsmPrinter -lLLVMSystemZInfo [snip]

Normally it is used such as

export LDFLAGS=`llvm-config --libs`

or

g++ `llvm-config --libs --cflags`

I tried putting this in a Run Script build phase but it didn't work. I also 
couldn't figure out how to put this into the Build Settings.

Is it possible to do this?

Kind regards,
Samuel___

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


Localized name of trash folder

2010-04-06 Thread Aniruddha Maru
Does anyone know a way to get the localized name of the trash folder?

I tried NSFileManager's displayNameAtPath: and LSCopyDisplayNameForRef on
~/.trash, but neither of them seem to be working :(

Thanks,
Aniruddha
___

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