Re: [SOLVED] Unresponsive CFMessagePort

2011-01-07 Thread Jean-Daniel Dupas

Le 7 janv. 2011 à 06:37, Jerry Krinock a écrit :

 
 On 2011 Jan 06, at 17:33, Dave Keck wrote:
 
 Oh, `sudo launchctl bstree` might also be useful.
 
 Thank you, Dave.  It was useful.  It told me that my server port was active 
 (A).  This confirms what the Client tells me, that the port is found, but 
 times out when connecting to it.  Odd, though, that, if I sent messages 
 repeatedly, the Client would get a couple seconds of 
 kCFMessagePortReceiveTimeout errors and then after that, 
 kCFMessagePortSendTimeout errors.
 
 Thus knowing what to look for, I found the problem, which is that I was using 
 the same port name for two different transient tasks, but the port for the 
 second task was being created before the port for the first task was 
 invalidated and released.  This was because I was invalidating and releasing 
 the port in the server's -dealloc method, which was running lazily when an 
 autorelease pool was released.
 
 Just for the record, the trick is that if you try to create a port while an 
 older port with the same name is  invalidated but not yet deallocated, an 
 exception is raised and logged in the console.  However if the older port is 
 still active, and then later invalidated and deallocated, you get this silent 
 failure, a nonresponsive port.

It is an implementation detail, but it appears that when you try to create a 
CFMachPort instance with a specified port name, the create function will 
check if an existing CFMachPort instance already exists for the specified 
mach_port, and return it if it exists.
That's why you should let the system choose the port name, and not try to force 
it.


-- Jean-Daniel




___

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

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

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

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


Re: [SOLVED] Unresponsive CFMessagePort

2011-01-07 Thread Jean-Daniel Dupas

Le 7 janv. 2011 à 10:22, Jean-Daniel Dupas a écrit :

 
 Le 7 janv. 2011 à 06:37, Jerry Krinock a écrit :
 
 
 On 2011 Jan 06, at 17:33, Dave Keck wrote:
 
 Oh, `sudo launchctl bstree` might also be useful.
 
 Thank you, Dave.  It was useful.  It told me that my server port was 
 active (A).  This confirms what the Client tells me, that the port is 
 found, but times out when connecting to it.  Odd, though, that, if I sent 
 messages repeatedly, the Client would get a couple seconds of 
 kCFMessagePortReceiveTimeout errors and then after that, 
 kCFMessagePortSendTimeout errors.
 
 Thus knowing what to look for, I found the problem, which is that I was 
 using the same port name for two different transient tasks, but the port for 
 the second task was being created before the port for the first task was 
 invalidated and released.  This was because I was invalidating and releasing 
 the port in the server's -dealloc method, which was running lazily when an 
 autorelease pool was released.
 
 Just for the record, the trick is that if you try to create a port while an 
 older port with the same name is  invalidated but not yet deallocated, an 
 exception is raised and logged in the console.  However if the older port is 
 still active, and then later invalidated and deallocated, you get this 
 silent failure, a nonresponsive port.
 
 It is an implementation detail, but it appears that when you try to create a 
 CFMachPort instance with a specified port name, the create function will 
 check if an existing CFMachPort instance already exists for the specified 
 mach_port, and return it if it exists.

Correction. This is not an implementation detail, it is part of the API. (See 
CFMachPortCreateWithPort() discussion in the CFMachPort API reference).

 That's why you should let the system choose the port name, and not try to 
 force it.
 

-- Jean-Daniel




___

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

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

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

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


Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-07 Thread Alastair Houghton
On 6 Jan 2011, at 20:54, Abhinav Tyagi wrote:

 1) I need an efficient approach to solve this problem using Cocoa or C++.
 (very Important)
 2) How will check a file if its a valid media file or data file. Like we can
 have .dat files that are video files but data files can also have .dat 
 extension. not much
 significant. Is there api that can tell whether a file is media file or not? 
 (not s
 important).

