Code Sign verification on Leopard

2009-10-13 Thread Jakub Bednar

Hi list,

I have read CodeSigningGuide and CodeSigningRef from Apple. In the  
CodeSigningRef every method has a note, that it is available in 10.6  
and later. So I just want to make sure.


On Leopard, there is now Cocoa or other API for verifying code  
signatures. So if I want to verify e.g. that a script is really the  
one I have installed, I need to use NSTask to run codesign utility. Is  
this correct?


Thanks a lot for your answer,

Jakub
___

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

Please do not post admin requests or moderator comments to the list.
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: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Paul M

On 13/10/2009, at 7:07 PM, Sandy McGuffog wrote:


Well, that I think depends on your definition of "crappy software". :)


I think if it fails to function according to published guidelines,  
makes wrong
assumptions instead of performing a very simple test, and consequenty  
fails to

read a valid file format ... that's pretty crappy.

The practical issue for me is that that Adobe Lightroom (at least on  
the PC) won't read an RGBA TIFF file, and if one of Adobe's premier  
packages won't read the file, then the current Apple implementation of  
the TIFF writer is, practically speaking, useless to me.


Adobe should know better.
As I said above, the test is very simple. It doesn't have to read the  
4th
channel if it doesn't want to, but there is no excuse for not reading  
the

3 channels it does want.
This kind of software really annoys me because it just causes problems
and people end up blaming those problems on perfectly correct software,
in this case Apple. It's all the worse when there really is no excuse  
for

writing such poor software. Doing it properly really isn't hard and
doesn't have any significant drawbacks.
Crappy really is a very good description as far as I'm concerned.

But on to more practical matters -
I would expect that when writing a tiff file, there should be a  
mechanism
to control the output format. If there isn't, that would certainly  
warrant

a feature request.  https://bugreport.apple.com

If there is indeed no api to do this, It would be reasonable to expect  
that
the output format may be determined by the data comming in (to the  
image IO

subsystem). If CoreImage is associating an alpha channel with the image,
then try looking at CoreImage to either not add the alpha, or else to  
remove

it prior to exporting your image.
If you cannot do this with CoreImage, try looking at NSImage or other  
imaging

components (Ken suggested CGImageDestination) to see if the alpha can be
removed prior to writing it to disk. (Basicly, if you cant tell it not  
to

write the alpha, try removing the alpha then write it out - then file an
enhancement request!).


paulm


Footnote:
That an Adobe product is so "Crappy" in this regard is surprising. I'm  
not
100% cretain, but I was under the impression that Adobe owns the  
Intelectual

Property that is the TIFF standard. They certainly support and foster it
to a high degree.

Note especially this quote:
"Adobe supports TIFF issues that directly relate to Adobe products. If a
TIFF file is incompatible with an Adobe product ... our goal is to  
isolate
and understand the problem so that it may be corrected in future  
releases"

Taken from this page:
http://kb2.adobe.com/cps/000/13da4f4.html


One other possibility is that the image in question is corrupt in some  
way.

If you want to send me a sample image (preferably not too big) off list,
I can verify this.




Sandy

On Oct 12, 2009, at 11:24 PM, Paul M wrote:


On 13/10/2009, at 4:39 AM, Sandy McGuffog wrote:

Actually, that occurred under 10.5 as well - what happens is that  
some operations, it would seem those involving Core Image, cause the  
internal representation to go to RGBA. Which is fine, but there  
doesn't seem to be a way to write a plain RGB format TIFF. I had to  
incorporate a third-party TIFF module to do that, as RGBA TIFF files  
aren't very compatible with anything other than Apple.


Sandy



I think what you mean to say is "RGBA TIFF files aren't very  
compatible with

crappy software".

A tiff file has tags in the header identifying the number of colour  
planes
and their arangement within the file. Any half decent tiff importer  
will
simply skip the alpha channel, if it has no use for it, and only read  
the RGB

data.



On Oct 12, 2009, at 5:07 PM, Ken Ferry wrote:

On Mon, Oct 12, 2009 at 4:36 AM, Peter C   
wrote:


I just stumble into a feature (or a bug ?), NSImage  
TIFFRepresentation
produce RGB TIFF with a layer (when open under Photoshop).  
Previously it
produce plain RGB TIFF under OS 10.5 and below. This cause some  
part of my
programs interpret wrong RGB data, expecting 3 bytes instead of 4  
bytes for
a RGB pixel.  There is no mention in the documents about this  
"feature".


Is there a way to restore the previous behavior  of  
TIFFRepresentation ?


There's 2 ways to solve your problem.
1) Use Cocoa APIs to specify 3-plane RGB image output (I'm sorry I  
have no

further information here).
2) Throw away your crappy tiff readers and get something better.


paulm


You can look at CGImageDestination to get more options, but I don't  
think

there's anything that provides control at that level.

In many cases there _must_ be data munging between the in memory  
pixel
format and the on-disk file format.  The precise munging is not  
defined on

either input or output.

That is, don't make pixel format assumptions.  The AppKit release
notesdiscuss

how to avoid making 

Re: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Peter C
I never realize it occurred under 10.5, guess I have to dug the TIFF  
reader code and adapt reading 3 or 4 bytes depending on tag info.



On 13 Oct, 2009, at 2:07 PM, Sandy McGuffog wrote:


Well, that I think depends on your definition of "crappy software". :)

The practical issue for me is that that Adobe Lightroom (at least on  
the PC) won't read an RGBA TIFF file, and if one of Adobe's premier  
packages won't read the file, then the current Apple implementation  
of the TIFF writer is, practically speaking, useless to me.


Sandy


On Oct 12, 2009, at 11:24 PM, Paul M wrote:


On 13/10/2009, at 4:39 AM, Sandy McGuffog wrote:

Actually, that occurred under 10.5 as well - what happens is that  
some operations, it would seem those involving Core Image, cause  
the internal representation to go to RGBA. Which is fine, but  
there doesn't seem to be a way to write a plain RGB format TIFF. I  
had to incorporate a third-party TIFF module to do that, as RGBA  
TIFF files aren't very compatible with anything other than Apple.


Sandy



I think what you mean to say is "RGBA TIFF files aren't very  
compatible with

crappy software".

A tiff file has tags in the header identifying the number of colour  
planes
and their arangement within the file. Any half decent tiff importer  
will
simply skip the alpha channel, if it has no use for it, and only  
read the RGB

data.



On Oct 12, 2009, at 5:07 PM, Ken Ferry wrote:

On Mon, Oct 12, 2009 at 4:36 AM, Peter C   
wrote:


I just stumble into a feature (or a bug ?), NSImage  
TIFFRepresentation
produce RGB TIFF with a layer (when open under Photoshop).  
Previously it
produce plain RGB TIFF under OS 10.5 and below. This cause some  
part of my
programs interpret wrong RGB data, expecting 3 bytes instead of  
4 bytes for
a RGB pixel.  There is no mention in the documents about this  
"feature".


Is there a way to restore the previous behavior  of  
TIFFRepresentation ?


There's 2 ways to solve your problem.
1) Use Cocoa APIs to specify 3-plane RGB image output (I'm sorry I  
have no

further information here).
2) Throw away your crappy tiff readers and get something better.


paulm


You can look at CGImageDestination to get more options, but I  
don't think

there's anything that provides control at that level.

In many cases there _must_ be data munging between the in memory  
pixel
format and the on-disk file format.  The precise munging is not  
defined on

either input or output.

That is, don't make pixel format assumptions.  The AppKit release
notesdiscuss

how to avoid making pixel format assumptions in the section
"NSBitmapImageRep: CoreGraphics impedence matching and  
performance notes".


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


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


Getting AAC tag information

2009-10-13 Thread Sven

Hello,

I've found documentation on getting ID3 tag data from MP3s via QuickTime, 
but I'm having a hard time finding information on retrieving this data 
from AAC files.
I'd expect there to be some form of support to handle reading and writing 
of tagging data for both AAC and MP3 files.



./Sven
___

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

Please do not post admin requests or moderator comments to the list.
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


Should VM shrink to original when releasing huge memory

2009-10-13 Thread Nick Rogers

Hi,
I'm using Snow Leopard and Xcode 3.2.
When my program runs the VM grows from 50MB to around 550MB.
So when I release the memory, should VM shrink to the original 50MB,  
in this case it isn't so?


Thanks,
Nick


___

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

Please do not post admin requests or moderator comments to the list.
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


Implementing Back and Forth Control.

2009-10-13 Thread Philip Juel Borges

Hi!

In my app I have my MainMenu.xib that contains the toolbar and a  
custom view that swaps in my other 3 xib (view) files (taken from  
ViewControlller from Appple's site). Now each of the other 3 views has  
a webview and a segmented control that allows me to go back and forth  
and adding this code to the corresponding class files makes it work.


- (IBAction)controlClicked:(id)sender {
int selectedSegment = [sender selectedSegment];
int clickedSegmentTag = [[sender cell]  
tagForSegment:selectedSegment];


switch (clickedSegmentTag)
{
case 0:
[webView goBack:self];
break;

case 1:
[webView goForward:self];
break;
}
}


But it would be better to have just one segmented control in the  
toolbar that can go back and forth in any of the views that is swapped  
in.
An alternative would be to have one webview in my MainMenu.xib and let  
the other 3 views display html there, but that I don't know how to do.


I've googled this for long now and thought that perhaps this would  
work but it doens't [[webView window] goBack:self];


Any ideas on this one?

--Philip
___

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

Please do not post admin requests or moderator comments to the list.
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


NSFetchedResultController bug?

2009-10-13 Thread Alex Reynolds
I am reworking Apple's CoreDataBooks sample iPhone application to add  
five relationship-less instances of an NSManagedObject class ("Book").


When I add these to a secondary managed object context (MOC) and then  
merge these changes with the primary MOC, the application crashes with  
the following error:


	2009-10-13 02:59:12.787 MyApp[43049:207] *** Terminating app due to  
uncaught exception 'NSRangeException', reason: '*** -[NSCFArray  
objectAtIndex:]: index (7) beyond bounds (7)'


If I reopen the application, those five instances are in the data  
store and are displayed properly in the table view. As they are being  
added to the Core Data store, it looks like there is something wrong  
with the table view update process.


If I wipe the application and recompile, I get the same symptom.

If I first comment out the following line:

	[_tableView insertRowsAtIndexPaths:[NSArray  
arrayWithObject:newIndexPath]  
withRowAnimation:UITableViewRowAnimationFade];


in the NSFetchedResultController delegate method:

-controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:

then the application does not crash on the first insert. But it  
crashes on a subsequent insert attempts with the following error:


	2009-10-13 03:10:19.072 MyApp[43129:207] *** Assertion failure in - 
