Re: NSTextField selection customization

2010-06-15 Thread vincent habchi
Jens, Graham,

> Note that NSTextView has: - 
> (void)setSelectionGranularity:(NSSelectionGranularity)granularity

Yes, I saw that, it's a nice method.

> which might be all you need - just set it to NSSelectByWord every time you 
> change the selection. This will keep getting reset so something will need to 
> keep forcing it back to 'word' selection, but it might be possible to do this 
> in the delegate and not require a subclass.

Actually, I need a mix of both modes (I need to rub out keywords on a per-word 
basis, but let variables be corrected on a character granularity); so I won't 
be trivial, but far to be impossible.

Thanks to both,
Vincent___

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

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

Help/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: NSTextField selection customization

2010-06-15 Thread Graham Cox

On 16/06/2010, at 6:16 AM, vincent habchi wrote:

> Le 15 juin 2010 à 21:58, Jens Alfke a écrit :
> 
>> You’ll end up working with NSTextView regardless. NSTextField doesn’t do its 
>> own text editing, it overlays a text view called the ‘field editor’ that’s 
>> used by all controls in the window. So to make this work in a text field 
>> you’d need to create a tricked-out text view and then install it as a custom 
>> field editor on that text field.
> 
> Thanks for the answer, that's what I suspected. Before getting on, what, in 
> your opinion, is the most handy solution? In order, what would you advise : 
> NSTextView or a custom field editor?
> 
> Vincent___


Note that NSTextView has: - 
(void)setSelectionGranularity:(NSSelectionGranularity)granularity

which might be all you need - just set it to NSSelectByWord every time you 
change the selection. This will keep getting reset so something will need to 
keep forcing it back to 'word' selection, but it might be possible to do this 
in the delegate and not require a subclass.

--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: Service without Icon or Window?

2010-06-15 Thread Peter Ammon

On Jun 15, 2010, at 2:56 PM, Lightning Duck wrote:

> I need to make an application  that runs a bit as a 'service' if you will.  
> Not in the sense of running from the "Services" menu but something the tuns 
> continually in the background with an Icon in the Dock or a Window of it's 
> own, that monitors when files are added or removed from a directory
> 
> So basically I have two requirements
> 
> Monitor the contents of a directory
> 
> Run without visibility?
> 
> Can anyone send me to some pointers for how to do either, or both, of these 
> tasks?

It sounds like you want a launchd agent.  launchd can launch your program when 
certain paths are modified, via the WatchPaths or QueueDirectories info plist 
keys.

The advantage of this approach is that your process does not have to run 
continuously in the background: it's launched on-demand, and can exit when it's 
finished.

-Peter ___

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

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

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

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


Re: Service without Icon or Window?

2010-06-15 Thread Kyle Sluder
On Tue, Jun 15, 2010 at 2:56 PM, Lightning Duck  wrote:
> I need to make an application  that runs a bit as a 'service' if you will.  
> Not in the sense of running from the "Services" menu but something the tuns 
> continually in the background with an Icon in the Dock or a Window of it's 
> own, that monitors when files are added or removed from a directory

What you want to do is called either a "daemon" or an "agent." There
is a technote that explains the difference, and is required reading if
you want to implement anything of the sort:
http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html

> So basically I have two requirements
>
> Monitor the contents of a directory

You can do this with a launchd job that watches a set of paths.

--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: Service without Icon or Window?

2010-06-15 Thread Jerry Krinock

On 2010 Jun 15, at 14:56, Lightning Duck wrote:

> Monitor the contents of a directory

Either a Kernel Queue or FSEvents.  Read this:

http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/FSEvents_ProgGuide/KernelQueues/KernelQueues.html

> Run without visibility?

Start by reading this, watching for the word "background".

http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/LaunchServicesConcepts/LSCConcepts/LSCConcepts.html#//apple_ref/doc/uid/TP3999-CH202-TP9



P.S.

> Not in the sense of running from the "Services" menu

Yeah, I sure wish Apple would have thought up a more distinctive name for that. 
 One time I wanted to learn about "Services as in the Services Menu" and spent 