Why not use NSMetadataQuery to get Spotlight to search for you?  If you search 
for Technical Note TN2192 in the documentation, you'll find some sample code.  
The Spotlight Overview and Spotlight Query Programming Guide look useful too.

Kind regards,

Alastair.

--
http://alastairs-place.net




___

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

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

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

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


Change the NSPreferencePane window size programmatically

2011-01-07 Thread eveningnick eveningnick
Hello
is it possible to set up the System Preferences height programmatically?
I have 3 possible NSViews of different height (but the same width),
which are displayed depending on what current settings does the user
have.

I am aware that System Preferences automatically changes the size of
its window when it activates (loads) a Preference Pane, depending on
that Pane's window height which is loaded from nib.

But is there a way to change that height after the panel has been activated?

I was thinking that my pane is operating in the address space of
System Preferences, which means i can send messages to objects of this
application. Can i somehow retrieve the object of main window and send
it something like -setFrame ?

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: Change the NSPreferencePane window size programmatically

2011-01-07 Thread Kyle Sluder
On Fri, Jan 7, 2011 at 6:09 AM, eveningnick eveningnick
eveningn...@gmail.com wrote:
 I was thinking that my pane is operating in the address space of
 System Preferences, which means i can send messages to objects of this
 application. Can i somehow retrieve the object of main window and send
 it something like -setFrame ?

Don't ever do that. There's no guarantee of this. Your preference pane
can be loaded by any application, and there's nothing keeping a future
version of System Preferences from loading your pane in a sandbox.

Objects outside your own preference pane are not yours to touch.

--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: Stupid png icons

2011-01-07 Thread Dave Camp
On Jan 6, 2011, at 5:38 PM, BareFeetWare wrote:

 On 07/01/2011, at 3:04 AM, Matt Neuburg wrote:
 
 GraphicConverter doesn't really have the cojones to do what you need done. 
 You want something that can use e.g. the greyness of each pixel in the 
 original image to determine the greyness of each pixel in the alpha mask. 
 Photoshop or GIMP will do this fairly handily. m.
 
 Thanks for the info.
 
 Is there no dedicated app suitable for producing PNG images with grey level 
 transparency/alpha, at the various scales needed for iOS apps (as app icons 
 in-app icons)? Does everyone just resort to GIMP and Photoshop, which seems 
 overkill and I'm guessing without templates for icon production?

You should try Opacity.

http://likethought.com/opacity/


___

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

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

Help/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: NSDictionary key types

2011-01-07 Thread Kirk Kerekes
If you are insufficiently confused, I thought I would add some additional 
confusion.

1. Don't worry overmuch about hash values. Particularly, never succumb to the 
temptation to store them persistently. 

The -hash algorithm for a particular class may vary with OS version. It 
certainly has before.

It certainly varies from class to class. 

2. Do not expect items like NSString and NSNumber to return the same hash 
values for humanly-similar entities like [NSNumber numberWithNSInteger: 12345] 
and [NSString stringWithString: @12345]. 

3. Do not expect collection hashes to take into account the entire contents of 
the collection. -isEqual does, however.

4. It is entirely feasible to use a non-string object as a dictionary key, so 
long as it obeys the general requirements for dictionary keys. You can use a 
NSNumber as a dictionary key, a NSDate as a dictionary key, a NSDictionary as a 
dictionary key, any immutable object that implements -hash and -copy, pretty 
much. Including your own. 

A problem with using collections as dictionary keys is that even though the 
collection may be immutable, there is no guarantee that the objects in the 
collection are.

5. Good practice would be to try to stick to using NSStrings as dictionary 
keys. This moves further towards compliance with property lists, and it is very 
nice to be able to read/write an arbitrary dictionary as a property list. Also 
makes debugging easier.


6. That dictionary keys are immutable leads to some nice efficiencies -- if you 
define a key as a NSString literal:

#define MYKEY @My Key;
(or)
NSString * myKey = @My Key;

-- then every time you use MYKEY or myKey in a dictionary (or anywhere), the 
dictionary key will be that specific global instance of that NSString  -- a 
singleton. You can create 1000 NSDictionaries containing a key My Key, but 
there will be only exactly one in-memory instance of that key. This means that 
-isEqual on that key will always short-circuit to an address comparison, which 
is about as efficient as you can get. 

Speed and space optimization at a single stroke. Immutability is a lovely 
attribute.

Of course, once you start saving and reloading NSDictionaries, you likely start 
losing this niftyness, unless Apple has implemented undocumented optimizations 
like coalescing new instances of NSStrings into a global string cache. They 
might have done that, Apple likes that sort of thing, and it wouldn't be hard 
to implement. It would be even more compelling on iOS, where storage, RAM and 
computing power are comparatively scarce.

___

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

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

Help/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: NSDictionary key types

2011-01-07 Thread Jon Sigman
The underlying issue I was having was how to know when different objects used 
as 
keys might be reasonably expected to match, especially if they weren't 
generated 
the same way (as with [NSNumber stringValue] and [NSString ...]).

I guess the long answer is its complicated, and the short answer is just use 
NSStrings.

Thanks to all, I think I'm getting the hang of it.





Kirk Kerekes wrote:

If you are insufficiently confused, I thought I would add some additional 
confusion.

1. Don't worry overmuch about hash values. Particularly, never succumb to the 
temptation to store them persistently. 


The -hash algorithm for a particular class may vary with OS version. It 
certainly has before.

It certainly varies from class to class. 

2. Do not expect items like NSString and NSNumber to return the same hash 
values 
for humanly-similar entities like [NSNumber numberWithNSInteger: 12345] and 
[NSString stringWithString: @12345]. 


3. Do not expect collection hashes to take into account the entire contents of 
the collection. -isEqual does, however.

4. It is entirely feasible to use a non-string object as a dictionary key, so 
long as it obeys the general requirements for dictionary keys. You can use a 
NSNumber as a dictionary key, a NSDate as a dictionary key, a NSDictionary as a 
dictionary key, any immutable object that implements -hash and -copy, pretty 
much. Including your own. 


A problem with using collections as dictionary keys is that even though the 
collection may be immutable, there is no guarantee that the objects in the 
collection are.

5. Good practice would be to try to stick to using NSStrings as dictionary 
keys. 
This moves further towards compliance with property lists, and it is very nice 
to be able to read/write an arbitrary dictionary as a property list. Also makes 
debugging easier.


6. That dictionary keys are immutable leads to some nice efficiencies -- if you 
define a key as a NSString literal:

#define MYKEY @My Key;
(or)
NSString * myKey = @My Key;

-- then every time you use MYKEY or myKey in a dictionary (or anywhere), the 
dictionary key will be that specific global instance of that NSString  -- a 
singleton. You can create 1000 NSDictionaries containing a key My Key, but 
there will be only exactly one in-memory instance of that key. This means that 
-isEqual on that key will always short-circuit to an address comparison, which 
is about as efficient as you can get. 


Speed and space optimization at a single stroke. Immutability is a lovely 
attribute.

Of course, once you start saving and reloading NSDictionaries, you likely start 
losing this niftyness, unless Apple has implemented undocumented optimizations 
like coalescing new instances of NSStrings into a global string cache. They 
might have done that, Apple likes that sort of thing, and it wouldn't be hard 
to 
implement. It would be even more compelling on iOS, where storage, RAM and 
computing power are comparatively scarce.


  
___

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

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

Help/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 MEDIA FILES IN MACINTOSH

2011-01-07 Thread Kirk Kerekes
I may have missed it, but I don't believe anyone has mentioned my first choice 
in this sort of task:

 -- the programmatic interface to Spotlight:

http://goo.gl/JGgVQ Introduction to Spotlight Query Programming 
Guide