[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit/ 
UIKit-984.38/UITableView.m:774
	2009-10-13 03:10:19.073 MyApp[43129:207] *** Terminating app due to  
uncaught exception 'NSInternalInconsistencyException', reason:  
'Invalid update: invalid number of rows in section 0. The number of  
rows contained in an existing section after the update (2) must be  
equal to the number of rows contained in that section before the  
update (1), plus or minus the number of rows inserted or deleted from  
that section (0 inserted, 0 deleted).'


In this subsequent attempt, I am not adding any Book MOs to the  
secondary MOC, but the table view is still being refreshed. I suspect  
this is because  -insertRowsAtIndexPaths:withRowAnimation: was  
commented out, but strangely the table view has the two rows in the  
first section.


Is there a bug with the -insertRowsAtIndexPaths:withRowAnimation: call  
on the first insert attempt? Is there a way to work around this?


Is there a relatively bug-free demonstration or explanation of how to  
use the NSFetchedResultController class to manage iPhone table view  
updates properly?


Thanks,
Alex
___

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

Please do not post admin requests or moderator comments to the list.
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: More Core Data Questions

2009-10-13 Thread Jon Hull



The project is a game engine which has 2 graphs.  The first is a tree

of events that represent the story.  Each "event" in the story is an
immutable object, and there is a special event which represents a
series of events to run in order and one which represents branches
that the player has to choose from.  All of these are immutable, and
the main goal is to avoid loading the whole graph which will consist
of 10k-50k events.  This graph will be the same for every player.


Okay.  If you build this immutable store on your dev machine and  
include it in your project resources, you should see excellent  
performance.  Creating a store this size on the device would take a  
while.  Just don't go crazy with to-many relationships or database  
normalization (for this many objects, on a phone).


Of course, you don't want to search across all the events all the  
time.  You'll want some criteria (NSPredicate) to evaluate just the  
subset of relevant elements.
Yes, I plan to have an editor which creates the file on my Mac, and  
then include it with my resources for the iPhone project.  The only  
real search-ish type thing I need to do at the moment is finding an  
Event by it's id.




I also use proxies as context switches to objects in this
graph.  A concrete example is the current location, which is a proxy
that pretends to be a location, and forwards all the messages it
receives to the location object where the player is currently
located.  This allows events which reference locations/players/etc
that change depending on state to remain immutable.


You don't need proxies or NSProxy for this.  You can just use a  
delegate.  Off the cuff, I might consider implementing a protocol on  
your immutable objects for methods like "currentLocation" and  
"currentPlayer" which vector through a semi-global context object  
not unlike the app delegate.  Then you can use keypaths to naturally  
write currentPlayer.name and so forth.  NSProxy is unnecessarily  
heavy weight for simple delegation.  They use memory too, ja know.   
And the semi-global context allows you to avoid making all your  
objects larger.  You might even model the "current state" as a  
formal entity.  That buys you change tracking, undo, multi-writer  
conflict resolutions and the ability to easily persistent and search  
for it.  It also allows other managed objects to work with it  
naturally.
Hmm... something to consider.  The proxies do allow some powerful  
runtime state effects.  The currentLocation was just a simple (and  
often used) example, but it is easy to have proxies which represent  
"The sister of the person I am currently talking to" or the location  
of that person or the item which that person holds in their hand.   
They can also be used to represent groups of characters.  This is very  
powerful, and has come in very useful.  Still, it might be possible to  
get the same functionality in another way.


Luckily, the architecture of the engine has allowed me to make major  
changes rather painlessly so far.  Part of the reason that I used  
proxies in the first place is that it allowed me to keep proper  
encapsulation.  I will have to think on other ways to get the same  
behavior while maintaining the overall architecture/extensibility.



I have a
controller set up which communicates with the main thread, and the
background thread blocks until the controller gets a valid response,
at which point it starts unwinding again until it needs another
response or reaches the end.  There is no run loop for this thread.

sure.  don't forget an autorelease pool.

Yes, I create/destroy a pool for each nested array of events


and then call off  to the manager with the id whenever they need to  
run an event.  Inside
the manager I would either call off to a small sql database with  
blobs

holding freeze-dried (keyedArchiving) objects & an id column,


not a great plan.  No searching into blobs, no partially loading or  
saving the larger freeze dried objects.
hmm...  The largest blob would probably be an object with an array of  
20 or so pointers/ids.  Not sure I need to search into them... mostly  
I just need to grab them by id.


I had considered just using core data for everything, but as I  
mentioned in a previous post, I *need* to have consistently ordered  
arrays of these immutable objects (which can be in multiple places in  
a single array, and can be in multiple arrays).  This is apparently  
difficult using core data :-(


Although, now that I think about it, perhaps I can store *just* the  
array of ids as a binary property, and have everything else defined in  
the entity.  I will have to do some experiments.




Also, you could do that trivially with Core Data and just be done.
Do you mean store the blobs in a core data managedObject instead of a  
SQL database? or avoid the blobs entirely using core data?




or save each event as a file with the id in the filename.
Each event file would have to be > 8K before this

Subclassing a view class from an external framework

2009-10-13 Thread Mark Gallegly
I have an NSView subclass defined in a framework called FrameworkView. The
FrameworkView class has a property like so:

@property (nonatomic, retain) IBOutlet NSView* someView;

This framework has the necessary code in it to work as an Interface Builder
plugin, and everything seems to work fine in Interface Builder.


However, if I subclass the FrameworkView in a separate project that contains
my .app target, with say a class called MyFrameworkViewSubclass, I get a
warning like this when building the .xib file containing
MyFrameworkViewSubclass:

The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to 'Custom
View' but 'someView' is no longer defined on MyFrameworkViewSubclass.

Now, within IB the outlet shows up and I am able to make the connection, and
when the app runs everything works fine, but for some reason XCode spits out
this warning. Does anybody know what is going on here and how to get rid of
the warning?
___

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

Please do not post admin requests or moderator comments to the list.
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: NSZombieEnabled giving rise to new bug

2009-10-13 Thread Wyatt Webb


On Oct 12, 2009, at 9:01 AM, Bill Bumgarner wrote:


On Oct 12, 2009, at 8:50 AM, Nick Rogers wrote:

2009-10-12 20:28:53.651 My Program[33987:6263] *** -[CFArray  
count]: message sent to deallocated instance 0x1149a9310

[Switching to process 33987]
[Switching to process 33987]
sharedlibrary apply-load-rules all
2009-10-12 20:29:03.917 My Program[33987:6263] *** NSInvocation:  
warning: object 0x1149a9310 of class '_NSZombie_CFArray' does not  
implement methodSignatureForSelector: -- trouble ahead
2009-10-12 20:29:03.918 My Program[33987:6263] *** NSInvocation:  
warning: object 0x1149a9310 of class '_NSZombie_CFArray' does not  
implement doesNotRecognizeSelector: -- abort

kill
quit

The code is so complex and its also hard to reach the point where  
I'm doing the wrong -[CFArray count].
Is it possible to some how to get it automatically stop at [CFArray  
count] OR is it possible to set a breakpoint at all [CFArray count]  
in Xcode or in .gdbinit.


That won't necessarily help you.  By the time the -count message is  
sent the damage was done long ago.  Zombies help by giving you the  
address of the object that went bad earlier.  What you need to  
examine are all of the retain/release events that occurred at that  
address prior.


To do this, you can use the ObjectAlloc Instrument in Instruments.   
Turn on Zombie tracking and then have a look at the zombie object's  
address in the instrument.


There are cases, though, where Instruments won't work for this.  In  
that case, set the MallocStackLoggingNoCompact environment variable  
to 1 and then run your application.  When you find the 'message sent  
to deallocated instance' address, use 'malloc_history PID ADDR' at  
the command line to see a history of all events at that address.   
Or, in gdb, 'info malloc ADDR'.


b.bum


I just watched a WWDC 2009 video that talked about the new Zombies  
instrument with Xcode 3.2. If you run with that instrument, it will  
stop as soon as the message is sent to the bad address. Even better,  
though, you can look at the address and see the entire retain/release/ 
autorelease history including call stacks for each entry. I haven't  
used it, yet, but it looks like exactly what you need.


Wyatt

___

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

Please do not post admin requests or moderator comments to the list.
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


Language based scanning

2009-10-13 Thread Nz Gmail

Hi,
Is there is a way to figure out the occurance of Arabic chars so the  
label's alignment would be set accordingly (right to left)? 
 
___


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

Please do not post admin requests or moderator comments to the list.
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 with OpenGL

2009-10-13 Thread Dado Colussi
On Mon, Oct 12, 2009 at 11:30 PM, Richard Somers  wrote:

> So you are saying that I should abandon this and put the draw method
> somewhere else like in a controller. Perhaps you could fill the picture in a
> little more for me. So far I have yet to find any sample code that is a
> document based core data application that uses OpenGL.
>


There is no strictly correct way of solving your problem. Below are my
recommendations.

Design your model objects as data containers. Hence no drawing behavior in
model objects. If you add behavior to your model objects, make minimal
assumptions about the world outside the model objects.

Have separate classes that know how to draw your model objects in a
particular rendering technology. For OpenGL, have a custom NSOpenGLView
class that knows how to translate your model objects to OpenGL commands.

Create a controller class that acts as a resource manager. Make the
controller decide when to allocate an OpenGL context, how many of them to
have around, how the contexts are associated with the views, and generally
make it orchestrate the whole thing.

If your design does not fit this model well, then consider changing your
design.

/Dado
___

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

Please do not post admin requests or moderator comments to the list.
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: Language based scanning

2009-10-13 Thread Ricky Sharp
You probably do not want to approach things this way. Arabic is  
bidirectional and you may have situations where you have a mixture of  
languages.


What you should look at instead is to just localize your app to  
Arabic. In the Arabic version of your nibs, make the necessary  
adjustments.


Sent from my iPhone

On Oct 13, 2009, at 6:16 AM, Nz Gmail  wrote:


Hi,
Is there is a way to figure out the occurance of Arabic chars so the  
label's alignment would be set accordingly (right to left)? 
___


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

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

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

This email sent to rsh...@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: Bindings Driving Me CRAZY. :'(

2009-10-13 Thread Gustavo Adolfo Pizano
Keary.

Tahnks a lot for the info,

I will spend more time them trying to solve this bindings problems,,,
I see my problem is not just bindings, but some Obj-c related stuff,
like references outlets between classes, I did something similar a
while back (puting IBOutlets for other controllers ), and it worked
very good, I ill take a look at the source again and see.

Also then I think Im not placing the Object inside IB, So I guess
inside UserListView.xib, I will put an NSObject isntance, and conect
it to the InvoiceEditionViewController IBOutlet, then I guess it
should reference the same controller, hence the same
NSArrayController.

Ok I will orginize my ideas better.

Thanks a lot.

Gustavo


On Tue, Oct 13, 2009 at 1:41 AM, Keary Suska  wrote:
> On Oct 12, 2009, at 1:33 PM, Gustavo Pizano wrote:
>
>> Keary Hello:
>>
>>>
>>> This doesn't appear sensible, and you may have a number of problems.
>>> First, make sure that InvoiceEditionViewController is being instantiated
>>
>> this is what Im doing: in the awakeFromNib
>>
>> if(_userListController == nil){
>>                _userListController = [[UserListViewController alloc]
>> initWithNibName:@"UserListView" bundle:nil];
>>        }
>>        if(_invoiceController == nil){
>>                _invoiceController = [[InvoiceEditionViewController alloc]
>> initWithNibName:@"InvoiceEditionView" bundle:nil];
>>        }
>>        [_myUserListView addSubview:[_userListController view]];
>>        [_myContentView addSubview:[_invoiceController view]];
>>        [_invoiceController setUserController:_userListController];
>
> You mentioned having an outlet from the UserListViewController to the
> InvoiceEditionViewController--this can only be accomplished in the
> InvoiceEditionViewController is in the UserListViewController's nib, in
> which case you are instantiating two different InvoiceEditionViewControllers
> and hence experiencing problems.
>
> If the InvoiceEditionViewController is *not* in the UserListViewController
> nib, the above should work fine, except still consider the
> NSObjectController but with the correct key path.
>
>>> properly. Second, simply have a reference to UserListViewController in
>>> InvoiceEditionViewController, which can be an outlet if
>>
>> ok done I have now there this :  IBOutlet UserListViewController *
>> userController;
>
> This is only useful if the InvoiceEditionViewController is instantiated in
> the UserListViewController nib, If it is, then chances are that the
> InvoiceEditionViewController is not being instantiated correctly unless you
> have overridden -init or -initWithCoder:, depending on the super class.
>
>>> InvoiceEditionViewController can be sensibly instantiated via xib, or set
>>> by other means. I recommend then to have an NSObjectController in
>>> InvoiceEditionViewController.xib whose content is bound to
>>> UserListViewController.NSArrayController.selection (using correct
>>> ivar/property names, of course).
>>
>> Ok I tried but when wan tto bind the labels to show the details I bind it
>> to the NSObjectControlled I just configured, and the controller key goes to
>> selection, which its not good, so whe I run I see its NO Selection. label.
>
> No, "selection" is the correct controller key for data access. It is
> confusing for an object controller as there will only be one selection (or
> none), but that is how it works.
>
>> I did instead was to place an NSArrayController (users) in IB and bind the
>> contents to  userController._userListArrayController.arrangedObjects.
>> then the labels I bind the values to users, and the controller key to
>> selection and the path to the attributes of the entity.
>
>> And it works 50%, I can see the values., but when I select another user,
>> the values dosn't change, it's seems its getting only the 1st value of the
>> array.
>
> Of course. You are creating a whole different array controller that has its
> own selection semantics. Bindings are automatic but not magic. Scrap the
> array controller approach. It won't work. Do an NSObjectController instead.
>
> Google "binding across nibs" (you may need to try a few variations on the
> preposition for best results) and you will find numerous discussion and
> techniques.
>
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
>
>
___

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

Please do not post admin requests or moderator comments to the list.
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: Code Sign verification on Leopard

2009-10-13 Thread jonat...@mugginsoft.com


On 13 Oct 2009, at 08:34, Jakub Bednar wrote:


Hi list,

I have read CodeSigningGuide and CodeSigningRef from Apple. In the  
CodeSigningRef every method has a note, that it is available in 10.6  
and later. So I just want to make sure.


On Leopard, there is now Cocoa or other API for verifying code  
signatures. So if I want to verify e.g. that a script is really the  
one I have installed, I need to use NSTask to run codesign utility.  
Is this correct?



Yes.
On Leopard I use the following.

//
//  MGSCodeSigning.h
//

#import 

typedef enum {
CodesignUnrecognised = -2,
CodesignError = -1,
CodesignOkay = 0,
CodesignFail = 1,
CodesignInvalidArgs = 2,
CodesignFailedRequirement = 3,
} CodesignResult;

@interface MGSCodeSigning : NSObject {
NSString *_resultString;
}

@property (copy) NSString *resultString;

- (CodesignResult)validateExecutable;
- (CodesignResult)validatePath:(NSString *)path;
- (CodesignResult)validateApplication;

@end

//
// MGSCodeSigning.m
//
#import "MGSCodeSigning.h"
#include 

@implementation MGSCodeSigning

@synthesize resultString = _resultString;

/*

 validate executable

 */
- (CodesignResult)validateExecutable
{
Dl_info info;   
int errDlAddr = dladdr( (const void *)__func__, &info );
if(errDlAddr == 0) {
return CodesignError;
}
char *exec_path = (char *)(info.dli_fname);

	NSString *path = [NSString stringWithCString:exec_path  
encoding:NSUTF8StringEncoding];

return [self validatePath:path];
}
/*

 validate this application

 */
- (CodesignResult)validateApplication
{
return [self validatePath:[[NSBundle mainBundle] bundlePath]];
}
/*

 validate path

 */
- (CodesignResult)validatePath:(NSString *)path
{
self.resultString = nil;
int status = CodesignError;

@try {
		NSArray *arguments = [NSArray arrayWithObjects: @"--verify", path,   
nil];

NSTask *task = [[NSTask alloc] init];

[task setArguments:arguments];
[task setLaunchPath:@"/usr/bin/codesign"];
[task setStandardOutput:[NSFileHandle 
fileHandleWithNullDevice]];   
[task setStandardError:[NSFileHandle 
fileHandleWithNullDevice]];
[task launch];
[task waitUntilExit];
status = [task terminationStatus];

switch (status) {
case CodesignOkay:
self.resultString = NSLocalizedString(@"Valid", 
@"Codesign okay.");
break;

case CodesignFail:
self.resultString = NSLocalizedString(@"Invalid", @"Codesign  
failed.");

break;

case CodesignInvalidArgs:
self.resultString = NSLocalizedString(@"Invalid arguments",  
@"Codesign invalid arguments");

break;

case CodesignFailedRequirement:
self.resultString = NSLocalizedString(@"Failed requirement",  
@"Codesign failed requirement.");

break;

default:
self.resultString = NSLocalizedString(@"Unrecognised response",  
@"Codesign unrecognised response.");

status = CodesignUnrecognised;
break;

}

if (status != CodesignOkay) {
NSLog(@"codesign failure: %@", self.resultString);
}


}...@catch (NSException *e) {
NSLog(@"Exception launching codesign: %@", [e reason]);
return CodesignError;
}

return status;
}

@end

Thanks a lot for your answer,

Jakub
___

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

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

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

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Developer
http://www.mugginsoft.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: Subclassing a view class from an external framework

2009-10-13 Thread Jeff Johnson

Hi Mark.

I had the same problem with NSWindow subclasses. Although Interface  
Builder 3 is supposed to automatically sync with header files in your  
project, it seems to have trouble with headers in frameworks. What I  
did was select "Read Class Files..." in the "File" menu of Interface  
Builder and read the header file for my framework class. The solved  
the problem for me.


-Jeff


On Oct 12, 2009, at 11:22 AM, Mark Gallegly wrote:

I have an NSView subclass defined in a framework called  
FrameworkView. The

FrameworkView class has a property like so:

@property (nonatomic, retain) IBOutlet NSView* someView;

This framework has the necessary code in it to work as an Interface  
Builder

plugin, and everything seems to work fine in Interface Builder.


However, if I subclass the FrameworkView in a separate project that  
contains
my .app target, with say a class called MyFrameworkViewSubclass, I  
get a

warning like this when building the .xib file containing
MyFrameworkViewSubclass:

The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to  
'Custom

View' but 'someView' is no longer defined on MyFrameworkViewSubclass.

Now, within IB the outlet shows up and I am able to make the  
connection, and
when the app runs everything works fine, but for some reason XCode  
spits out
this warning. Does anybody know what is going on here and how to get  
rid of

the warning?


___

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

Please do not post admin requests or moderator comments to the list.
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


register a help book

2009-10-13 Thread Wesley Smith
I'm trying to add a help book to my app.  I've been following the
instructions on
http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/ProvidingUserAssitAppleHelp/user_help_intro/user_assistance_intro.html#//apple_ref/doc/uid/TP3903-CH204-CHDIDJFE
.

I'm finding conflicting (at least to me) info in this article as
compared to various apps that are on my system.  I have created a
folder called LuaAV.help that lives in Resources/English.lproj.  In my
Info.plist, I have adde these items:

CFBundleHelpBookFolder
LuaAV.help
CFBundleHelpBookName
LuaAV.help

>From what I understand, this is supposed to automagically register the
book with my app, but I'm not seeing it.  Inside my LuaAV.help folder,
I have a css file and a toc.html file.  Am I supposed to see an Help >
LuaAV menu item on app load?  How can I get this to show?

thanks for any pointers,
wes
___

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

Please do not post admin requests or moderator comments to the list.
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


Safari problem

2009-10-13 Thread fawad shafi

Hello.
i am developing an application in which i need that System permanently 
disables/hides the status bars at the top and bottom
of safari for the duration of session. They do not reappear at any
point.

I tried my best to do that but no success.
Kindly help me.

Thanks in advance.

Regards,
Fawad Shafi
iPhone Application Developer


  
_
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/___

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

Please do not post admin requests or moderator comments to the list.
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 with OpenGL

2009-10-13 Thread Erik Buck
For a variety of reasons, I use Core Data with OpenGL all of the time.  One of 
my presentations this weekend at "Voices That Matter: iPhone Developers 
Conference" uses a Core Data application with two different Views as an example 
of the MVC design pattern.  One View presents information about the Model using 
Core Graphics/Quartz.  The other View presents information using OpenGL ES.

I think that the Core Data model and any generated classes should be left 
untouched because you may want to regenerate the classes later.

I use Categories to add View specific drawing methods to the objects that 
represent Core Data entities.  There are different categories with different 
methods in each View.  E.g. there are -drawInOpenGLContext: methods added to 
entity objects within the OpenGL View subsystem and there are 
-drawWithCoreGraphics methods added in the Core Graphics View subsystem.

There is ample precedent for adding View specific capabilities to Model objects 
via categories.  AppKit adds string drawing methods to NSString.

You definitely don't want your View subsystem constantly asking Model objects 
what kind they are in order to present information.  If you have ifs or 
switches based on the class of objects or even based on an attribute of an 
Entity, you are doing it wrong.

It is much cleaner to use the built in language polymorphism.  Just keep View 
related code implementation within the View.


___

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

Please do not post admin requests or moderator comments to the list.
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: register a help book

2009-10-13 Thread Jerry Krinock


On 2009 Oct 13, at 06:45, Wesley Smith wrote:


thanks for any pointers,


* You didn't mention adding this "magic tag":

  to the  of your root html file.

* Watch Matt Neuberg's screencast:
http://www.apeth.com/writersua/implementAppleHelp.mov
(I never have, but Matt is the Apple Help guru.)

* Post further questions to
apple-help-author...@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


Re: Safari problem

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 9:54 AM, fawad shafi wrote:

i am developing an application in which i need that System  
permanently disables/hides the status bars at the top and bottom

of safari for the duration of session. They do not reappear at any
point.



'  If you're really trying to show/hide the status bars in Safari,  
this is the wrong list (it's not a Cocoa-related question at all). I  
believe this can be done with JavaScript.


  Otherwise, you can use a plain WebView in your own application to  
display the web page/site without any window dressings.




I tried my best to do that but no success.


  That statement is irrelevant without telling us *what* you tried.


--
I.S.



___

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

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

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

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


Re: Core Data with OpenGL

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 9:58 AM, Erik Buck wrote:

I think that the Core Data model and any generated classes should be  
left untouched because you may want to regenerate the classes later.


I use Categories to add View specific drawing methods to the objects  
that represent Core Data entities.



  I like this idea even more. Very good point about regenerating the  
representative classes behind entities - a separate category for  
drawing neatly segregates things.


  Maybe a good radar incident will see the Sketch example updated.

--
I.S.




___

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

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

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

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


Preserving camelCase when prefixing a method name?

2009-10-13 Thread Graham Cox

Hi all,

I have a situation where I need to build a new selector name from an  
existing one, by prepending a new part to the selector. e.g. if I have  
an object with a property 'fooBar', I want to generate the selector  
'setSomeSpecialPrefixFooBar'


The problem I've run into is preserving the camel case of the original  
selector element correctly, so that 'fooBar' becomes 'FooBar', not  
'Foobar' as it becomes when applying -capitalizedString to it.


I think just making the first character uppercase would be sufficient,  
but I'm not sure how to do that reliably with the unichar data type,  
so that's my first question. The second is that when generating  
selectors programmatically like this, are there other pitfalls to  
consider so that the resulting selector is always predictable? The  
scheme needs to work with arbitrary properties, just as various parts  
of KVC and KVO do.


--Graham


___

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

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

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

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


Re: Should VM shrink to original when releasing huge memory

2009-10-13 Thread Clark Cox
On Tue, Oct 13, 2009 at 2:14 AM, Nick Rogers  wrote:
> Hi,
> I'm using Snow Leopard and Xcode 3.2.
> When my program runs the VM grows from 50MB to around 550MB.
> So when I release the memory, should VM shrink to the original 50MB, in this
> case it isn't so?

No, in most cases, it won't shrink. Most of the time, when you free
memory, it is returned to a pool within your application for use in
future allocations, but not returned to the OS (so it remains mapped
into your application's VM space).

If, whatever you're doing with that memory is repeatable, and the
memory continues to grow significantly each time you repeat, then you
may have a leak, otherwise, it's just business as usual and nothing to
worry about.

-- 
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: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-13 Thread Ben Haller

On 12-Oct-09, at 8:14 PM, Charles Srstka wrote:


On Oct 11, 2009, at 9:46 PM, Ben Haller wrote:

Most of the bugs I had to fix were related to either using "long"  
instead of "int", or needing a -finalize method.


You should actually probably be using NSInteger instead of either of  
those these days.


  Yes, but NSInteger is 10.5 or later; I'm keeping 10.4 compatibility  
for now.  Anyhow, those uses were all in my own internal logic, which  
can stay using 32-bit ints.


There's actually a ConvertCocoa64 script found in /Developer/Extras/ 
64BitConversion that will scan your files for other things that  
could bite you in the transition to 64-bit. You should probably give  
it a spin, to make sure you're all up to date.


This page contains some handy information, too:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/ConvertingExistingApp.html


  Good stuff, I'll check it out.  Thanks Charles!

Ben Haller
Stick Software


___

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

Please do not post admin requests or moderator comments to the list.
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: Preserving camelCase when prefixing a method name?

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 10:24 AM, Graham Cox wrote:

I think just making the first character uppercase would be  
sufficient, but I'm not sure how to do that reliably with the  
unichar data type, so that's my first question.


  Why not replace the first character with an upper-case version  
instead of applying this to the whole string?



The second is that when generating selectors programmatically like  
this, are there other pitfalls to consider so that the resulting  
selector is always predictable? The scheme needs to work with  
arbitrary properties, just as various parts of KVC and KVO do.


  Not sure I can answer this knowledgeably so I'll leave this one  
alone. :-)


--
I.S.




___

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

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

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

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


Re: Preserving camelCase when prefixing a method name?

2009-10-13 Thread Jim Correia

On Oct 13, 2009, at 10:24 AM, Graham Cox wrote:

I think just making the first character uppercase would be  
sufficient, but I'm not sure how to do that reliably with the  
unichar data type, so that's my first question.


Well you don't have to consider all of unicode, just those characters  
which are valid language identifiers.


Nonetheless, applying -uppercaseString to the first character should  
solve the problem.


The second is that when generating selectors programmatically like  
this, are there other pitfalls to consider so that the resulting  
selector is always predictable? The scheme needs to work with  
arbitrary properties, just as various parts of KVC and KVO do.


Don't forget to account for the pattern often used for BOOL  
'properties'. (I put properties in air quotes because actual  
properties allow you to specify the getter and setter name.)


-isFlagged
-setFlagged:

- Jim
___

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

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

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

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


Composition to keep rendering on window close

2009-10-13 Thread Bryan Matteson
I'm using a standard QCView to play back a Quartz Composition. I still  
want the composition (which contains audio) to continue rendering when  
the window is hidden from view, but I'm not sure how without setting  
up a custom renderer and all that. Is it possible?
I should also mention that it is a custom quartz plugin, so if there's  
something that can be done in the disableExecution: or stopExecution:  
methods that is an okay solution too.


Thanks
-B
___

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

Please do not post admin requests or moderator comments to the list.
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: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Ken Ferry
On Mon, Oct 12, 2009 at 11:48 AM, Sander Stoks  wrote:

> I have a related question.  The various image file formats have their own
> options and settings (compression levels, color space, interlacing, etc.);
> is there a generic way to access these from within my application?
>
> For those who still remember BeOS (where the grass was green and the girls
> were pretty), there was a concept called "Translators" (which BeOS, in turn,
> borrowed from the Amiga).  Each Translator was basically an Image I/O codec,
> but you could also query them for a "configuration view" which you could
> simply show in your own application.  That way, the app doesn't have to know
> the ins and outs of all the file formats.
>
> Does something like this exist on MacOS or do I have to create these
> settings views myself?
>

Yes, though I'm sure it isn't precisely the same.

Take a look at IKSaveOptions.

Ken Ferry
Cocoa Frameworks


>
> Regards,
> Sander
>
>
>  Actually, that occurred under 10.5 as well - what happens is that some
>> operations, it would seem those involving Core Image, cause the
>> internal representation to go to RGBA. Which is fine, but there
>> doesn't seem to be a way to write a plain RGB format TIFF. I had to
>> incorporate a third-party TIFF module to do that, as RGBA TIFF files
>> aren't very compatible with anything other than Apple.
>>
>> Sandy
>>
>>
>> On Oct 12, 2009, at 5:07 PM, Ken Ferry wrote:
>>
>>  On Mon, Oct 12, 2009 at 4:36 AM, Peter C 
>>> wrote:
>>>
>>>  I just stumble into a feature (or a bug ?), NSImage
 TIFFRepresentation
 produce RGB TIFF with a layer (when open under Photoshop).
 Previously it
 produce plain RGB TIFF under OS 10.5 and below. This cause some
 part of my
 programs interpret wrong RGB data, expecting 3 bytes instead of 4
 bytes for
 a RGB pixel.  There is no mention in the documents about this
 "feature".

 Is there a way to restore the previous behavior  of
 TIFFRepresentation ?

>>>
>>>
>>> You can look at CGImageDestination to get more options, but I don't
>>> think
>>> there's anything that provides control at that level.
>>>
>>> In many cases there _must_ be data munging between the in memory pixel
>>> format and the on-disk file format.  The precise munging is not
>>> defined on
>>> either input or output.
>>>
>>> That is, don't make pixel format assumptions.  The AppKit release
>>> notes<
>>> http://developer.apple.com/mac/library/releasenotes/Cocoa/AppKit.html
>>>
 discuss

>>> how to avoid making pixel format assumptions in the section
>>> "NSBitmapImageRep: CoreGraphics impedence matching and performance
>>> notes".
>>>
>>> -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/kenferry%40gmail.com
>
> This email sent to kenfe...@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: Getting AAC tag information

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 2:12 AM, Sven wrote:

I've found documentation on getting ID3 tag data from MP3s via  
QuickTime, but I'm having a hard time finding information on  
retrieving this data from AAC files.


You can get at AAC tags via QuickTime's movie-metadata API —  
QTCopyMovieMetaData etc. There isn't any documentation on what the  
tags are, but you can figure it out fairly easily by looking at  
existing AAC files. I've pasted in some notes I took a while ago, below.


I'd expect there to be some form of support to handle reading and  
writing of tagging data for both AAC and MP3 files.



There's no API for generating AAC tags, that I know of. (And there's  
no API for encoding MP3 audio at all, for licensing reasons. You have  
to use 3rd party code like LAME for that.)


—Jens

metadata: 'itsk' "©nam" = "Blur" (type=1)
metadata: 'itsk' "©ART" = "Aphex Twin" (type=1)
metadata: 'itsk' "©alb" = "Selected Ambient Works, Vol 2" (type=1)
metadata: 'itsk' "gnre" = 001B (type=0)
metadata: 'itsk' "trkn" = 0007000B (type=0) // '7' is  
track #, 'B' is total tracks
metadata: 'itsk' "disk" = 00010002 (type=0) // disc 1  
of 2

metadata: 'itsk' "©day" = "1994" (type=1)
metadata: 'itsk' "cpil" = 00 (type=21)  // is- 
compilation

metadata: 'itsk' "tmpo" =  (type=21)
metadata: 'itsk' "©too" = "iTunes v4.0.1, QuickTime 6.2" (type=1)
metadata: 'itlk' "com.apple.iTunes" = " 0062 0062 102F  
0EF2 005261D8 005261D8 4842 4867 0053F818 00546960" (type=1)
metadata: 'itlk' "com.apple.iTunes" =  
"11+F3680FC5AADE015A4E54ED52BD842300+862874" (type=1)
metadata: 'itsk' "covr" = 148586 bytes (type=14)// Cover  
art!

metadata: 'udta' "meta" = 151321 bytes (type=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: Implementing Back and Forth Control.

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 2:53 AM, Philip Juel Borges wrote:

But it would be better to have just one segmented control in the  
toolbar that can go back and forth in any of the views that is  
swapped in.


You can either

(1) Set the segmented control's target property to point to the active  
WebView whenever you switch views;

or
(2) Implement your own goBack/goForward methods in your controller,  
attach the segmented control to those, and make those methods call the  
active WebView.


I've googled this for long now and thought that perhaps this would  
work but it doens't [[webView window] goBack:self];


That won't work because NSWindow doesn't implement goBack:, and  
objects don't arbitrarily forward messages to each other.


—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: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Ken Ferry
On Tue, Oct 13, 2009 at 12:39 AM, Paul M  wrote:

> Note especially this quote:
> "Adobe supports TIFF issues that directly relate to Adobe products. If a
> TIFF file is incompatible with an Adobe product ... our goal is to isolate
> and understand the problem so that it may be corrected in future releases"
> Taken from this page:
> http://kb2.adobe.com/cps/000/13da4f4.html
>

This hedge is probably in there because TIFF is designed to allow random
extensions.  There's no hope of supporting anything anyone could possibly
put in a TIFF file.

However, hopefully a program won't put semantically necessary data in
private extensions unless the files aren't supposed to escape management by
that program.

That an Adobe product is so "Crappy" in this regard is surprising. I'm not

100% cretain, but I was under the impression that Adobe owns the Intelectual

Property that is the TIFF standard. They certainly support and foster it

to a high degree.


I agree.  Of course one should file a bug with Adobe, but I would be
inclined to think that this problem was misdiagnosed.  Lightroom really
ought to be able to read TIFF files with an alpha channel.

If there is indeed no api to do this, It would be reasonable to expect that
> the output format may be determined by the data comming in (to the image IO
> subsystem). If CoreImage is associating an alpha channel with the image,
> then try looking at CoreImage to either not add the alpha, or else to remove
> it prior to exporting your image.


> If you cannot do this with CoreImage, try looking at NSImage or other
> imaging components (Ken suggested CGImageDestination) to see if the alpha
> can be removed prior to writing it to disk. (Basicly, if you cant tell it
> not to write the alpha, try removing the alpha then write it out - then file
> an enhancement request!).


ImageIO (i.e. CGImageDestination) is the reading and writing framework used
by everything else.Please do file a bug, but please do understand:  The
contract today is that ImageIO makes no promises about the relation between
in-memory pixel format and on-disk format on either reading or writing.  You
need to code such that you don't depend on it, as discussed earlier in this
thread.

In particular, there has been talk of unilaterally standardizing everything
to ARGB when it's read in to simplify CoreGraphics and avoid future
conversions.

-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


Re: Code Sign verification on Leopard

2009-10-13 Thread Jens Alfke
This code sample seems to be designed to verify the binary that it's  
compiled into. That's sort of useless for security purposes, like  
yelling downstairs "are you a burglar?" If your own code's already  
been modified, it's easy enough for the hacker to disable the code  
that does the checking. Code signing only makes sense for verifying  
external code before it's loaded. (Note that even loading a dynamic  
library and then verifying the code is insecure, since the library  
could have code that runs at load-time, like C++ static initializers,  
that clobbers you before you get a chance to verify it.)


It's also not useful for security purposes to just check the status  
result of codesign. A successful result just tells you that the code  
has a signature. It doesn't tell you who signed it, or who authorized  
their certificate. Anyone can make their own key-pair in 30 seconds  
using the openssl tool or Keychain Access and use it to sign anything  
they want. For real verification you also have to examine the identity  
of the signer, and the chain of trust from the signer to a trusted  
root cert.


[FYI, it also looks like that sample assumes GC. It doesn't release  
the NSTask.]


—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: Language based scanning

2009-10-13 Thread John Joyce

 Language based scanning
To: "cocoa-dev@lists.apple.com" 
Message-ID: <21331617-f39c-4f3b-8f4b-795be101a...@gmail.com>
Content-Type: text/plain;   charset=us-ascii;   format=flowed;  
delsp=yes

Hi,
Is there is a way to figure out the occurance of Arabic chars so the
label's alignment would be set accordingly (right to left)?

Part of the localization process in Cocoa is to create your localized  
nib/xib files.
This includes adjusting interface elements and layout accordingly so  
that it makes sense for different languages/cultures.
Even some ready-made interface elements don't think left-to-right...  
so you may want to customize things appropriately.


It all depends on how seriously you take given locale as a market for  
an app.


As much as people sometimes think they want easy, scriptable,  
automated localization of the UI, it just doesn't work that way.

You SHOULD hand-tool the UI for all locales.
Do it like you're building something for your own children.

When your users don't have to think, and even better, when they say to  
themselves, "oh!? That's clever, subtle, thoughtful!" then you have  
done a wonderful job.


In the words of Apple: Surprise and Delight.

This is the Mac OS, and the user experience is paramount unless it is  
a command line tool...

(but even then...)

___

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

Please do not post admin requests or moderator comments to the list.
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: TIFFRepresentation, different TIFF format under Snow Leopard

2009-10-13 Thread Sandy McGuffog

Ken,

Just for clarity here, my problem, although not the original poster's,  
is not around internal representation - I'm happy with with whatever  
comes along in that regard. My problem is that if you want to write  
out a Core Image rep as TIFF, there is no obvious way to specify that  
you want the written representation to be RGB, not RGBA. Maybe there  
is a way, but I couldn't find it.


Sandy

On Oct 13, 2009, at 5:33 PM, Ken Ferry wrote:


On Tue, Oct 13, 2009 at 12:39 AM, Paul M  wrote:
Note especially this quote:
"Adobe supports TIFF issues that directly relate to Adobe products.  
If a
TIFF file is incompatible with an Adobe product ... our goal is to  
isolate
and understand the problem so that it may be corrected in future  
releases"

Taken from this page:
http://kb2.adobe.com/cps/000/13da4f4.html

This hedge is probably in there because TIFF is designed to allow  
random extensions.  There's no hope of supporting anything anyone  
could possibly put in a TIFF file.


However, hopefully a program won't put semantically necessary data  
in private extensions unless the files aren't supposed to escape  
management by that program.


That an Adobe product is so "Crappy" in this regard is surprising.  
I'm not
100% cretain, but I was under the impression that Adobe owns the  
Intelectual
Property that is the TIFF standard. They certainly support and  
foster it

to a high degree.

I agree.  Of course one should file a bug with Adobe, but I would be  
inclined to think that this problem was misdiagnosed.  Lightroom  
really ought to be able to read TIFF files with an alpha channel.


If there is indeed no api to do this, It would be reasonable to  
expect that the output format may be determined by the data comming  
in (to the image IO subsystem). If CoreImage is associating an alpha  
channel with the image, then try looking at CoreImage to either not  
add the alpha, or else to remove it prior to exporting your image.


If you cannot do this with CoreImage, try looking at NSImage or  
other imaging components (Ken suggested CGImageDestination) to see  
if the alpha can be removed prior to writing it to disk. (Basicly,  
if you cant tell it not to write the alpha, try removing the alpha  
then write it out - then file an enhancement request!).


ImageIO (i.e. CGImageDestination) is the reading and writing  
framework used by everything else.Please do file a bug, but  
please do understand:  The contract today is that ImageIO makes no  
promises about the relation between in-memory pixel format and on- 
disk format on either reading or writing.  You need to code such  
that you don't depend on it, as discussed earlier in this thread.


In particular, there has been talk of unilaterally standardizing  
everything to ARGB when it's read in to simplify CoreGraphics and  
avoid future conversions.


-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


Re: Should VM shrink to original when releasing huge memory

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 2:14 AM, Nick Rogers wrote:


When my program runs the VM grows from 50MB to around 550MB.
So when I release the memory, should VM shrink to the original 50MB,  
in this case it isn't so?


Virtual size is not usually a useful value for telling you "how much  
memory am I using". It just says how much of your process's address  
space is in use. For example, if you memory-map a 500MB file your  
VSIZE will grow by 500MB even though none of the file's been loaded  
into RAM yet. And if you link against AppKit your VM size grows by the  
size of AppKit's code, even though that code's already being shared by  
other processes.


The most useful seat-of-the-pants figure is RPRVT. This is the amount  
of resident, private memory. That means (a) it's actually paged into  
physical RAM, and (b) it's not shared with other processes.


If you want to know how much memory you've allocated with malloc /  
operator new / [NSObject allocate], you can use the 'heap' command- 
line tool, whose first line of output tells you how big your heap is  
and how much of it is allocated.



On Oct 13, 2009, at 7:26 AM, Clark Cox wrote:


No, in most cases, it won't shrink. Most of the time, when you free
memory, it is returned to a pool within your application for use in
future allocations, but not returned to the OS (so it remains mapped
into your application's VM space).


It depends. Malloc grabs chunks of virtual address space (a few  
hundred k at a time, I think) and carves those up for small malloc()  
allocations. I believe those stay allocated even after all the blocks  
are freed, for later re-use.


But if you call malloc to allocate a block larger than some threshold  
size (32k?) then it directly calls vm_allocate to grab a block of  
address space. And when large blocks like this are freed, they're  
directly released from VM.


So yes, the typical pattern of lots of small allocations will grow  
your address space over time, even after they're released. But if you  
make big allocations, those will go away out of address space after  
they're freed.


—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: Language based scanning

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 8:35 AM, John Joyce wrote:

Part of the localization process in Cocoa is to create your  
localized nib/xib files.
This includes adjusting interface elements and layout accordingly so  
that it makes sense for different languages/cultures.
Even some ready-made interface elements don't think left-to-right...  
so you may want to customize things appropriately.


By default, controls use the 'natural' text direction of the system  
locale. That means left-to-right in most languages, but right-to-left  
in Arabic / Hebrew / Urdu. So I believe that if you leave the  
direction alone, it will do the right thing.


—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


Disabling clicking on links in webview

2009-10-13 Thread Arun
Hi All,

I have an application where i use webview to display links to websites.
I need to know is there any way in which we can disable the clicking
on the links in the webview or is it possible to disable actions on
complete webview?

Thanks
Arun KA
___

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

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

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

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


Re: Code Sign verification on Leopard

2009-10-13 Thread jonat...@mugginsoft.com


On 13 Oct 2009, at 16:41, Jens Alfke wrote:

 That's sort of useless for security purposes, like yelling  
downstairs "are you a burglar?"
But it's not useless in the sense that it provides feedback that the  
code IS signed.
The code merely allows me  to detect if I have screwed up my build  
settings and managed to break the code signing.


It's also not useful for security purposes to just check the status  
result of codesign. A successful result just tells you that the code  
has a signature. It doesn't tell you who signed it, or who  
authorized their certificate. Anyone can make their own key-pair in  
30 seconds using the openssl tool or Keychain Access and use it to  
sign anything they want. For real verification you also have to  
examine the identity of the signer, and the chain of trust from the  
signer to a trusted root cert.


There's no denying that.

Jonathan Mitchell

Developer
http://www.mugginsoft.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: Getting AAC tag information

2009-10-13 Thread Sven

On Tue, 13 Oct 2009, Jens Alfke wrote:



On Oct 13, 2009, at 2:12 AM, Sven wrote:

I've found documentation on getting ID3 tag data from MP3s via QuickTime, 
but I'm having a hard time finding information on retrieving this data from 
AAC files.


You can get at AAC tags via QuickTime's movie-metadata API ? 
QTCopyMovieMetaData etc. There isn't any documentation on what the tags are, 
but you can figure it out fairly easily by looking at existing AAC files. 
I've pasted in some notes I took a while ago, below.


I'd expect there to be some form of support to handle reading and writing 
of tagging data for both AAC and MP3 files.



There's no API for generating AAC tags, that I know of. (And there's no API 
for encoding MP3 audio at all, for licensing reasons. You have to use 3rd 
party code like LAME for that.)




Thanks... I don't want to encode any audio files, I merely want to be able 
to get and set tag data. For MP3s I can use id3lib no problems, but that 
doesn't help me with AAC files. I guess if there's no way to edit tags via 
the Apple libraries (if I understand you correctly) then the only thing 
left to do is write my own.


I was just assuming there'd be an official Apple way of doing it.

./Sven
___

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

Please do not post admin requests or moderator comments to the list.
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: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-13 Thread David Duncan

On Oct 13, 2009, at 7:44 AM, Ben Haller wrote:

 Yes, but NSInteger is 10.5 or later; I'm keeping 10.4 compatibility  
for now.  Anyhow, those uses were all in my own internal logic,  
which can stay using 32-bit ints.



NSInteger is just a typedef defined in the 10.5+ SDKs. It doesn't  
actually add anything to the language but a bit of syntactic sugar. It  
isn't always appropriate to use, but there is no reason not to use it  
when it is.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Adding 'Help' to your App.

2009-10-13 Thread Joshua Garnham
Hi,

Just wondering if there is some documentation on how to add 'help' to your app.

Cheers.




___

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

Please do not post admin requests or moderator comments to the list.
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: Adding 'Help' to your App.

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 12:37 PM, Joshua Garnham wrote:

Just wondering if there is some documentation on how to add 'help'  
to your app.



  You're just wondering? Seriously? How about SEARCHING, then?

--
I.S.




___

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

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

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

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


Re: Custom bitmap representation

2009-10-13 Thread Ken Ferry
On Mon, Oct 12, 2009 at 4:30 PM, Kelvin Chung  wrote:

> I have this "nonstandard" image format which I want to convert into a more
> "standard" image format (say, PNG).  I'm having difficulty on how to use
> NSImageRep to do so.  This "nonstandard" format can be converted into a
> bitmap, so I thought that using NSBitmapImageRep can do just that.  However,
> since I have no experience in this area, I need some guidance on how to do
> so.  So, any general ideas?


>From this I assume you have some way to read the data yourself and process
it into a form from which you can instantiate an NSBitmapImageRep.  Let's
call this function basicTranslate.

There are few reasonable approaches.

(1) A new NSImageRep subclass.  Make a subclass of NSImageRep which has an
instance of NSBitmapImageRep as an instance variable.  In imageRepWithData:,
invoke basicTranslate and instantiate the NSBitmapImageRep.  Implement the
overridden methods of NSImageRep, oftentimes by delegating to the
NSBitmapImageRep that you have as an ivar.  Some of the methods of
NSImageRep describe the types that your rep subclass is capable of reading.
 Using this info, AppKit will call +imageRepWithData: on your class if it
encounters a type that you have signed up for.

(2) Use filter services to sign up as a translator for the file format. This
is demonstrated in the
SimpleImageFilter
example.
 If you do this, _all_ apps that use NSImage end up able to read your file
format.  Your image can be dropped directly into TextEdit.

(3)  Just do it.  Make a method +imageWithCrazyFormatData:, and do
basicTranslate in there.  In any code that wants to read the format, you
have to call this method.  Nothing in AppKit will automatically call it for
you.

An advantage of the first approach is that you have a place to put other
functionality that has to do specifically with your image file format.  For
example, maybe your file format has a bunch of special metadata.  Your rep
subclass is a place to put accessors for that metadata.  You also can tell
the difference between an image that came from your file format and one that
came from a png.

The second approach is probably less code than the first, and you
transparently add support for your format to all apps that use NSImage.
 Which is kind of cool.

The third approach uses the least framework infrastructure, so it's probably
the easiest to understand.  And it's totally fine and straightforward if
your format only should be read in specific places where you know that's
what you're doing.

-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: Adding 'Help' to your App.

2009-10-13 Thread Eric Gorr

On Oct 13, 2009, at 12:37 PM, Joshua Garnham wrote:

Just wondering if there is some documentation on how to add 'help'  
to your app.


I would suggest starting with:

http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/ProvidingUserAssitAppleHelp/user_help_intro/user_assistance_intro.html
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/OnlineHelp/OnlineHelp.html


___

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

Please do not post admin requests or moderator comments to the list.
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


Subclassing a view class from an external framework

2009-10-13 Thread Mark Gallegly
I have an NSView subclass defined in a framework called FrameworkView. The
FrameworkView class has a property like so:

@property (nonatomic, retain) IBOutlet NSView* someView;

This framework has the necessary code in it to work as an Interface Builder
plugin, and everything seems to work fine in Interface Builder.


However, if I subclass the FrameworkView in a separate project that contains
my .app target, with say a class called MyFrameworkViewSubclass, I get a
warning like this when building the .xib file containing
MyFrameworkViewSubclass:

The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to 'Custom
View' but 'someView' is no longer defined on MyFrameworkViewSubclass.

Now, within IB the outlet shows up and I am able to make the connection, and
when the app runs everything works fine, but for some reason XCode spits out
this warning. Does anybody know what is going on here and how to get rid of
the warning?
___

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

Please do not post admin requests or moderator comments to the list.
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: Subclassing a view class from an external framework

2009-10-13 Thread Bryan Matteson


The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to  
'Custom

View' but 'someView' is no longer defined on MyFrameworkViewSubclass.


I have encountered this situation before while working with KTUIKit  
and a Window Controller subclass. I used the workaround detailed in  
the following link with success. Your mileage may vary.


http://code.google.com/p/ktuikit/issues/detail?id=10#c0
___

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

Please do not post admin requests or moderator comments to the list.
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


Returning to app after phone call

2009-10-13 Thread Anthony Smith
Is it possible, if my app initiates a phone call, that after the call  
the app will be relaunched? I've read the Application Programming  
Guide so I understand interruptions and URLs. However, I was a little  
confused on this aspect. Thanks any input.


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: Adding 'Help' to your App.

2009-10-13 Thread Joshua Garnham
Thanks, I'll take a look at that. 





From: Eric Gorr 
To: Joshua Garnham ; Mailing List Cocoa 

Sent: Tuesday, 13 October, 2009 17:44:17
Subject: Re: Adding 'Help' to your App.

On Oct 13, 2009, at 12:37 PM, Joshua Garnham wrote:

> Just wondering if there is some documentation on how to add 'help' to your 
> app.

I would suggest starting with:

http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/ProvidingUserAssitAppleHelp/user_help_intro/user_assistance_intro.html
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/OnlineHelp/OnlineHelp.html



___

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

Please do not post admin requests or moderator comments to the list.
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: Adding 'Help' to your App.

2009-10-13 Thread Joshua Garnham
Some good links in that email, thanks!





From: M. Moore 
To: Eric Gorr 
Cc: Joshua Garnham ; Mailing List Cocoa 

Sent: Tuesday, 13 October, 2009 17:55:43
Subject: Re: Adding 'Help' to your App.

You might be interested in another thread going on in this same
mailing list. Here is the last email.
-- Forwarded message --
From: Jerry Krinock 
Date: Tue, Oct 13, 2009 at 7:01 AM
Subject: Re: register a help book
To: Wesley Smith , Cocoa Developers




On 2009 Oct 13, at 06:45, Wesley Smith wrote:

> thanks for any pointers,

* You didn't mention adding this "magic tag":
   
to the  of your root html file.

* Watch Matt Neuberg's screencast:
  http://www.apeth.com/writersua/implementAppleHelp.mov
   (I never have, but Matt is the Apple Help guru.)

* Post further questions to
  apple-help-author...@lists.apple.com






You might also want to look at helpify if you have omnioutliner
http://blog.omnigroup.com/2008/10/02/helpify-the-omni-help-emitter/


On Tue, Oct 13, 2009 at 9:44 AM, Eric Gorr  wrote:
> On Oct 13, 2009, at 12:37 PM, Joshua Garnham wrote:
>
>> Just wondering if there is some documentation on how to add 'help' to your
>> app.
>
> I would suggest starting with:
>
> http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/ProvidingUserAssitAppleHelp/user_help_intro/user_assistance_intro.html
> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/OnlineHelp/OnlineHelp.html
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/ahero2late%40gmail.com
>
> This email sent to ahero2l...@gmail.com
>


Send instant messages to your online friends http://uk.messenger.yahoo.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


viewWillDisappear not being called

2009-10-13 Thread Anthony Smith
When switching my views I'm noticing that my view controllers  
viewWillDisappear method is not being called. When switching the view  
I call this explicitly so I'm kind of confused. Here's my view  
switching code:


- (void)switchView:(UIViewController *)newViewController {
[newViewController viewWillAppear:YES];
[currentViewController viewWillDisappear:YES];
[[currentViewController view] removeFromSuperview];
[[self view] insertSubview:[newViewController view] atIndex:0];
[currentViewController viewDidDisappear:YES];
[newViewController viewDidAppear:YES];
[self setCurrentViewController:newViewController];
}

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: Bindings Driving Me CRAZY. :'(

2009-10-13 Thread Gustavo Pizano

SuccesS :D:D:D

Ok I have success, but I stepped away from what you told me,,, in a way.
What I did was:
In the AwakeFromNib method of the parent Controller, (the one that   
holds the UserListController and the InvoiceEditionController).


-(void)awakeFromNib{
if(_userListController == nil){
		_userListController = [[UserListViewController alloc]  
initWithNibName:@"UserListView" bundle:nil];

}   
[_myUserListView addSubview:[_userListController view]];
	[NSBundle loadNibNamed:@"InvoiceEditionView"  
owner:_userListController];
	[_myContentView addSubview:[[_userListController  
_invoiceEdViewController] view]];

}

So I  instantiated _userListController normally, passing the Nib file  
that will control. then well add the view and then I load the .xib  
"InvoiceEditionView" and set the owner to _userListController. Now  
before going to the next line in this code:


In UserListView .xib, I added the NSArrayController that has the data.
In InvoiceEditionView.xib, I set the class of the File's owners to  
UserListViewController, then I place an NSObject and called  
Controller, and the class of this Controller is  
InvoiceEditionViewController.
In UserListViewController I declared a IBOutlet and connected to the  
Controller I have just  placed in  InvoiceEditionView.xib. then I  
connected from Controller the outlet view eventually to the view that  
is in the xib.


Then in the view I placed the label and bind the value to  File's  
owner (Which is USerListViewController) and the Model Key Path to  
_userListArrayController.selection.completeName.


and IT WORKED!! I will try placing a NSObjectController and setting  
the label's value to it and see what happens. :D:D:



Thanks for the help

Gustavo






On Oct 13, 2009, at 1:41 AM, Keary Suska wrote:


On Oct 12, 2009, at 1:33 PM, Gustavo Pizano wrote:


Keary Hello:



This doesn't appear sensible, and you may have a number of  
problems. First, make sure that InvoiceEditionViewController is  
being instantiated

this is what Im doing: in the awakeFromNib

if(_userListController == nil){
		_userListController = [[UserListViewController alloc]  
initWithNibName:@"UserListView" bundle:nil];

}
if(_invoiceController == nil){
		_invoiceController = [[InvoiceEditionViewController alloc]  
initWithNibName:@"InvoiceEditionView" bundle:nil];

}
[_myUserListView addSubview:[_userListController view]];
[_myContentView addSubview:[_invoiceController view]];  
[_invoiceController setUserController:_userListController];


You mentioned having an outlet from the UserListViewController to  
the InvoiceEditionViewController--this can only be accomplished in  
the InvoiceEditionViewController is in the UserListViewController's  
nib, in which case you are instantiating two different  
InvoiceEditionViewControllers and hence experiencing problems.


If the InvoiceEditionViewController is *not* in the  
UserListViewController nib, the above should work fine, except still  
consider the NSObjectController but with the correct key path.


properly. Second, simply have a reference to  
UserListViewController in InvoiceEditionViewController, which can  
be an outlet if


ok done I have now there this :  IBOutlet UserListViewController *  
userController;


This is only useful if the InvoiceEditionViewController is  
instantiated in the UserListViewController nib, If it is, then  
chances are that the InvoiceEditionViewController is not being  
instantiated correctly unless you have overridden -init or - 
initWithCoder:, depending on the super class.


InvoiceEditionViewController can be sensibly instantiated via xib,  
or set by other means. I recommend then to have an  
NSObjectController in InvoiceEditionViewController.xib whose  
content is bound to  
UserListViewController.NSArrayController.selection (using correct  
ivar/property names, of course).
Ok I tried but when wan tto bind the labels to show the details I  
bind it to the NSObjectControlled I just configured, and the  
controller key goes to selection, which its not good, so whe I run  
I see its NO Selection. label.


No, "selection" is the correct controller key for data access. It is  
confusing for an object controller as there will only be one  
selection (or none), but that is how it works.


I did instead was to place an NSArrayController (users) in IB and  
bind the contents to   
userController._userListArrayController.arrangedObjects.
then the labels I bind the values to users, and the controller key  
to selection and the path to the attributes of the entity.


And it works 50%, I can see the values., but when I select another  
user, the values dosn't change, it's seems its getting only the 1st  
value of the array.


Of course. You are creating a whole different array controller that  
has its own selection semantics. Bindings are automatic but not  
magic. Scrap the array controller approach. It won't work. Do a

[MEET] Chicago CocoaHeads / CAWUG Tuesday October 13th

2009-10-13 Thread Bob Frank

Hi All,

Sorry for not sending out a reminder email. Our next meeting is  
tonight.  I hope you can make it and it was on your calendar.


The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group is  
holding our next meeting Tuesday, October 13th, at 7:00 PM at the  
Apple Store on Michigan Ave.



 Agenda:
- Book Report
- C4 Recap
- Rise in Indie Conferences & open discussion about their impact
- adjournment to O'Toole's

When:   
Tuesday, October 13th, 7:00 PM

Where:
Apple Store Michigan Avenue
679 North Michigan Ave. (at the corner of Huron & Michigan Ave.)
Chicago, IL 60611
http://tinyurl.com/Michigan-Ave-Apple-Store   (Google Maps URL)


- Bob

Tonight I will talk about C4 and the rise of the other indie Mac  
Developer conferences.  I'd like to open the floor to discuss the  
impact of the influx of new developers mostly driven by interest in  
iPhone development and what (if any) impact folks think it has or will  
have on desktop app development ecosystem.




- O'Tooles

	We will continue our discussions at our local watering hold Timothy  
O'Toole's at 622 Fairbanks (2 blocks east of the store).




We also wish to thank the folks who run the theater space at the Apple  
store for letting us have our meetings there, and Jonathan 'Wolf'  
Rentzsch for helping out so often.  Thanks all.


Also, if you are working on a project and would like to talk about it   
briefly / promote it, I think it would be fun for people to hear  
about  other people's projects. Please email me off line and you can  
talk at  a future meeting or would like a book to review we would  
welcome that too.

___

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

Please do not post admin requests or moderator comments to the list.
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: Getting AAC tag information

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 9:30 AM, Sven wrote:

Thanks... I don't want to encode any audio files, I merely want to  
be able to get and set tag data. For MP3s I can use id3lib no  
problems, but that doesn't help me with AAC files. I guess if  
there's no way to edit tags via the Apple libraries (if I understand  
you correctly) then the only thing left to do is write my own.


You can get tags via QuickTime. The problem is that changing tags, in  
general, requires re-writing the entire file. I think QuickTime could  
be used to update those tags along the way, if it were reading the  
file contents and writing them out to a new file, but I don't know  
nearly enough about the very gnarly QuickTime APIs for that.


There is an open source project called AtomicParsely that is supposed  
to help with parsing and generating AAC metadata, but I haven't used it.


—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: Code Sign verification on Leopard

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 9:25 AM, jonat...@mugginsoft.com wrote:

But it's not useless in the sense that it provides feedback that the  
code IS signed.
The code merely allows me  to detect if I have screwed up my build  
settings and managed to break the code signing.


Sure, it's useful for that. But when people see the phrase "code  
signing" they tend to assume it's magic sauce for detecting malicious  
code, so I wanted to set expectations for others wanting to use that  
snippet.


—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: Disabling clicking on links in webview

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 8:58 AM, Arun wrote:

I have an application where i use webview to display links to  
websites.

I need to know is there any way in which we can disable the clicking
on the links in the webview or is it possible to disable actions on
complete webview?


Look at the WebView delegate interfaces. One of them  
(WebNavigationDelegate?) lets you intercept attempts to load a new  
page; you can refuse the request.


If you want to disable all clicks, you can subclass WebView and  
override the various mouse event methods (defined in NSResponder) to  
do nothing.


—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: How to iterate over all objects stored with NSCoder

2009-10-13 Thread Jens Alfke


On Oct 12, 2009, at 9:40 PM, Michael Robinson wrote:

As I lost the source code, I would like to know if there is a way to  
dump all keys/values from NSCoder so I can use it to help me with my  
arduous rewrite.


There is not any API for this. Parsing an archive is pretty difficult  
unless you have the same classes available. Although if it's in XML,  
not binary, format, it is somewhat understandable if you squint at it  
hard enough (or parse it with NSXML.)


—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


arrayWithContentsOfFile

2009-10-13 Thread DKJ

I'm using this code to read an array from a plist:

NSArray *data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory()  
stringByAppendingPathComponent:@"/Documents/file.plist"]];