most of a dau trying to filter internet search results :(

___

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

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

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

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


Core Data : Managed Object Models : Configurations, Versions

2010-06-15 Thread Jerry Krinock
In the Core Data Programming Guide > Managed Object Models,

"A persistent store coordinator can only have one managed object model, so by 
default each store associated with a given coordinator must contain the same 
entities.  To work around this restriction ... You typically use configurations 
..."

Well, I have a document-based Core Data app and would like to store some 
logging stuff in an sqlite store in ~/Application Support/MyApp/.  The entities 
modelling the logging stuff are all different than the entities in the 
document's model.  So, I believe I'm in the situation described above.  Yes, it 
*seems like it would be inefficient* to add the logging entities to the 
existing managed object model.  To me, the natural solution would be to create 
a whole new persistence stack based on another managed object model for my 
logging stuff.  Yet the documentation seems to suggest that I instead pack the 
new entities into the existing managed object model and then segregate them 
using a "configuration".

Am I reading this correctly?

What is so bad about multiple managed object models that we invented 
"configurations" just to avoid them?

But wait, a paradox ...

There are five "Initializing" methods in NSManagedObjectModel.  Four of them 
involve "merging" models, and indeed one of these is used in the Xcode Core 
Data non-document-based template project.

Apparently it is common to "merge" managed object models.  When is this done?

My app's bundle contains three managed object models, but they are for 
versioning; a current version and two older versions.  When I create an 
in-memory store for temporary manipulation, following that Xcode template code 
I create a managed object model using [NSManagedObjectModel 
mergedModelFromBundles:nil].

Eeek.  Is this merging my old and current model versions?

If so, why doesn't that give me "Can't merge models with same entities" errors?

Would it be better to initialize this managed object model using only the 
current version, with -[NSManagedObjectModel initWithContentsOfURL:]?

To do that I'd need to pass a file URL to the current model resource.  
Hard-coding that would be fragile.  Core Data seems to have no problem 
identifying the current model resource, but an API for this seems conspicuously 
absent.

How can I get the file URL of the *current* model resource?

Thank you for reading all this!

Jerry Krinock

___

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

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

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

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


[iPhone] Determining minimum height for a UIWebView

2010-06-15 Thread WT
Hello,

I'm trying to find out how to set the height of a UIWebView instance, given its 
content, so that the user doesn't need to scroll the UIWebView itself to see 
that content. Of course, the content might not fit in the vertical space 
available but the UIWebView instance is part of a tableview cell, so scrolling 
will be handled by the table view.

Any help is greatly appreciated.
WT___

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

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

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

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


Service without Icon or Window?

2010-06-15 Thread Lightning Duck
I need to make an application  that runs a bit as a 'service' if you will.  Not 
in the sense of running from the "Services" menu but something the tuns 
continually in the background with an Icon in the Dock or a Window of it's own, 
that monitors when files are added or removed from a directory

So basically I have two requirements

Monitor the contents of a directory

Run without visibility?

Can anyone send me to some pointers for how to do either, or both, of these 
tasks?

Thanks,
Jay
___

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

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

Help/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: NSTextField selection customization

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 1:16 PM, vincent habchi wrote:

> Thanks for the answer, that's what I suspected. Before getting on, what, in 
> your opinion, is the most handy solution? In order, what would you advise : 
> NSTextView or a custom field editor?

I think I’d go with the custom field editor, since that way the text field will 
continue to look and feel like a regular text field. You can make a textview 
the size of a text field, but it doesn’t behave exactly the same without some 
massaging.

—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: NSTextField selection customization

2010-06-15 Thread vincent habchi
Le 15 juin 2010 à 21:58, Jens Alfke a écrit :

> You’ll end up working with NSTextView regardless. NSTextField doesn’t do its 
> own text editing, it overlays a text view called the ‘field editor’ that’s 
> used by all controls in the window. So to make this work in a text field 
> you’d need to create a tricked-out text view and then install it as a custom 
> field editor on that text field.

Thanks for the answer, that's what I suspected. Before getting on, what, in 
your opinion, is the most handy solution? In order, what would you advise : 
NSTextView or a custom field editor?

Vincent___

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

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

Help/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: Locating Frameworks

2010-06-15 Thread F van der Meeren
I did, an hour before hitting this maillist, no response yet.

On 15 Jun 2010, at 21:56, Jens Alfke wrote:

> 
> On Jun 15, 2010, at 12:49 PM, F van der Meeren wrote:
> 
>> My guess is that the SDK overrules my own choice, in favor of the 2.6 
>> version. Do you have any clue on how to fix this?
> 
> Huh, no, that’s weird. You should ask on the xcode-users mailing list, as it 
> sounds like a tools issue.
> 
> —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: NSTextField selection customization

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 12:48 PM, vincent habchi wrote:

> I'd like to customize the way an NSTextField works, especially the selection 
> mechanism (I'd would like the selection to break only at word boundaries, 
> instead of at every character). Is this possible, or shall I turn to the 
> bigger and bulkier NSTextView?

You’ll end up working with NSTextView regardless. NSTextField doesn’t do its 
own text editing, it overlays a text view called the ‘field editor’ that’s used 
by all controls in the window. So to make this work in a text field you’d need 
to create a tricked-out text view and then install it as a custom field editor 
on that text field.

—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: Locating Frameworks

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 12:49 PM, F van der Meeren wrote:

> My guess is that the SDK overrules my own choice, in favor of the 2.6 
> version. Do you have any clue on how to fix this?

Huh, no, that’s weird. You should ask on the xcode-users mailing list, as it 
sounds like a tools issue.

—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: Locating Frameworks

2010-06-15 Thread F van der Meeren

On 15 Jun 2010, at 18:43, Jens Alfke wrote:

> 
> On Jun 15, 2010, at 9:19 AM, F van der Meeren wrote:
> 
>> I am trying to link to the Python.framework. 
>> According to the manpages the framework directories are searched in the 
>> following order:
>> "The default framework search path is /Library/Frameworks then 
>> /System/Library/Frameworks.”
> 
> If you’ve added Python.framework to your Xcode project, I think it will use 
> that exact framework instead of following the search path. Look in your 
> project and change that framework to the one you actually want to use.

When I  use "get info" on the python framework, it points to 
/Library/Frameworks/Python.framework. As it should be (I think).

> 
> You can use ‘otool’ to examine the library paths compiled into the binary.

The otool -L says :

/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility 
version 2.6.0, current version 2.6.1)