combined with UTIs:

http://goo.gl/9AxdT Introduction to Uniform Type Identifiers 
Overview

Because SpotLight uses a prebuilt index, it will trounce pretty much any other 
search technique. 

UTIs let you specify _classes_ of filetypes (like movie or audio) rather 
than bogging down in endless detail that needs perpetual updating.

No search scheme can guarantee 100% perfection, but using system resources 
instead of rolling your own lets you effortlessly benefit from Apple's 
continued stepwise refinement. 


___

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

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

Help/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: Change the NSPreferencePane window size programmatically

2011-01-07 Thread eveningnick eveningnick
Kyle,
thanks for the warning, i understand the problems it may cause.
but what if i was doing that, how should have i sent a message to an
object of the host application?
___

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

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

Help/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: Change the NSPreferencePane window size programmatically

2011-01-07 Thread Kyle Sluder
On Fri, Jan 7, 2011 at 10:42 AM, eveningnick eveningnick
eveningn...@gmail.com wrote:
 Kyle,
 thanks for the warning, i understand the problems it may cause.
 but what if i was doing that, how should have i sent a message to an
 object of the host application?

Quite simple: you don't. Ever. If your host object doesn't explicitly
give you an object you're allowed to message, you don't message any of
its objects.

--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: Stupid png icons

2011-01-07 Thread WT
On Jan 6, 2011, at 11:38 PM, BareFeetWare wrote:

 Is there no dedicated app suitable for producing PNG images with grey level 
 transparency/alpha, at the various scales needed for iOS apps (as app icons 
 in-app icons)? Does everyone just resort to GIMP and Photoshop, which seems 
 overkill and I'm guessing without templates for icon production?
 
 Thanks,
 Tom
 
 --
 Comparison of SQLite GUI tools:
 http://www.barefeetware.com/sqlite/compare/?ml


These apps (found in the just-opened Mac App Store) aren't exactly what you're 
looking for, but they do some of the work involved.

Reduction
http://itunes.apple.com/us/app/reducticon/id412831576

Iconizer
http://itunes.apple.com/us/app/iconizer/id412346451

StoreSizer
http://itunes.apple.com/us/app/storesizer/id408263303

AppControls
http://itunes.apple.com/us/app/appcontrols/id402508203

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


Re: NSDictionary key types

2011-01-07 Thread Lee Ann Rucker

On Jan 7, 2011, at 10:36 AM, Jon Sigman wrote:

 The underlying issue I was having was how to know when different objects used 
 as 
 keys might be reasonably expected to match, especially if they weren't 
 generated 
 the same way (as with [NSNumber stringValue] and [NSString ...]).
 
 I guess the long answer is its complicated, and the short answer is just 
 use 
 NSStrings.
 
 Thanks to all, I think I'm getting the hang of it.

The long and short answers are both they won't. The non-trivial isEqual 
methods check the object's class; an NSString can be equal to an 
NSMutableString if their contents match, but never an NSNumber. Hash is a 
secondary check.___

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

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

Help/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: NSDictionary key types

2011-01-07 Thread Greg Guerin

Jon Sigman wrote:

The underlying issue I was having was how to know when different  
objects used as
keys might be reasonably expected to match, especially if they  
weren't generated

the same way (as with [NSNumber stringValue] and [NSString ...]).



That's easy: they match when isEqual: returns true.

See the NSDictionary class reference:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ 
Foundation/Classes/NSDictionary_Class/Reference/Reference.html


Find isEqual on the page:
  ... no two keys in a single dictionary are equal (as determined  
by isEqual:).


This subtly suggests that key equality is synonymous with isEqual:.

There is also a logical relationship between hash and isEqual, which  
must be maintained.  Objects that are equal must also have equal  
hashes.  Or: equality presupposes hash-identicality.


  -- GG





___

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

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

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

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


Re: NSDocument updateChangeCount when using Bindings