The docs say this method returns nil when the file doesn't exist  
(precisely: "Returns nil if the file can’t be opened..."). But the  
above code gives me an empty array instead, which caused some confusion.


Surely the docs can't be wrong...

dkj___

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

Please do not post admin requests or moderator comments to the list.
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: arrayWithContentsOfFile

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 2:43 PM, DKJ wrote:


I'm using this code to read an array from a plist:

NSArray *data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory()  
stringByAppendingPathComponent:@"/Documents/file.plist"]];


The docs say this method returns nil when the file doesn't exist  
(precisely: "Returns nil if the file can’t be opened..."). But the  
above code gives me an empty array instead, which caused some  
confusion.


Surely the docs can't be wrong...



  Nope. The docs are correct and I'm betting the file you specified  
in fact *doesn't* exist.


  "/Documents/file.plist" is probably not a valid path. You probably  
meant "~/Documents/file.plist", but that string isn't a valid path  
either. Use the appropriate path-manipulating NSString methods to  
expand the tilde to a full "/Users/someuser/..." path.


  I'll bet that fixes things.

--
I.S.

___

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

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

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

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


Re: Appropriate dealloc and finalize actions

2009-10-13 Thread Chris Hanson
On Oct 12, 2009, at 8:25 AM, Jens Alfke wrote:

> On Oct 12, 2009, at 4:26 AM, Karolis Ramanauskas wrote:
> 
>> As you can see each box has one or more little "inputs" and "outputs" in
>> fact these inputs and outputs are instances of one class (KROMPort). When I
>> drag a connection from output to an input, I set each "port's" connection
>> property to point to another "port". So Input points to Output and Output
>> points to Input. Only one-to-one relationships are allowed (one connection
>> per input/output).
> 
> It's best not to do this kind of cleanup in dealloc/finalize. Instead, have 
> an explicit method like -disconnect that's called to remove the object from 
> the graph. That way you're in direct control of removing objects. And yes, 
> when [foo disconnect] is called it will need to tell its connected object to 
> clear the connection to itself.

It’s also good in cases like this not to represent ownership of objects via the 
graph, but by some outer container.

For example, if I were creating an application with documents that consisted of 
connected nodes, I’d have the document own (retain) the nodes and have the 
nodes just reference (assign) each other.

That would allow me to keep “stop referencing node A from node B” distinct from 
“remove node A from the document.”  The latter may imply the former, but the 
former generally doesn’t imply the latter.

  — Chris


___

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

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

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

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


Re: arrayWithContentsOfFile

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 11:49 AM, I. Savant wrote:

 Nope. The docs are correct and I'm betting the file you specified  