My guess is that the SDK overrules my own choice, in favor of the 2.6 version. 
Do you have any clue on how to fix this?

> 
> —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


NSTextField selection customization

2010-06-15 Thread vincent habchi
Hi there,

I'd like to customize the way an NSTextField works, especially the selection 
mechanism (I'd would like the selection to break only at word boundaries, 
instead of at every character). Is this possible, or shall I turn to the bigger 
and bulkier NSTextView?

Thanks,
Vincent___

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

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

Help/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 Access iPhoto,iTunes and iMove Playlist Information

2010-06-15 Thread Isaac Wankerl
On Tue, Jun 15, 2010 at 12:28 PM, Kyle Sluder  wrote:

> On Tue, Jun 15, 2010 at 10:14 AM, Jens Alfke  wrote:
> > That’s not true — you can access the apps’ interchange files, which are
> just
> > regular property lists. (For example, ~/Music/iTunes/iTunes Music
> > Library.xml.) These files are explicitly provided for data interchange —
> > they’re not the actual databases the apps use, just shadow copies in a
> > public data format.
> > Karelia’s open-source iMedia Browser framework has code for doing all
> this.
>
> I don't believe that was ever made explicit. I've always operated
> under the presumption that those XML files were for the sole use of
> the iLife apps and the media browser. Judging by the responses on
> MacOSX-Dev, I'm not alone.
>
>
http://support.apple.com/kb/HT1660

"This file contains some (but not all) of the same information stored in the
iTunes Library file. The purpose of the iTunes Music Library.xml file is to
make your music and playlists available to other applications on your
computer. In Mac OS X other iLife applications (like iPhoto, iDVD, and
iMovie) use this file to make it easier for you to add music from your
iTunes library to your projects."

Isaac
http://www.kerlmax.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: How to Access iPhoto,iTunes and iMove Playlist

2010-06-15 Thread Roni Music




On Tue, Jun 15, 2010 at 10:14 AM, Jens Alfke  wrote:
That's not true - you can access the apps' interchange files, which are 
just

regular property lists. (For example, ~/Music/iTunes/iTunes Music
Library.xml.) These files are explicitly provided for data interchange -
they're not the actual databases the apps use, just shadow copies in a
public data format.
Karelia's open-source iMedia Browser framework has code for doing all 
this.


I don't believe that was ever made explicit. I've always operated
under the presumption that those XML files were for the sole use of
the iLife apps and the media browser. Judging by the responses on
MacOSX-Dev, I'm not alone.