2011-01-07 Thread Kevin Bracey
Thank you!
As always I had paddled my way out into deep water and missed something 
important.

Key-Valued Coding Programming Guide: Ensuring KVC Compliance
Ensuring KVC Compliance, Indexed To-Many Relationship Compliance.

Cheers
Kevin

On 7/01/2011, at 7:39 PM, Quincey Morris wrote:

 On Jan 6, 2011, at 18:01, Kevin Bracey wrote:
 
 MyDocument has a 
 iVar = NSMutableArray *allScenes; 
 @property( retain ) NSMutableArray *allScenes;
 @synthesize allScenes;
 
 In my nib I have a ArrayController bound to allScenes and it is hooked up to 
 a Table and and selected Fields, it is adding and editing my Scene Objects 
 great.
 
 I have these Saving and Loading from a Package using NSKeyArchiver, working 
 great.
 
 How do I get the [MyDocument updateChangeCount:NSChangeDone]; to be called 
 when I add or delete a allScenes object or edit one of there properties?
 
 You're kinda Doing It Wrong™ and your problem with updating the change count 
 is something of a side effect.
 
 It's almost certainly wrong to expose a *mutable* array ivar as a public 
 *mutable* array property, especially when the the property is synthesized. By 
 doing this, you've allowed clients of your class to modify the property 
 non-KVO-compliantly. (For example, '[document.allScenes addObject:...]' is 
 allowed by your interface but is not compliant.) Currently it works great, 
 I'm guessing, because currently the *only* way the array gets changed is via 
 the array controller, and the array controller brute-force-ensures KVO 
 compliance on its own accesses. (For example, it adds to the array with 
 something like '[[document mutableArrayValueForKey: @allScenes] 
 addObject:...]', which is compliant.) If you later add other ways of changing 
 the array, you're leaving yourself open to a compliance problem, and it's 
 likely to be an extremely hard bug to track down.
 
 The easiest way to fix this is:
 
 1. Declare the property as '@property (retain) NSArray *allScenes;'.
 
 Counter-intuitively, this won't break your array-controller-initiated 
 updates, since the array controller doesn't know the property type anyway. If 
 you read the comments for 'mutableArrayValueForKey:' in NSKeyValueCoding.h 
 carefully, you'll see that without further intervention KVC will go ahead and 
 update the mutable array anyway (case #3). But that's not what you really 
 want, so also ...
 
 2. Define mutable array accessors in your document subclass. Something like:
 
   - (void) insertObject: (id) object inAllScenesAtIndex: (NSUInteger) 
 index {
   [allScenes insertObject: object atIndex: index];
   }
 
 and a similar one for removing objects. (Such methods are inherently KVO 
 compliant.) As a result, every object insertion and removal will be done via 
 your custom accessors, and -- magically -- you will now have convenient 
 places to update the document change count.
 
 3. If code needs to update the array property other than via KVC, you can 
 expose your custom accessors as public methods. As I said, they're inherently 
 KVO compliant, so this solves the original problem in your implementation. 
 Or, clients of the class can use 'mutableArrayValueForKey:' directly. Either 
 way, they'll be forced to do it right, and prevented from doing it wrong.
 
 

___

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

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

Help/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: Thumbs Lists

2011-01-07 Thread Fernando Aureliano
Thanks for the tips guys!

so...

I have a JSON file. I read it and put in array.

I want to get some images and do a thumb list, like the covers in iBook.

I see the documentation and I dont found nothing for help me there

I think for to do this, I should use an UIScrollView, and inside an
UIImageViews, but i dont know which class I should use to construct this
covers on UIScrollView.

This is not a cover flow, is just a lista of thumbs for iPad

Something like that http://dl.dropbox.com/u/7099330/covers.png

--
Thanks for the help!

On Fri, Jan 7, 2011 at 2:45 AM, BareFeetWare 
list.develo...@barefeetware.com wrote:

 On 07/01/2011, at 1:58 PM, Fernando Aureliano wrote:

  I'm doing my first app. Is a magazine, and I would like to show a list of
 covers.
 
  Someone can give-me a tip of how I can do this with a UIImageView or
 something like that?

 It's hard to answer without know what you've got, but you should be doing
 something like:

 1. In Xcode, create a new project using the Navigation based template for
 iPhone, or the Split View based template for iPad.

 2. Select the RootViewController.m implementation file.

 3. Change the tableView:numberOfRowsInSection: method to return the number
 of rows you want (the number of magazines).

 4. At the end of the tableView:cellForRowAtIndexPath: method, just before
 the return line, insert something like:

// Configure the cell.
cell.imageView.image = [UIImage imageWithContentsOfFile:@
 path/to/image.png];
cell.textLabel.text = @Magazine name;
return cell;
 }

 5. Run it.

 That will give you a list containing thumbnail images.

 Tom
 BareFeetWare

 ___

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

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

 Help/Unsubscribe/Update your Subscription:

 http://lists.apple.com/mailman/options/cocoa-dev/mail%40fernandoaureliano.com

 This email sent to m...@fernandoaureliano.com