in fact *doesn't* exist.


The docs say it returns nil if the file doesn't exist, and he's  
getting an empty array. That was his question.


 "/Documents/file.plist" is probably not a valid path. You probably  
meant "~/Documents/file.plist", but that string isn't a valid path  
either. Use the appropriate path-manipulating NSString methods to  
expand the tilde to a full "/Users/someuser/..." path.


You must have misread his code — he's using NSHomeDirectory() as a  
prefix.


—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


Validate NSToolbarPrintItem

2009-10-13 Thread Knut Lorenzen

Dear List,

how does one validate a NSToolbarPrintItem that was added in IB 3.2?  
The delegate's


- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem

doesn't even get called. The Toolbar Item Attributes in IB's Inspector  
are all grayed out. Connecting to my Custom View sending a print:  
message doesn't work either. Isn't NSToolbarPrintItem supposed to send  
a print: message to First Responder by default?


NSToolbarShowColorsItem and NSToolbarShowFontsItem are working just  
fine, it's only NSToolbarPrintItem that won't become activated.


Thanks for any hints,

Knut

___

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

Please do not post admin requests or moderator comments to the list.
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: Returning to app after phone call

2009-10-13 Thread Anthony Smith

Any ideas?

On Oct 13, 2009, at 1:11 PM, Anthony Smith wrote:

Is it possible, if my app initiates a phone call, that after the  
call the app will be relaunched? I've read the Application  
Programming Guide so I understand interruptions and URLs. However, I  
was a little confused on this aspect. Thanks any input.




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: arrayWithContentsOfFile

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 2:54 PM, Jens Alfke wrote:

The docs say it returns nil if the file doesn't exist, and he's  
getting an empty array. That was his question.

...
You must have misread his code — he's using NSHomeDirectory() as a  
prefix.


  My apologies, you're absolutely right. I read that on the iPhone in  
Google's mobile gmail reader ... while walking. :-)


  Sorry for the noise.

  A PLIST can have an array root or a dictionary root. Are you sure  
your PLIST has an array root? I would still expect nil (ie, it can't  
create an array from a dictionary-rooted PLIST), but it's worth  
checking.


--
I.S.




___

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

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

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

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


Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ


On 2009-10-13, at 12:01 , I. Savant wrote:


On Oct 13, 2009, at 2:54 PM, Jens Alfke wrote:

 A PLIST can have an array root or a dictionary root. Are you sure  
your PLIST has an array root? I would still expect nil (ie, it can't  
create an array from a dictionary-rooted PLIST), but it's worth  
checking.





I looked in the directory itself before running the code, and the  
plist files weren't there at all.


If someone else gets the same result, perhaps they could file a bug: I  
lack sufficient self-esteem to file one myself.


dkj

___

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

Please do not post admin requests or moderator comments to the list.
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: arrayWithContentsOfFile

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 3:08 PM, DKJ wrote:

I looked in the directory itself before running the code, and the  
plist files weren't there at all.




  Let me see if I understand what you're saying: You are expecting  
there to be *no* PLIST files (and so, you expect to get nil) but are  
getting an empty array?


  Can you post your relevant code? It almost sounds like you've  
created the array somewhere first.



If someone else gets the same result, perhaps they could file a bug:  
I lack sufficient self-esteem to file one myself.


  Well, let's exhaust the possibility of developer error first, then,  
if we've ruled that out, file away.



--
I.S.




___

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

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

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

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


Re: Returning to app after phone call

2009-10-13 Thread Alex Kac
It depends on the user. There is no way for you to do it  
programmatically. If the user hits "end call" then most of the time  
yes. But if the user hits home or what not, then no. But again, you  
can't "make" it happen.


On Oct 13, 2009, at 2:01 PM, Anthony Smith wrote:


Any ideas?

On Oct 13, 2009, at 1:11 PM, Anthony Smith wrote:

Is it possible, if my app initiates a phone call, that after the  
call the app will be relaunched? I've read the Application  
Programming Guide so I understand interruptions and URLs. However,  
I was a little confused on this aspect. Thanks any input.


___

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

Please do not post admin requests or moderator comments to the list.
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.

"Forgiveness is not an occasional act: it is a permanent attitude."
-- Dr. Martin Luther King




___

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

Please do not post admin requests or moderator comments to the list.
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: More Core Data Questions

2009-10-13 Thread Ben Trumbull


On Oct 13, 2009, at 3:17 AM, Jon Hull wrote:

You don't need proxies or NSProxy for this.  You can just use a  
delegate.  Off the cuff, I might consider implementing a protocol  
on your immutable objects for methods like "currentLocation" and  
"currentPlayer" which vector through a semi-global context object  
not unlike the app delegate.  Then you can use keypaths to  
naturally write currentPlayer.name and so forth.  NSProxy is  
unnecessarily heavy weight for simple delegation.  They use memory  
too, ja know.  And the semi-global context allows you to avoid  
making all your objects larger.  You might even model the "current  
state" as a formal entity.  That buys you change tracking, undo,  
multi-writer conflict resolutions and the ability to easily  
persistent and search for it.  It also allows other managed objects  
to work with it naturally.
Hmm... something to consider.  The proxies do allow some powerful  
runtime state effects.  The currentLocation was just a simple (and  
often used) example, but it is easy to have proxies which represent  
"The sister of the person I am currently talking to" or the location  
of that person or the item which that person holds in their hand.   
They can also be used to represent groups of characters.  This is  
very powerful, and has come in very useful.  Still, it might be  
possible to get the same functionality in another way.