--Kyle Sluder


I can confirm that reading the ~/Music/iTunes/iTunes Music Library.xml
file works fine.

One of my apps does it since many years and it works great.

Rolf


___

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

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

Help/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: Where to noteHeightOfRowsWithIndexesChanged

2010-06-15 Thread Corbin Dunn

On Jun 15, 2010, at 10:55 AM, Jens Alfke wrote:

> 
> On Jun 15, 2010, at 10:51 AM, Jerry Krinock wrote:

> I send noteHeightOfRowsWithIndexesChanged: after updating the contents of the 
> array controller to which a table is bound, but I still see little artifacts 
> sometimes.  It's in a rarely-used utility view so I've let it slide. But 
> under the conditions you've mentioned,

If you can reproduce this, please log a bug.

> 
>>> There are usually about 200,000 rows, so calculating the actual height for 
>>> all rows is not an option (since it takes about 19 seconds).
>> 
>> you may have exceeded the capabilities of NSTableView's variable heights
> 
> I agree. Variable row heights were a late addition to NSTableView (added in 
> 10.3 or 10.4?) and I wouldn’t be surprised if they’re not optimized for huge 
> numbers of rows.

The table view is optimized for a huge number of rows -- the implementation in 
10.3-10.6 uses a sparse array of row heights, and attempts to lump together 
equal row heights into a single bucket. This makes it quite fast at 
computations. Having a lot of non-equal row heights will be more expensive 
(there is no way around that) as each rowRect computation needs to figure out 
where to be.

Even though it is fast, however, a table with 200,000 rows is excessive. There 
is no way a user can realistically use all those rows without some sort of 
filtering/searching. I would consider re-doing your UI to have a "more results" 
button, akin to the Finder spotlight search results.

With respect to:

> The tableview has variable height rows, and because of a relatively slow data 
> source, resizing and user control of fonts, etc, I don't know the row height 
> in advance. I'm caching the row height, and returning a single-line height if 
> the row is not visible (and the height is not yet known). If the row is 
> visible I calculate the actual height and return that (via the NSTableView 
> heightOfRow delegate).
> 
> This almost works, but I've not found a good place to put 
> noteHeightOfRowsWithIndexesChanged. I get either overlapping rows or some 
> blank rows during scroll. I've tried NSViewBoundsDidChangeNotification. I've 
> even tried putting it in the heightOfRow delegate (which I know must be 
> wrong), with some re-entrancy control which has given the best results so far 
> (but still displays blank rows sometimes). There are usually about 200,000 
> rows, so calculating the actual height for all rows is not an option (since 
> it takes about 1

You need to always return the *same* height until you call 
noteHeightOfRowsWithIndexesChanged. After calling that method, the said indexes 
can return a new height. Not doing this will cause the types of problems that 
you see, as the table may (or may not) cache every row height, and expects the 
same result to be returned for the same row every time (until it was told it 
changed). 

Sending the node in some sort of bounds changed notification should be fine -- 
the problem you are encountering is probably because you are breaking the above 
rule mentioned. Do the height calculations in the bounds change, and then call 
the "noteHeight.." method all in the same run loop stack; that will probably 
fix your problem.

corbin

___

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

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

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

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


Re: Where to noteHeightOfRowsWithIndexesChanged

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 10:51 AM, Jerry Krinock wrote:

>> There are usually about 200,000 rows, so calculating the actual height for 
>> all rows is not an option (since it takes about 19 seconds).
> 
> you may have exceeded the capabilities of NSTableView's variable heights

I agree. Variable row heights were a late addition to NSTableView (added in 
10.3 or 10.4?) and I wouldn’t be surprised if they’re not optimized for huge 
numbers of rows.

You might want to reconsider using fixed-height rows, or break your table into 
multiple pages.

—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: Where to noteHeightOfRowsWithIndexesChanged

2010-06-15 Thread Jerry Krinock

On 2010 Jun 15, at 04:26, Tony P wrote:

> I've not found a good place to put noteHeightOfRowsWithIndexesChanged. I get 
> either overlapping rows or some blank rows during scroll. ...  Any ideas 
> anyone?

I send noteHeightOfRowsWithIndexesChanged: after updating the contents of the 
array controller to which a table is bound, but I still see little artifacts 
sometimes.  It's in a rarely-used utility view so I've let it slide.  But under 
the conditions you've mentioned,

> There are usually about 200,000 rows, so calculating the actual height for 
> all rows is not an option (since it takes about 19 seconds).

you may have exceeded the capabilities of NSTableView's variable heights.  
Possibly NSTableView needs to know the height of all preceding rows in order to 
calculate the position of a given row?  You may need to compromise your 
requirements, or else consider making your own custom view which can "draw 
smarter".  But this may not be practical since NSTableView provides a *lot* of 
behavior you might still need, meaning you'd be discovering little issues and 
writing code for weeks.

___

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

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

Help/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 Access iPhoto,iTunes and iMove Playlist Information

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 10:28 AM, Kyle Sluder wrote:

> I don't believe that was ever made explicit. I've always operated
> under the presumption that those XML files were for the sole use of
> the iLife apps and the media browser.

Regardless, there are a jillion 3rd party apps that read those plists, 
especially the iTunes one. I don’t think there’s any practical downside to 
using them. The alternative of using AppleEvents is fairly slow if you’re 
trying to get information in bulk.

—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 Access iPhoto,iTunes and iMove Playlist Information

2010-06-15 Thread Kyle Sluder
On Tue, Jun 15, 2010 at 10:14 AM, Jens Alfke  wrote:
> That’s not true — you can access the apps’ interchange files, which are just
> regular property lists. (For example, ~/Music/iTunes/iTunes Music
> Library.xml.) These files are explicitly provided for data interchange —
> they’re not the actual databases the apps use, just shadow copies in a
> public data format.
> Karelia’s open-source iMedia Browser framework has code for doing all this.

I don't believe that was ever made explicit. I've always operated
under the presumption that those XML files were for the sole use of
the iLife apps and the media browser. Judging by the responses on
MacOSX-Dev, I'm not alone.

--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: How to Access iPhoto,iTunes and iMove Playlist Information

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 9:54 AM, Kyle Sluder wrote:

> As was covered over on MacOSX-Dev, the only supported way to do this
> is with Apple Events, using something like AppleScript or Scripting
> Bridge.

That’s not true — you can access the apps’ interchange files, which are just 
regular property lists. (For example, ~/Music/iTunes/iTunes Music Library.xml.) 
These files are explicitly provided for data interchange — they’re not the 
actual databases the apps use, just shadow copies in a public data format.

Karelia’s open-source iMedia Browser framework has code for doing all this.

—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 Access iPhoto,iTunes and iMove Playlist Information

2010-06-15 Thread Kyle Sluder
On Tue, Jun 15, 2010 at 2:35 AM, JanakiRam Palepu
 wrote:
> I would need to access iTunes , iPhoto and iMovie application's playlist
> information and show them in my Cocoa Application ( Mac OS version can be
> 10.6).
>
> Can any one suggest me the ways to implement this feature in my Cocoa app.

As was covered over on MacOSX-Dev, the only supported way to do this
is with Apple Events, using something like AppleScript or Scripting
Bridge.

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


How to Access iPhoto,iTunes and iMove Playlist Information

2010-06-15 Thread JanakiRam Palepu
Hi All,

I would need to access iTunes , iPhoto and iMovie application's playlist
information and show them in my Cocoa Application ( Mac OS version can be
10.6).

Can any one suggest me the ways to implement this feature in my Cocoa app.

Thanks,
Johny
___

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

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

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

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


Image pinching and double tapping issue

2010-06-15 Thread SanthoshKumarGundu

Hi,

I have an issue with the scrollview zooming.

In my application I have an image which is added to the scrollview.

I want to have zooming effect when user double taps  and also   
pinching .


The issue I am facing is
when double taps , the image is zooming (zoomed to maximum  
zoomscale) , but again on double tapping, the position of the image is  
changing. The image is not set to its original

position.

I am implementing required Scrollview delegate  methods and Touch events


Can any one suggest me how to implement  Zooming(on double tap ) and  
pinching for the same image.





Thanks, 
Santhosh
___

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

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

Help/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: Locating Frameworks

2010-06-15 Thread Jens Alfke

On Jun 15, 2010, at 9:19 AM, F van der Meeren wrote:

> I am trying to link to the Python.framework. 
> According to the manpages the framework directories are searched in the 
> following order:
> "The default framework search path is /Library/Frameworks then 
> /System/Library/Frameworks.”

If you’ve added Python.framework to your Xcode project, I think it will use 
that exact framework instead of following the search path. Look in your project 
and change that framework to the one you actually want to use.

You can use ‘otool’ to examine the library paths compiled into the binary.

—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: Locating Frameworks

2010-06-15 Thread F van der Meeren
That didn't do much for me.
It seems that the /Library/Frameworks path is overwritten at runtime by its the 
second in line /System/Library/Frameworks.


On 15 Jun 2010, at 18:06, jonat...@mugginsoft.com wrote:

> 
> 
> On 15 Jun 2010, at 14:58, F van der Meeren wrote:
> 
>> Hi,
>> 
>> I am trying to link to the Python.framework. 
>> According to the manpages the framework directories are searched in the 
>> following order:
>> "The default framework search path is /Library/Frameworks then 
>> /System/Library/Frameworks."
>> 
>> Running my code:
>> 
>> Py_Initialize();
>> PyRun_SimpleString("import sys\n"
>>   "print('Version: ', sys.version)\n");
>> Py_Finalize();
>> 
>> Shows the following:
>> ('Version: ', '2.6.1 (r261:67515, Feb 11 2010, 00:51:29) \n[GCC 4.2.1 (Apple 
>> Inc. build 5646)]')
>> 
>> But I have Python 3.1.2 installed in the /Library/Frameworks path, shouldn't 
>> this library be used and result in the following version info ?
>> '3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) \n[GCC 4.0.1 (Apple Inc. build 
>> 5493)]'
>> 
>> So my question is the following: How do I force the linking with the Python 
>> 3.1.2 version (or highest version installed)?
>> 
> Try calling Py_SetProgramName() before Py_Initialize()
> 
> NSString *launchPath =  
> @"/Library/Frameworks/Python.framework/versions/current/bin/python";
> Py_SetProgramName((char *)[launchPath UTF8String]);
> 
> Regards
> 
> Jonathan Mitchell
> 
> Developer
> Mugginsoft LLP
> http://www.mugginsoft.com
> 
>> Thanks,
>> 
>> Filip
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> 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
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/filip%40code2develop.com
> 
> This email sent to fi...@code2develop.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: Locating Frameworks