-- 
*Fernando*
___

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

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

Help/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: Thumbs Lists

2011-01-07 Thread David LeBer

On 2011-01-07, at 4:21 PM, Fernando Aureliano wrote:

 Thanks for the tips guys!
 
 so...
 
 I have a JSON file. I read it and put in array.
 
 I want to get some images and do a thumb list, like the covers in iBook.
 
 I see the documentation and I dont found nothing for help me there
 
 I think for to do this, I should use an UIScrollView, and inside an
 UIImageViews, but i dont know which class I should use to construct this
 covers on UIScrollView.
 
 This is not a cover flow, is just a lista of thumbs for iPad
 
 Something like that http://dl.dropbox.com/u/7099330/covers.png

AQGridView?

http://rbld.me/e

 
 --
 Thanks for the help!
 
 On Fri, Jan 7, 2011 at 2:45 AM, BareFeetWare 
 list.develo...@barefeetware.com wrote:
 
 On 07/01/2011, at 1:58 PM, Fernando Aureliano wrote:
 
 I'm doing my first app. Is a magazine, and I would like to show a list of
 covers.
 
 Someone can give-me a tip of how I can do this with a UIImageView or
 something like that?
 
 It's hard to answer without know what you've got, but you should be doing
 something like:
 
 1. In Xcode, create a new project using the Navigation based template for
 iPhone, or the Split View based template for iPad.
 
 2. Select the RootViewController.m implementation file.
 
 3. Change the tableView:numberOfRowsInSection: method to return the number
 of rows you want (the number of magazines).
 
 4. At the end of the tableView:cellForRowAtIndexPath: method, just before
 the return line, insert something like:
 
   // Configure the cell.
   cell.imageView.image = [UIImage imageWithContentsOfFile:@
 path/to/image.png];
   cell.textLabel.text = @Magazine name;
   return cell;
 }
 
 5. Run it.
 
 That will give you a list containing thumbnail images.
 
 Tom
 BareFeetWare
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 
 http://lists.apple.com/mailman/options/cocoa-dev/mail%40fernandoaureliano.com
 
 This email sent to m...@fernandoaureliano.com
 
 
 
 
 -- 
 *Fernando*
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/dleber_dev%40codeferous.com
 
 This email sent to dleber_...@codeferous.com

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




___

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

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

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

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


Re: Change the NSPreferencePane window size programmatically

2011-01-07 Thread Peter Lübke

Whatever you do to an app that isn't yours:
use the APIs supplied for Interapplication Communication, as there  
are (among others):

AppleEvents, AppleScript, Accessibility...

These ensure sufficient isolation between the objects involved, and  
they are (to a certain extend) likely to survive the next OS version.
These APIs DO give you objects you're allowed to message, and they  
implement messages you're allowed to send to these objects.