Okay.  Typically the "Cocoa" way of doing that is by name and using  
keypaths instead of by pointer value and NSProxy.


and then call off  to the manager with the id whenever they need  
to run an event.  Inside
the manager I would either call off to a small sql database with  
blobs

holding freeze-dried (keyedArchiving) objects & an id column,


not a great plan.  No searching into blobs, no partially loading or  
saving the larger freeze dried objects.
hmm...  The largest blob would probably be an object with an array  
of 20 or so pointers/ids.  Not sure I need to search into them...  
mostly I just need to grab them by id.


I had considered just using core data for everything, but as I  
mentioned in a previous post, I *need* to have consistently ordered  
arrays of these immutable objects (which can be in multiple places  
in a single array, and can be in multiple arrays).  This is  
apparently difficult using core data :-(


It's not difficult, although it is a bit tedious.  Ordered  
relationships require you model the join table between two entities  
yourself (for many-to-manys), and add an ordering attribute.  For one- 
to-many, you can put the ordering attribute on the destination entity  
(no join table necessary).


Although, now that I think about it, perhaps I can store *just* the  
array of ids as a binary property, and have everything else defined  
in the entity.  I will have to do some experiments.


Yes, you could do that.


Also, you could do that trivially with Core Data and just be done.
Do you mean store the blobs in a core data managedObject instead of  
a SQL database?


yes


or avoid the blobs entirely using core data?


Probably

Unfortunately, it sounds like you don't have a ready alternative  
besides to spend a considerable amount of your own engineering  
resources.  You'll have to decide if learning Core Data, and tuning  
your app performance fits within your schedule requirements, and  
whether implementing, debugging, and tuning all this yourself will  
really take any less time.


You might consider mocking up a Core Data version over a few days  
and seeing how far you get.


Yes, I think I will try that.

Any advice on how to handle the 2 different types of graphs  
mentioned in my earlier post?  Ideally I should have 2 files. One  
holding the event tree and one holding the rest (i.e. the stuff that  
changes).  They main problem there is that they have connections  
between each other (e.g. an event might take a location or character  
as a parameter)



Just create two stores and add them to the same  
NSPersistentStoreCoordinator.  The connections between them can be  
represented via keypaths (bound dynamically) or persistently by  
stashing the objectID's URI away and materializing it in a transient  
relationship in -awakeFromFetch


- 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: arrayWithContentsOfFile

2009-10-13 Thread DKJ


On 2009-10-13, at 12:12 , I. Savant wrote:

Let me see if I understand what you're saying: You are expecting  
there to be *no* PLIST files (and so, you expect to get nil) but are  
getting an empty array?



Bingo.
___

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

Please do not post admin requests or moderator comments to the list.
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: arrayWithContentsOfFile

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 3:23 PM, DKJ wrote:



On 2009-10-13, at 12:12 , I. Savant wrote:

Let me see if I understand what you're saying: You are expecting  
there to be *no* PLIST files (and so, you expect to get nil) but  
are getting an empty array?



Bingo.


  Again, can you post your relevant code?

--
I.S.




___

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

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

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

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


NSString Class Instance Variables

2009-10-13 Thread Richard Somers
This might be a dumb question but just out of curiosity I was looking  
at NSString.h. The class appears to have no instance variables.


/* NSString.h ... */

@interface NSString : NSObject 

- (NSUInteger)length;   
- (unichar)characterAtIndex:(NSUInteger)index;

@end

The same is true for NSArray, NSSet, and other foundation classes. If  
the class has no instance variables, what does it do for storage?


Richard

___

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

Please do not post admin requests or moderator comments to the list.
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: NSString Class Instance Variables

2009-10-13 Thread Stephen J. Butler
On Tue, Oct 13, 2009 at 2:40 PM, Richard Somers
 wrote:
> The same is true for NSArray, NSSet, and other foundation classes. If the
> class has no instance variables, what does it do for storage?


___

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

Please do not post admin requests or moderator comments to the list.
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: NSString Class Instance Variables

2009-10-13 Thread David Duncan

On Oct 13, 2009, at 12:40 PM, Richard Somers wrote:

This might be a dumb question but just out of curiosity I was  
looking at NSString.h. The class appears to have no instance  
variables.



NSString is just an interface to a cluster of classes that implement  
the actual functionality, ditto for many other Foundation classes.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ


On 2009-10-13, at 12:35 , I. Savant wrote:

 Again, can you post your relevant code?




NSArray *data;

data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory()  
stringByAppendingPathComponent:@"/Documents/file.plist"]];


if( data == nil )
 do this;


There's no file.plist in the directory. But "do this" doesn't get done.

However, "do this" does get done when I have this:


if( [data count] == 0 )
 do this;


So it looks like arrayWithContentsOfFile: is returning an empty array  
when file.plist doesn't exist.


dkj
___

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

Please do not post admin requests or moderator comments to the list.
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: arrayWithContentsOfFile

2009-10-13 Thread DKJ
Hmm... I ran a similar code snippet in another project, and nil is  
returned, as the docs say.


So the file must be created somewhere else. I'll find out where.

I'm glad the docs aren't wrong.

dkj
___

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

Please do not post admin requests or moderator comments to the list.
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


Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Bridger Maxwell
Hey,
For a cross-platform game, I need to make a game file format that would be
readable and writeable on a few different platforms. The game is simply a
serialized object graph. I am looking at the XML format used by
NSKeyedArchiver, and perhaps implementing it in the other languages.
Alternatively, I can make my own subclasses of NSCoder.

I would like to read more on the NSKeyedArchiver XML format, but can't find
documentation on it. Is it open? NSKeyedArchiver has a property
"outputFormat" which can be set to NSPropertyListXMLFormat_v1_0. However, I
thought property lists could only contain certain objects (dictionary,
array, etc.), and didn't handle things like circular references. Is the
property list format and the format used by NSKeyedArchiver the same?

-Bridger Maxwell
___

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

Please do not post admin requests or moderator comments to the list.
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: arrayWithContentsOfFile

2009-10-13 Thread James Walker

DKJ wrote:


NSArray *data;

data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory() 
stringByAppendingPathComponent:@"/Documents/file.plist"]];


I would have used @"Documents/file.plist" as the parameter there.  Your 
way, I wonder if you'd end up with a double slash, but maybe it's 
smarter than that.


--
  James W. Walker, Innoventive Software LLC
  
___

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

Please do not post admin requests or moderator comments to the list.
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: arrayWithContentsOfFile

2009-10-13 Thread I. Savant

On Oct 13, 2009, at 3:52 PM, DKJ wrote:



NSArray *data;

data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory()  
stringByAppendingPathComponent:@"/Documents/file.plist"]];


if( data == nil )
do this;


There's no file.plist in the directory. But "do this" doesn't get  
done.


  So that's exactly how the code appears? You declare your "data"  
array and immediately assign it thereafter? Nothing in between?


  Very odd. I haven't seen this behavior, nor can I reproduce it.  
What happens if you set a breakpoint, step past the  
+arrayWithContentsOfFile call, and "po data" at the debugger console?  
What does it log?


--
I.S.




___

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

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

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

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


Object Alloc Instrument and releasing question

2009-10-13 Thread Nick Rogers

Hi,
I'm running Xcode 3.2 on Snow Leopard.
There is an object of type HDIR which can contains a mutable array of  
children objects of type HDIR, so a tree is formed.
I can go back using the Back button and release this HDIR type root  
object.

And then again form a new tree.
When a tree is formed the VM according to Activity Monitor reaches a  
high value and when I release this tree, it doesn't come any lower,  
but when I again form the tree, it starts increasing from that max  
value.
Does it mean that VM is not being freed, due to some bug in my  
releasing the tree?


Here is some Object Alloc instrument data after the first tree is  
formed (1), after releasing that tree (2) and after again making a  
tree (3):

CategoryLive Bytes  #Living #Transitory 
Overall Bytes   #Overall
1.  HDIR1.73 MB 10333   10428   
3.48 MB 20761
2.  HDIR0   0   20761   
3.48 MB 20761
3.  HDIR1.73 MB 10333   31189   
6.97 MB 41522

Does the #Living being added to #Transitory means that tree is not  
actually freed?


The Instrument docs says about Object Alloc:

This instrument captures the following information:

Category - typically a Core Foundation object, an Objective-C class,  
or a raw block of memory.
Net Bytes - the number of bytes of this type currently allocated but  
not yet released.
# Net - the number of objects or memory blocks of this type currently  
allocated but not yet released.
Overall Bytes - the total number of bytes of this type that have been  
allocated, including those that have been released.
# Overall - the total number of objects or memory blocks of this type  
that have been allocated, including those that have been released.
# Allocations (Net / Overall) - A histogram of the current and total  
counts. The bars are normally shades of blue. They are colored shades  
of yellow when the ratio between the total number of objects and the  
peak, or the ratio between the peak and the current number, is 1/3 or  
less. The bars are shades of red when the ratio is 1/10 or less.

It doesn't list the meaning of #Transitory.

Thanks,
Nick

___

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

Please do not post admin requests or moderator comments to the list.
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: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Tony Parker

Hi Bridger,

On Oct 13, 2009, at 1:08 PM, Bridger Maxwell wrote:


Hey,
For a cross-platform game, I need to make a game file format that  
would be
readable and writeable on a few different platforms. The game is  
simply a

serialized object graph. I am looking at the XML format used by
NSKeyedArchiver, and perhaps implementing it in the other languages.
Alternatively, I can make my own subclasses of NSCoder.

I would like to read more on the NSKeyedArchiver XML format, but  
can't find

documentation on it. Is it open? NSKeyedArchiver has a property
"outputFormat" which can be set to NSPropertyListXMLFormat_v1_0.  
However, I

thought property lists could only contain certain objects (dictionary,
array, etc.), and didn't handle things like circular references. Is  
the

property list format and the format used by NSKeyedArchiver the same?

-Bridger Maxwell


Part of the work done by the keyed archiver is indeed to get plist- 
compatible values for keys in the objects in the graph that is being  
archived. However, the data output by the keyed archiver is really  
only designed to be read in by the keyed unarchiver. You would end up  
reimplementing the archiver logic for your other platforms, and at  
that point it seems like you might as well have just designed your own  
format (flat file, property list of your own making, XML, whatever).  
What the best option is for your game probably depends on the  
complexity of your object graph, what platforms you are targeting, and  
other things.


Good luck,
- Tony

___

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

Please do not post admin requests or moderator comments to the list.
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: Code Sign verification on Leopard

2009-10-13 Thread jonat...@mugginsoft.com


On 13 Oct 2009, at 19:28, Jens Alfke wrote:



On Oct 13, 2009, at 9:25 AM, jonat...@mugginsoft.com wrote:

But it's not useless in the sense that it provides feedback that  
the code IS signed.
The code merely allows me  to detect if I have screwed up my build  
settings and managed to break the code signing.


Sure, it's useful for that. But when people see the phrase "code  
signing" they tend to assume it's magic sauce for detecting  
malicious code, so I wanted to set expectations for others wanting  
to use that snippet.


I think there is a bit of "magic sauce" to be had in the fact an app  
signed with a trusted anchor is, as you know, trusted by various  
subsystems such as the app firewall, keychain, etc.

http://developer.apple.com/mac/library/technotes/tn2007/tn2206.html#TNTAG1

Jonathan Mitchell

Developer
http://www.mugginsoft.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: arrayWithContentsOfFile

2009-10-13 Thread DKJ

On 2009-10-13, at 13:27 , I. Savant wrote:

So that's exactly how the code appears?



Yes. But of course I have to look in the directory before the code  
runs. So the file must be created somewhere before processing gets to  
this point.


I created a test application with just this code in it, and couldn't  
reproduce the result either: nil was returned, just as the docs say it  
should be.


So my self-esteem takes another hit; but that's better than losing  
faith in scripture.


dkj
___

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

Please do not post admin requests or moderator comments to the list.
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: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 1:08 PM, Bridger Maxwell wrote:

I would like to read more on the NSKeyedArchiver XML format, but  
can't find

documentation on it. Is it open?


No. It's undocumented and could change in the future; writing code for  
another platform that parses it would probably be a bad idea.



NSKeyedArchiver has a property
"outputFormat" which can be set to NSPropertyListXMLFormat_v1_0.  
However, I

thought property lists could only contain certain objects (dictionary,
array, etc.), and didn't handle things like circular references. Is  
the

property list format and the format used by NSKeyedArchiver the same?


The property list itself contains only strings, dictionaries, etc. But  
the information in that property list describes arbitrary objects. For  
example, each object might be represented by a dictionary whose keys  
are property names and values are integers that reference other  
objects in the file.


—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: Returning to app after phone call

2009-10-13 Thread David Duncan

On Oct 13, 2009, at 2:58 PM, Kyle Sluder wrote:


If you expect any turnaround at all, pay for a DTS incident.



Just for clarity, DTS promises a 3-business day turn around. We may  
respond sooner, but 3-business days is what we advertise :).