2010-06-15 Thread jonat...@mugginsoft.com


On 15 Jun 2010, at 14:58, F van der Meeren wrote:

> Hi,
> 
> I am trying to link to the Python.framework. 
> According to the manpages the framework directories are searched in the 
> following order:
> "The default framework search path is /Library/Frameworks then 
> /System/Library/Frameworks."
> 
> Running my code:
> 
> Py_Initialize();
> PyRun_SimpleString("import sys\n"
>"print('Version: ', sys.version)\n");
> Py_Finalize();
> 
> Shows the following:
> ('Version: ', '2.6.1 (r261:67515, Feb 11 2010, 00:51:29) \n[GCC 4.2.1 (Apple 
> Inc. build 5646)]')
> 
> But I have Python 3.1.2 installed in the /Library/Frameworks path, shouldn't 
> this library be used and result in the following version info ?
> '3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) \n[GCC 4.0.1 (Apple Inc. build 
> 5493)]'
> 
> So my question is the following: How do I force the linking with the Python 
> 3.1.2 version (or highest version installed)?
> 
Try calling Py_SetProgramName() before Py_Initialize()

NSString *launchPath =  
@"/Library/Frameworks/Python.framework/versions/current/bin/python";
Py_SetProgramName((char *)[launchPath UTF8String]);

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com

> Thanks,
> 
> Filip
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> 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

___

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

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

Help/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: Question about fading a UISlider

2010-06-15 Thread Luke Hiesterman
You can try setting shouldRasterize = YES on the layer. 

Luke

Sent from my iPhone.

On Jun 15, 2010, at 6:08 AM, "Eric E. Dolecki"  wrote:

> I am animating the alpha of a UISlider, and you can see that the UI is
> actual composed of two rounded rectangles with a round button above the
> union point. Is there a layer mode (like blendMode.LAYER in Flash's AS3)? So
> that you can't see the guts of the control as it's faded.
> 
> Thanks.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
> 
> This email sent to luket...@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


Locating Frameworks

2010-06-15 Thread F van der Meeren
Hi,

I am trying to link to the Python.framework. 
According to the manpages the framework directories are searched in the 
following order:
"The default framework search path is /Library/Frameworks then 
/System/Library/Frameworks."

Running my code:

Py_Initialize();
PyRun_SimpleString("import sys\n"
"print('Version: ', sys.version)\n");
Py_Finalize();

Shows the following:
('Version: ', '2.6.1 (r261:67515, Feb 11 2010, 00:51:29) \n[GCC 4.2.1 (Apple 
Inc. build 5646)]')

But I have Python 3.1.2 installed in the /Library/Frameworks path, shouldn't 
this library be used and result in the following version info ?
'3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) \n[GCC 4.0.1 (Apple Inc. build 
5493)]'

So my question is the following: How do I force the linking with the Python 
3.1.2 version (or highest version installed)?

Thanks,

Filip
___

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

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

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

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


Question about fading a UISlider

2010-06-15 Thread Eric E. Dolecki
I am animating the alpha of a UISlider, and you can see that the UI is
actual composed of two rounded rectangles with a round button above the
union point. Is there a layer mode (like blendMode.LAYER in Flash's AS3)? So
that you can't see the guts of the control as it's faded.

Thanks.
___

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

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

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

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


Re: Custom NSCell mouse events

2010-06-15 Thread Michael Hanna
Thanks for the suggestion Corbin. It looks like I'm doing everything
OK with creation and destruction though. Here is my code:

- (id)init {
if ((self = [super init])) {
_checkboxCell = [[NSButtonCell alloc] init];
[_checkboxCell setButtonType:NSSwitchButton];
[_checkboxCell setTitle:@""];
[_checkboxCell setTarget:self];
[_checkboxCell setImagePosition:NSImageLeft];
[_checkboxCell setControlSize:NSRegularControlSize];

}
return self;
}

- copyWithZone:(NSZone *)zone {
MyCheckboxCellToo *cell = (MyCheckboxCellToo *)[super copyWithZone:zone];
cell->_checkboxCell = [_checkboxCell copyWithZone:zone];
return cell;
}

- (void)dealloc {
[_checkboxCell release];
[super dealloc];
}


On Mon, Jun 14, 2010 at 11:42 AM, Corbin Dunn  wrote:
>
> On Jun 10, 2010, at 9:43 AM, Michael Hanna wrote:
>
>> OK I'm really stumped on this one. I want to make a checkbox with a
>> NSTextFieldCell combined together. It's important that the checkbox
>> goes ON if the mouse hits the box, NOT the text. I've accomplished
>> this, more or less, but the issue is receiving the mouse event because
>> I click one checkbox in a row, but ALL of them turn to NSOnState. I
>> will show what I've done and my various failed attempts in order to
>> get this to work.
>>
>> So this is how I've done it so far:
>>
>> header:
>> @interface MyCheckboxCellToo : NSTextFieldCell {
>>    NSButtonCell *_checkboxCell;
>> }
>
>>
>> implementation:
>
> 
>
> You're missing an implementation of copyWithZone that copies the 
> _checkboxCell ivar.
>
> Hence, all use the same instance and show the same stuff. You'll also 
> eventually get a crash because the default implementation of copyWithZone is 
> just a bitwise copy of the class.
>
> corbin
>
>
___

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

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

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

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


Where to noteHeightOfRowsWithIndexesChanged

2010-06-15 Thread Tony P
Where's the best place to put noteHeightOfRowsWithIndexesChanged to  
keep a tableview display correct whilst scrolling?


The tableview has variable height rows, and because of a relatively  
slow data source, resizing and user control of fonts, etc, I don't  
know the row height in advance. I'm caching the row height, and  
returning a single-line height if the row is not visible (and the  
height is not yet known). If the row is visible I calculate the actual  
height and return that (via the NSTableView heightOfRow delegate).


This almost works, but I've not found a good place to put  
noteHeightOfRowsWithIndexesChanged. I get either overlapping rows or  
some blank rows during scroll. I've tried  
NSViewBoundsDidChangeNotification. I've even tried putting it in the  
heightOfRow delegate (which I know must be wrong), with some re- 
entrancy control which has given the best results so far (but still  
displays blank rows sometimes). There are usually about 200,000 rows,  
so calculating the actual height for all rows is not an option (since  
it takes about 19 seconds).


Any ideas anyone?

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