Look at this simple AppleScript:

tell application System Preferences
set bounds of window 1 to {342, 125, 937, 585}
end tell

It's very easy to send this via NSAppleScript. So what makes you look  
for dirty hacks?


Peter

Am 07.01.2011 um 19:51 schrieb Kyle Sluder:


On Fri, Jan 7, 2011 at 10:42 AM, eveningnick eveningnick
eveningn...@gmail.com wrote:

Kyle,
thanks for the warning, i understand the problems it may cause.
but what if i was doing that, how should have i sent a message to an
object of the host application?


Quite simple: you don't. Ever. If your host object doesn't explicitly
give you an object you're allowed to message, you don't message any of
its objects.

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


Custom path animation for CAShapeLayer

2011-01-07 Thread Kenneth Baxter


Hi, I'm trying to use a CAShapeLayer for some paths in my application. For the 
most part this works fine, but in some circumstances the animation from one 
path to another looks really strange during the animation.

I would be able to tell it what the path should be at any intermediate point in 
the animation, but I'm not sure how to get access to it to provide those paths.

Is it possible to provide my own paths for the animation, or get some callback 
when it wants a new path or the animation advances?

If not, what's my best approach for animating the layer? I have played around 
with the idea of creating a dummy key which I add an animation for and animate 
it between 0 and 1, and set setNeedsDisplayForKey: to return YES for that key, 
and then use the value to determine how far through the animation I am and draw 
the appropriate path, but this seems a really counter-intuitive (hackish) way 
of doing it, but it seems to work and I haven't yet found a better way...

(target is Mac OS X 10.6)

Thanks.

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: How to get colored font smoothing in a CALayer

2011-01-07 Thread James Bucanek
David Duncan mailto:david.dun...@apple.com wrote (Thursday, 
January 6, 2011 3:58 PM -0800):



You might be able to get something more acceptable by turning on shadowing in
the context before you draw the text. This appears to be what the Finder does
(if you look closely at the labels on the desktop they don't use sub-pixel
antialiasing either, but have a subtle shadow effect).


David,

I tried drawing with a shadow, and while it produces an 
interesting effect in my UI, it doesn't improve the smoothing of 
the text.


As an experiment I filled the context with white before drawing 
any text and that does the trick. The text looks identical to 
what appears in the Finder and elsewhere.


So at least now I know. Thanks for the great information.

--
James Bucanek

___

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

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

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

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


[Moderator] Re: [Job Posting] Software Engineer in Columbia, MD, USA

2011-01-07 Thread Scott Anguish
Reminder

Please run job offers past the admin list first. I know that isn’t well known. 
It needs to be made clearer.

Thanks

Scott

On Jan 5, 2011, at 12:42 PM, Lyndsey Ferguson wrote:

 https://www.appone.com/MainInfoReq.asp?R_ID=320408
 
 There are Software Engineer positions open with Nemetschek Vectorworks, Inc.
 in Columbia, MD, USA.
 
 See the above link for more information and how to apply. Objective-C
 knowledge is also an asset.
 
 Mr. Lyndsey Ferguson (I am not the hiring manager)
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com
 
 This email sent to sc...@cocoadoc.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


button states usually always disabled

2011-01-07 Thread Shane
I've had some icons custom made for my application and they look
really good. However, when my application opens up, they are disabled.
The reason for this is that they don't change to enabled until the
application verifies a configuration and it's in a state ready to run.
it's a scientific application and by run I mean it runs simulations.
So there's several buttons similar to running and stopping states that
are disabled for the most of the time the app is open while the user
is configuring and analyzing.

My concern is that, I've got these great looking colorful icons that
can't really be seen or don't make the app look as good as it could if
the buttons were enabled. I'm thinking of putting little light like
indicators below the buttons that show when the simulation is ready to
run and always keeping the buttons enabled.

Anyone had similar experiences/ideas?
___

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

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

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

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