--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: Returning to app after phone call

2009-10-13 Thread Kyle Sluder
On Tue, Oct 13, 2009 at 12:01 PM, Anthony Smith
 wrote:
> Any ideas?

Seriously?  You leave two hours in between sending a message and
expecting a response?

If you expect any turnaround at all, pay for a DTS incident.  Don't
spam the highly-trafficked list full of volunteers.

--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: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Ken Ferry
On Tue, Oct 13, 2009 at 2:40 PM, Jens Alfke  wrote:

>
> On Oct 13, 2009, at 1:08 PM, Bridger Maxwell wrote:
>
>  I would like to read more on the NSKeyedArchiver XML format, but can't
>> find
>> documentation on it. Is it open?
>>
>
> No. It's undocumented and could change in the future; writing code for
> another platform that parses it would probably be a bad idea.


I agree.

But as you originally noted, there's nothing stopping you from writing your
own coder subclasses that read and write a format you understand.

Nor is there anything stopping you from dropping in classes written by
someone else.  You could use
MAKeyedArchiver.
 As long as the source is in your app, you control the format.

-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: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Iceberg-Dev


On Oct 13, 2009, at 12:42 AM, Jim Correia wrote:

On Mon, Oct 12, 2009 at 6:36 PM, Iceberg-Dev  
 wrote:


From what I've found in the documentation, the UTI type of a file  
can be retrieved using the

LaunchServices APIs. This requires to provide a FSRef.

Wouldn't there be an API I didn't see in Foundation that lets you  
obtain the type without having to

convert, at least, a NSURL to a FSRef?


See, on NSWorkspace:

- (NSString *)typeOfFile:(NSString *)absoluteFilePath error:(NSError
**)outError;


Thanks.

Unfortunately, I need a solution that is daemon-safe.


___

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

Please do not post admin requests or moderator comments to the list.
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: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Kyle Sluder
On Tue, Oct 13, 2009 at 3:30 PM, Iceberg-Dev  wrote:
> Unfortunately, I need a solution that is daemon-safe.

If you need a daemon-safe solution, why are you so averse to using an FSRef?

--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: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Ken Ferry
On Mon, Oct 12, 2009 at 3:45 PM, Jens Alfke  wrote:

>
> On Oct 12, 2009, at 3:36 PM, Iceberg-Dev wrote:
>
>  Wouldn't there be an API I didn't see in Foundation that lets you obtain
>> the type without having to convert, at least, a NSURL to a FSRef?
>>
>
> In 10.5 there were a bunch of mismatches between APIs like this, that
> required clients to convert between paths, URLs and FSRefs. This got cleaned
> up a lot in 10.6 because it introduces performance overhead. So it's likely
> that there's a CFURL-based version of this API in 10.6.


Yep, though I don't think there is anything (for this stuff) in CFURL that
isn't also in NSURL.

You want -[NSURL getResourceValue:forKey:error:] with
NSURLTypeIdentifierKey.

-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: NSFetchedResultController bug?

2009-10-13 Thread Steve Steinitz

Hello,

On 13/10/09, cocoa-dev-requ...@lists.apple.com wrote:

When I add these to a secondary managed object context (MOC) 
and then  merge these changes with the primary MOC, the 
application crashes with  the following error:


2009-10-13 02:59:12.787 MyApp[43049:207] *** Terminating app 
due to  uncaught exception 'NSRangeException', reason: '*** 
-[NSCFArray  objectAtIndex:]: index (7) beyond bounds (7)'


I suspect that you might be seeing the same issue that I'm 
seeing.  If so, your multiple MOC setup isn't relevant.


I posted here a few days ago about it and got a helpful response 
from Ben Trumbull saying its a known issue that was addressed in 
version iPhone OS version 3.1.  Version 3.1 didn't fix it for me.


Ben said that the issue has been discussed on the iPhone 
developer forum.  I'm awaiting approval of my iPhone developer 
membership in order to access the forums, so I can't confirm 
that the information there will solve my (our?) problem.


Try commenting out endUpdates and see if the exception goes 
away.  If it does, we may have the same problem.


Cheers,

Steve

___

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

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

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

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


Re: How to iterate over all objects stored with NSCoder

2009-10-13 Thread Graham Cox


On 14/10/2009, at 5:32 AM, Jens Alfke wrote:

As I lost the source code, I would like to know if there is a way  
to dump all keys/values from NSCoder so I can use it to help me  
with my arduous rewrite.


There is not any API for this. Parsing an archive is pretty  
difficult unless you have the same classes available. Although if  
it's in XML, not binary, format, it is somewhat understandable if  
you squint at it hard enough (or parse it with NSXML.)



It can also be parsed by the Property List Editor utility, which at  
least gives you a glimpse at the names of the classes and keys used.  
It takes some detective work but you can even work out what keys are  
with which class. It's not much, but it's something.


--Graham
___

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

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

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

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


Re: NSString Class Instance Variables

2009-10-13 Thread Graham Cox


On 14/10/2009, at 6:40 AM, Richard Somers wrote:

The same is true for NSArray, NSSet, and other foundation classes.  
If the class has no instance variables, what does it do for storage?



Apart from the class cluster answer you already got, the public  
headers don't need to include any instance variables even if they  
exist in reality. You can do this yourself - compile the code using  
the 'real' headers then publish a public header that strips the ivars  
and only includes any public API you want to expose. It's a good habit  
to mark ivars as @private unless you really, really cannot avoid doing  
that, and if they are private there's no need to publish them.


--Graham


___

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

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

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

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


Re: arrayWithContentsOfFile

2009-10-13 Thread Graham Cox


On 14/10/2009, at 6:52 AM, DKJ wrote:


if( data == nil )
do this;


There's no file.plist in the directory. But "do this" doesn't get  
done.


However, "do this" does get done when I have this:


if( [data count] == 0 )
do this;


So it looks like arrayWithContentsOfFile: is returning an empty  
array when file.plist doesn't exist.



Note that the test for [data count] == 0 will work as a test whether  
the method returns nil or an empty array. If it returns nil, the  
message [nil count] is legal and will always return 0. So that  
approach catches both possibilities, so the question of whether the  
docs are wrong (unlikely, but I can't see the problem either) goes away.


Similarly, tests such as [string length] > 0 also catch both nil  
strings and empty ones, so kill two birds with one stone. You don't  
need to bother with things like if( string && [string length] > 0 )...


--Graham


___

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

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

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

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


Re: NSString Class Instance Variables

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 4:29 PM, Graham Cox wrote:

Apart from the class cluster answer you already got, the public  
headers don't need to include any instance variables even if they  
exist in reality.


Only if the class cannot be subclassed.

In the 32-bit runtime, instance variable offsets are determined at  
compile time based on the total size of superclass data, so if the  
compiler doesn't know all of the superclass instance variables, it'll  
generate incorrect code. (The 64-bit runtime doesn't have this  
limitation.)


—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: NSString Class Instance Variables

2009-10-13 Thread Greg Parker

On Oct 13, 2009, at 4:29 PM, Graham Cox wrote:

On 14/10/2009, at 6:40 AM, Richard Somers wrote:
The same is true for NSArray, NSSet, and other foundation classes.  
If the class has no instance variables, what does it do for storage?


Apart from the class cluster answer you already got, the public  
headers don't need to include any instance variables even if they  
exist in reality. You can do this yourself - compile the code using  
the 'real' headers then publish a public header that strips the  
ivars and only includes any public API you want to expose. It's a  
good habit to mark ivars as @private unless you really, really  
cannot avoid doing that, and if they are private there's no need to  
publish them.


On 32-bit Mac, if you strip ivars from the header then other code  
cannot subclass that class. The compiler will put subclass and  
superclass ivars in the same place, leading to exciting data  
corruption bugs.


All system frameworks are honest about their ivars, because they need  
to support subclasses.



--
Greg Parker gpar...@apple.com Runtime Wrangler


___

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

Please do not post admin requests or moderator comments to the list.
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: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Graham Cox


On 14/10/2009, at 8:40 AM, Jens Alfke wrote:



I would like to read more on the NSKeyedArchiver XML format, but  
can't find

documentation on it. Is it open?


No. It's undocumented and could change in the future;



While strictly true, it's not possible that Apple could really ever  
stop supporting it, due to the many millions of files out there that  
use it and will have to remain readable in their existing form. It may  
be that it gets superseded or converted to something else when read  
in, but surely never become impossible to read. One of the huge  
advantages of keyed archives is that they are highly extensible  
without breaking backward compatibility (if you're careful) so I think  
using keyed archives is a pretty safe bet for format longevity.


The difficulty is that the exact structure is not publicly documented,  
though it is readily reverse engineered. As long as that engineering  
was done diligently and carefully, I believe you could support the  
format on other platforms well enough and remain compatible with  
Cocoa. Whether the effort of doing this is worth it compared to just  
rolling a cross-platform format of your own is something only you can  
determine.


--Graham


___

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

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

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

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


Re: NSString Class Instance Variables

2009-10-13 Thread Graham Cox


On 14/10/2009, at 10:38 AM, Greg Parker wrote:

On 32-bit Mac, if you strip ivars from the header then other code  
cannot subclass that class. The compiler will put subclass and  
superclass ivars in the same place, leading to exciting data  
corruption bugs.


All system frameworks are honest about their ivars, because they  
need to support subclasses.





Yes, that makes perfect sense. I guess I was assuming that you would  
only be using a class 'as is', not subclassing it.


--Graham


___

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

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

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

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


Re: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Jens Alfke


On Oct 13, 2009, at 4:43 PM, Graham Cox wrote:

While strictly true, it's not possible that Apple could really ever  
stop supporting it, due to the many millions of files out there that  
use it and will have to remain readable in their existing form.


True, but it can change in ways that are backward-compatible to  
Apple's implementation. But reverse-engineered implementations might  
fail to handle the updated format. I've seen this sort of thing happen  
in the past in other areas.


—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: Getting AAC tag information

2009-10-13 Thread Graham Cox


On 14/10/2009, at 5:25 AM, Jens Alfke wrote:

The problem is that changing tags, in general, requires re-writing  
the entire file.



And even in iTunes, if you edit tags while the track is playing, will  
often cause a noticeable pause in the output while it does this, so it  
doesn't seem as if there is any magic way to avoid it.


--Graham


___

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

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

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

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


Re: Property List Format vs NSKeyedArchiver Format

2009-10-13 Thread Graham Cox


On 14/10/2009, at 10:51 AM, Jens Alfke wrote:

While strictly true, it's not possible that Apple could really ever  
stop supporting it, due to the many millions of files out there  
that use it and will have to remain readable in their existing form.


True, but it can change in ways that are backward-compatible to  
Apple's implementation. But reverse-engineered implementations might  
fail to handle the updated format. I've seen this sort of thing  
happen in the past in other areas.



There's still no way they could abandon the current format as it is  
today entirely, because passing a newly written file to an app running  
on an older version of the OS would break. At the very least it would  
have to say "file x could not be opened", but it's a reasonable  
expectation that archiving code written today would emit a backward- 
compatible file when run on a future version of the OS. Thus even if a  
much better (read, more efficient, less buggy) version of the keyed  
archive format came along, NSKeyedArchiver would have to default to  
the existing format to avoid breaking thousands of existing apps.  
Developers could opt to emit the more modern format if they are  
revving their apps for the new version of the OS, knowing that they  
are cutting off backward compatibility by doing so - but it would have  
to be opt-in.


I suppose it's conceivable that the format could change in a way that  
is still readable by older dearchivers by taking advantage of known  
implementation quirks, and that could break alternative  
implementations, but since the older format would still have to be  
correctly dearchivable as well, as long as your implementation wrote a  
correct file in the older format, it would be forward compatible,  
which is at least as important. I would imagine that format changes  
that could slip through the implementation cracks of an older  
dearchiver would be necessarily very minor, and hence probably of very  
little value. Also, would they risk it, given that there already could  
be alternative dearchiving implementations out there they don't control?


That's without considering the cross-platform issue (or rather, seeing  
a new version of OSX as a different platform). Writing out the format  
to disk effectively freezes the implementation in place for all time  
(for at least a reasonable definition of 'all time'). If Apple did  
break keyed archiving either forward and backward compatibility there  
would be a huge outcry. There have been outcries over much less; I  
just don't think it's even slightly likely that they would contemplate  
doing it. Sequential archiving is still supported for exactly this  
reason. Surely the attraction of using keyed archiving for saving is  
that we can safely assume Apple ain't going to be messing with it? If  
there's even a remote chance of them doing so, it would mean that no  
developer would risk using it for fear of having their files break  
randomly at Apple's whim.


I guess one reason I'm harping on about this is that my current app  
does write the main data component of its files as a keyed archive  
(the user can choose XML or binary versions) but at some point we do  
vaguely plan to allow it to be opened cross-platform, by writing our  
own dearchiver for the XML version, much as the OP is considering.  
(And doesn't the XML format option exist for exactly this purpose?  
Otherwise why bother as it creates a much larger file than the  
binary). If there's no reassurance that it's a safe strategy, then we  
may as well consign keyed archiving to the dustbin as an unsafe  
technology. Since that just doesn't seem reasonable, the conclusion  
must be that the format will always remain readable forwards and  
backwards.


--Graham


___

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

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

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

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


  1   2   >