Re: NSFileManager thread safety?

2009-11-15 Thread Dave Keck
Why do you think this is a thread safety issue? The
-applicationShouldTerminate: delegate method is called on the main
thread.

It looks more like your path (as retrieved from -tempDirPath) is not a
valid object.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


NSFileManager thread safety?

2009-11-15 Thread David Cake

The following code snippet works fine from my main thread.
 NSFileManager *tempFileManager = [[NSFileManager alloc] init];
 NSString *path= [self tempDirPath];
 if(![tempFileManager  removeItemAtPath: path  error: nil]) {
 NSLog(@"failed to remove temp files");
 }
[tempFileManager release];

But from within
-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication 
*)sender
or other delegate methods, it gets my EXC_BAD_ACCESS on the 
removeItemAtPath call
- any suggestions? I thought NSFileManager was supposed to be 
thread-safe in 10.5 and 10.6?


If this is a thread safety issue (and given the code works in the 
main thread, I'm not sure what other issues might be the problem), 
what is the solution to force calling it from the main thread?


Thanks In Advance

David
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Example of categorized lists in a Mail-type interface

2009-11-15 Thread Ian Piper
On 16 Nov 2009, at 01:09, Rob Keniger wrote:

> 
> On 16/11/2009, at 4:38 AM, Ian Piper wrote:
> 
>> I would appreciate it if someone could point me at an example that I could 
>> use as the basis for building a categorized list similar to the mail folders 
>> display in Mail.
> 
> This should help:
> 
> http://developer.apple.com/mac/library/samplecode/SourceView
> 
> --
> Rob Keniger

It does... thanks Rob.


Ian.
--
___

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

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

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

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


Re: SFAuthorization

2009-11-15 Thread Kyle Sluder
On Sun, Nov 15, 2009 at 10:39 AM, nyx...@gmail.com  wrote:
> If i understood correctly, the function AuthorizationExecuteWithPrivileges() 
> executes the given command in a new process.
>
> Is there a way to wait for the created process to terminate ?

No, using AEWP correctly will always create a zombie:
http://lists.apple.com/archives/cocoa-dev/2008/Oct/msg00195.html

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

2009-11-15 Thread Dave Keck
If you're sure that no other forked process will exit before the
process spawned by AEWP (generally, a reasonable assumption), you can
simply wait(). Of course, this will block the run loop, preventing any
user interaction from being handled.

See 'man 2 wait'.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 are the interface builder components?

2009-11-15 Thread Kyle Sluder
On Sun, Nov 15, 2009 at 12:04 AM, Pascal Bourguignon
 wrote:
> Otherwise, if the question is why there's no market for reusable object
> component, (which was promised by early OO proponents), perhaps it is
> because the OO model is flawed?  Or, I would rather thing that the
> _granularity_ of the OO model is the problem: reusing components at the
> level of an object is too inconvenient; reusing components at the tool level
> (like in unix) seems to be much more successful.

Without getting into an OO flamewar, we're talking about Apple
distributing new widgets as part of an IB plugin, not just as
individual objects.  Look at the text system for an example of an OO
system which can't be reused in its individual pieces, but is very
powerful when taken as a unit whose individual components can be
enhanced.

--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: Where are the interface builder components?

2009-11-15 Thread Graham Cox

On 15/11/2009, at 7:04 PM, Pascal Bourguignon wrote:

> Otherwise, if the question is why there's no market for reusable object 
> component, (which was promised by early OO proponents), perhaps it is because 
> the OO model is flawed?  Or, I would rather thing that the _granularity_ of 
> the OO model is the problem: reusing components at the level of an object is 
> too inconvenient;


The hundreds if not thousands of reusable classes, collections and frameworks 
out there says otherwise.

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


SFAuthorization

2009-11-15 Thread Nyx0uf
Hi,

If i understood correctly, the function AuthorizationExecuteWithPrivileges() 
executes the given command in a new process.

Is there a way to wait for the created process to terminate ?

Thanks for helping me.


Nyxem.___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 are the interface builder components?

2009-11-15 Thread Pascal Bourguignon

From: "Sandro Noël" 

But where are the ones from apple... that's what i'm wondering,
Why do we have to duplicate work that evidently has already been done.
I'm confused as why apple is not including it in it's development tools.
it makes no sense to me...


If Apple published the sources of its widgets, Microsoft would have it much 
easier to copy it...


Otherwise, if the question is why there's no market for reusable object 
component, (which was promised by early OO proponents), perhaps it is 
because the OO model is flawed?  Or, I would rather thing that the 
_granularity_ of the OO model is the problem: reusing components at the 
level of an object is too inconvenient; reusing components at the tool level 
(like in unix) seems to be much more successful.


--
__Pascal Bourguignon__

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Advice On Subclass vs. Delegate

2009-11-15 Thread s.ross
Let me try character-art to illustrate the issue (forgive the top-post):

+---+
Title:  |   |<= splits on spaces only, counts dups
+---+

Label: word count   Label:dup count

+---+
Keywords:   |   |<= splits on comma with optional 
+---+   whitespace, counts dups

Label: word count   Label:dup count

NSTextField
|
  DuplicateCounterTextField
  
So, in IB, I set the class of the two fields to DuplicateCounterTextField
and the delegate to WindowController. DuplicateCounterTextField implements:

- textDidChange:notification;
- textView:view completions:completions 
forPartialWordRange:range
indexOfSelectedItem:index

In the delegate class's awakeFromNib, I set the splitter string, which works
fine.

So, WindowController understands that there is an outlet called title and one
called keywords, and that they are connected to the corresponding controls on
the form. However, DuplicateCounterTextField is deliberately stupid. The
question is, should an instance of DuplicateCounterTextField call a (to be
implemented) delegate method wordCountDidChange:notification to allow the
two labels to be updated by WindowController, thus tying the whole thing
together or is there a better way.

Clearly, this is a trivial example, but I'm trying to understand desirable
patterns that can last as an application grows.

Thanks,

Steve


On Nov 14, 2009, at 5:41 AM, Jerry Krinock wrote:

> 
> On 2009 Nov 12, at 18:54, s.ross wrote:
> 
>> That suggests to me that subclassing NSTextField and allowing a single 
>> controller to register a callback would be the right way to go, but I'm 
>> struggling with how to specify *which* text field
> 
> I don't understand the question.  You subclass class definitions, not 
> instances.  The thing you would subclass would be NSTextField.  Your subclass 
> will be a "sister" of, for example, NSSecureTextField.
> 
>> and whether my design idea is even sound.
> 
> other than that, it looks like you know what you are doing.
> 
> ___
> 

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Transparent layer-backed views

2009-11-15 Thread Zbigniew Sobiecki


Hello,

I'm trying to perform some simple animations using CA layers on  
transparent window and corresponding view. The problem I have is that  
every time I turn on the layer backing (either through wantsLayer in  
code, or with IB) the view stops being transparent.


I've tried setting layer's backgroundColor to something with low alpha  
and few other rather obvious approaches, but it looks to me that I'm  
missing something.


To illustrate the problem better, let's just use sample Round  
Transparent Window project from Apple (http://developer.apple.com/Mac/library/samplecode/RoundTransparentWindow/index.html 
).


By default it looks like this:

http://slonce.com/no-layer.png

But with layer added (just this single line in awakeFromNib), the  
transparency goes away:


http://slonce.com/with-layer.png

Could anyone please give me some hints on this?


Thanks,

-Z
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 IB, filterPredicate, and bindings

2009-11-15 Thread Daniel Wambold
Hello, list. I am a hack programmer, so forgive what is probably an  
obvious question. I'm working on a core data document based app that  
uses bindings I've created in IB to control a master / detail  
interface. Briefly, in XCode's xcdatamodel, there is a Person entity  
with a name (String) and employee (Bool). I have another entity,  
Transaction, which has an amount (Decimal) and an operator (Person  
Relationship). So far, so good. Everything is nicely working with  
bindings. However, I only want the operator pop-up to display Person  
entities for which employee == 1 (the predicate that I can build in  
the xcdatamodel fetch request).


I would have thought that, in IB, I should be able to choose the pop- 
up button binding, set the Content binding to the Person array  
controller, set the controller key to filterPredicate, and choose the  
keyPath to be the pre-made fetch called getEmployees that I created in  
the xcdatamodel. It seems like that would simply limit the content to  
records that fit the predicate. Needless to say, this doesn't work,  
since at compile time, the console shows this:


2009-11-14 09:47:15.190 iCredit v0.1[7370:a0f] Binding contentValues  
of object  ignored: Key path (currently  
bound as arrangedObjects.firstName) needs to have the content key path  
(filterPredicate.getEmployees) as prefix


What should I have done, or can this be achieved with IB at all? I'm  
not opposed to writing the code to populate the NSPopUpButton object  
by hand, but bindings seem so right for this purpose that I can't seem  
to get past this hangup. Thanks for any insight!


-Dan
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Performance

2009-11-15 Thread Chris Carson
Hi all,

A performance related question:

I've written a Cocoa app that continuously reads data from a USB device and 
plots it on a graph. It consists of three of my own classes.

The first class is the model that submits asynchronous bulk reads to the USB 
device. The callback for these reads copies the received data from the buffer 
asynchronous filled by the request and into an NSData object that is allocated 
and added to an NSArray. The buffer that the asynchronous request was using is 
recycled into a new asynchronous request. So the pool of buffers is allocated 
once and reused while the NSData objects are continuously allocated and 
deallocated (when released by the controller).

The second class is the view that uses an NSTimer to call [self 
setNeedsDisplay:YES] 24 times per second. The drawRect: method requests data 
from the data source (the third, controller class) and draws it with OpenGL.

The third class is the controller class that serves as a data source for the 
view. When the view calls the giveMeData: method, the controller class calls 
the buffer: method in the model class, which removes and returns the oldest 
NSData object in its NSArray. The controller then does some computations on it 
and passes it off to the view in a new NSData object.

The application runs pretty well, and running it through the Leaks instrument 
there are no leaks except for 16-bytes when the application is first starting 
caused by IOUSBLib. However, looking at it in the Activity Monitor, the real 
memory used starts off at 25 MB and steadily grows to 250+ MB while the virtual 
memory starts off at about the same and steadily grows to about the same or 
sometimes close to 500MB, over the course of several minutes. This especially 
happens if I don't move the mouse for a while, or don't have the application in 
focus. As soon as a move the mouse or bring the application into focus, it's as 
if an autorelease pool is drained and the memory drops back down to 30-40MB 
real and 30-40MB virtual. This is annoying since the application hangs for 5 
seconds or so when this memory draining is occurring. Has anyone dealt with 
this before? Any ideas on what could be causing this and how to work around it?


Another related question:

The number of asynchronous requests that the driver submits at once and the 
maximum number of objects in the NSArray are set to some constant. Now in 
theory, the requests should be added and drained "simultaneously" (i.e. by 
separate threads), but if I make this constant larger, I notice a greater delay 
between when data entering the USB device and being plotted. It's as if the 
asynchronous requests are being filled and added to the NSArray all in a group, 
and then drained by the view all in a group... maybe? Is this something subtle 
from the way run loops work? Is the USB asynchronous bulk read run loop source 
on the same thread as the view class's drawRect method?


My apologies for the length of this post and if the USB stuff isn't strictly 
Cocoa related, but since it's so intertwined with Cocoa classes, I figured this 
was the best place to ask. Advice is much appreciated. Please CC me on replies.

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: Synchronization & Core Data

2009-11-15 Thread Karolis Ramanauskas
Ha! I just saw that book Amazon a few hours ago, but for some reason didn't
bother looking through the contents. I assumed I need an iPhone book.
Thanks!

On Sun, Nov 15, 2009 at 11:54 PM, Martin Hewitson <
martin.hewit...@aei.mpg.de> wrote:

> Apple's API for Persisting Data on Mac OS X
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Synchronization & Core Data

2009-11-15 Thread Martin Hewitson
I would grab a copy of 

Core Data: Apple's API for Persisting Data on Mac OS X
by Marcus S. Zarra

This book covers syncing core-data apps between Macs and iPhones in some detail.

Cheers,

Martin

On Nov 16, 2009, at 3:49 AM, Karolis Ramanauskas wrote:

> Good evening to everyone,
> 
> I'm in a (extensive) planning stage of a project and an issue of
> synchronization is forcing itself on me, I asked a question this morning
> about a networking side of things, and I got some info from nice people here
> about MYNetwork: http://bitbucket.org/snej/mynetwork/wiki/Home (I want to be
> able to sync data between Desktops and iPhones on a local network).
> 
> However, now I'm wondering how should I organize / store my data. I want to
> use CoreData and I could, easily. I probably won't even have to write a lot
> of code as I'm storing numbers, strings, and dates. Most of the behavior I
> need is free. But how would I sync core data stores between devices? Only
> info I could find was this post:
> http://forums.pragprog.com/forums/90/topics/3201. Perhaps someone has some
> experience with this? Should I do, as the post says, and create "date
> modified" attribute and write my own logic? Or is it possible, after all, to
> get some behavior for free from core data framework?
> 
> Thanks,
> Karolis
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de
> 
> This email sent to martin.hewit...@aei.mpg.de


Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Customize NSTableHeaderView

2009-11-15 Thread Symadept
Hi,

I want to customize NSTableHeaderView to that extent that
Shall be able to show custom Image in the background.
Shall be able to show the column separator.

Any pointers highly appreciable.

Regards
symadept
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CALayer Transitions

2009-11-15 Thread Gordon Apple
I had actually tried using that delegate method.  It gets called a lot
because the same controller is delegate to many layers (for drawing).  Of
course, I filter it for the my "content" layer.  As you noted, using
"sublayers" also triggers for other sublayers and I may have to use your
flag method to prevent this.

What I don't understand, is that, according to the core animation guide,
kCATransition seems to be what I want for a key instead of "sublayers".  The
guide says this is triggered by "replaceSublayer: with:".  However, stepping
it through, I never see this key come through the delegate.


On 11/15/09 8:51 PM, "Matt Neuburg"  wrote:

> On Sat, 14 Nov 2009 14:58:31 -0600, Gordon Apple  said:
>>I assume this should be simple, but so far I haven't found the magic
>> incantation, even after reading the docs, Dudley's book, and some archives.
>> 
>> Problem:  Layer called "contentLayer" has sublayers containing layer A,
>> which is to be transitioned to layer B.  (Note: Using GC here.)  Controller
>> code:
>> 
>> -(void)transitionFrom:(CALayer*)A to:(CALayer*)B{
>> 
>>CATransition* trans = [CATransition animation];
>>trans.type = kCATransitionPush;
>>trans.subtype = kCATransitionFromLeft;
>>trans.speed = 0.5;
>>
>>[[self contentLayer] addAnimation:trans forKey:kCATransition];
>>[[self contentLayer] replaceSublayer:A with:B];
>> }
>> 
>>My understanding (likely wrong) is that replaceSublayer triggers the
>> necessary action to start the transition, then the animation object is
>> automatically removed (default).
>> 
>>   I get an initial transition, then on subsequent calls get layer
>> replacement but no transition.  What am I missing?
> 
> Your understanding is likely wrong. :) addAnimation:forKey: on a layer
> triggers the animation then and there. Look at the examples in the Animation
> section of the Core Animation Programming Guide.
> 
> That, however, isn't what you want. You want the action of replacing
> sublayer A with sublayer B to trigger the animation. For that, look at the
> Actions section of the Core Animation Programming Guide.
> 
> For my money, the easiest way to set this up is to make self your
> contentLayer's delegate and implement actionForLayer:forKey:. So, assuming
> the delegation is already set up:
> 
> -(void)transitionFrom:(CALayer*)A to:(CALayer*)B {
> [[window.contentView layer] replaceSublayer:A with:B];
> }
> 
> - (id)actionForLayer:(CALayer *)theLayer
> forKey:(NSString *)theKey {
> if ([theKey isEqualToString:@"sublayers"]) {
> CATransition* trans = [CATransition animation];
> trans.type = kCATransitionPush;
> trans.subtype = kCATransitionFromLeft;
> trans.speed = 0.5;
> return trans;
> }
> return [NSNull null]; // or whatever
> }
> 
> To be cleverer about when to trigger the animation and when not, just raise
> an ivar flag in self. For example, you might like to animate when certain
> sublayers are added but not others. So transitionFrom would raise a flag and
> actionForLayer could check that flag (in addition to checking the key).
> That's why I like this approach: it's so flexible. However, there are other
> ways to do it.
> 
> By the way, there is an example almost *exactly* like this in the Actions
> section of the Core Animation Programming Guide. m.

-- 
Gordon Apple
Ed4U
Little Rock, AR


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CALayer Transitions

2009-11-15 Thread Kyle Sluder
On Sun, Nov 15, 2009 at 8:27 PM, Kyle Sluder  wrote:
> aLayer.actions = [NSArray arrayWithObject:anAnimation];

Er, this is supposed to be a dictionary, not an array.  But you
probably noticed that or would have understood the compiler error.
Sorry 'bout that.

--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: CALayer Transitions

2009-11-15 Thread Kyle Sluder
On Sun, Nov 15, 2009 at 6:51 PM, Matt Neuburg  wrote:
> Your understanding is likely wrong. :) addAnimation:forKey: on a layer
> triggers the animation then and there. Look at the examples in the Animation
> section of the Core Animation Programming Guide.

To elaborate, the purpose of the key in -addAnimation:forKey: is so
that you can go back and refer to the animation later without having
to store it in some external data structure.  Instead, it's hanging
right on the layer you attached it to.  It's unfortunate that Core
Animation suffers from such a conflict of terminology here.  They
really should have picked something else ("tag"?) to describe "handle
by which you can refer to an animation you previously attached to this
thing."

> For my money, the easiest way to set this up is to make self your
> contentLayer's delegate and implement actionForLayer:forKey:. So, assuming
> the delegation is already set up:

This is probably the easiest if you already have a delegate.  If
you're doing a one-off animation here, you could get away with
aLayer.actions = [NSArray arrayWithObject:anAnimation];

--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: NSPopUpButton submenu's

2009-11-15 Thread Jerry Krinock


On 2009 Nov 14, at 11:14, SRD wrote:


I'm still not understanding what I'm doing wrong.

- (IBAction) readMenuSelection:(id) sender
{   
// sender is NSPopUpButton
NSMenuItem *menuItem = [sender selectedItem];

NSMenu *subMenu = [menuItem submenu];
   // subMenu is null at this point.
NSLog(@"submenu %@", subMenu);


Hierarchical menus can be confusing because there are so many layers  
to keep track of: menus, items, etc.  In the code above, log the title  
of the selected item.  Is it what you expect?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CALayer Transitions

2009-11-15 Thread Matt Neuburg
On Sat, 14 Nov 2009 14:58:31 -0600, Gordon Apple  said:
>I assume this should be simple, but so far I haven't found the magic
>incantation, even after reading the docs, Dudley's book, and some archives.
>
>Problem:  Layer called "contentLayer" has sublayers containing layer A,
>which is to be transitioned to layer B.  (Note: Using GC here.)  Controller
>code:
>
>-(void)transitionFrom:(CALayer*)A to:(CALayer*)B{
>
>CATransition* trans = [CATransition animation];
>trans.type = kCATransitionPush;
>trans.subtype = kCATransitionFromLeft;
>trans.speed = 0.5;
>
>[[self contentLayer] addAnimation:trans forKey:kCATransition];
>[[self contentLayer] replaceSublayer:A with:B];
>}
>
>My understanding (likely wrong) is that replaceSublayer triggers the
>necessary action to start the transition, then the animation object is
>automatically removed (default).
>
>   I get an initial transition, then on subsequent calls get layer
>replacement but no transition.  What am I missing?

Your understanding is likely wrong. :) addAnimation:forKey: on a layer
triggers the animation then and there. Look at the examples in the Animation
section of the Core Animation Programming Guide.

That, however, isn't what you want. You want the action of replacing
sublayer A with sublayer B to trigger the animation. For that, look at the
Actions section of the Core Animation Programming Guide.

For my money, the easiest way to set this up is to make self your
contentLayer's delegate and implement actionForLayer:forKey:. So, assuming
the delegation is already set up:

-(void)transitionFrom:(CALayer*)A to:(CALayer*)B {
[[window.contentView layer] replaceSublayer:A with:B];
}

- (id)actionForLayer:(CALayer *)theLayer
forKey:(NSString *)theKey {
if ([theKey isEqualToString:@"sublayers"]) {
CATransition* trans = [CATransition animation];
trans.type = kCATransitionPush;
trans.subtype = kCATransitionFromLeft;
trans.speed = 0.5;
return trans;
}
return [NSNull null]; // or whatever
}

To be cleverer about when to trigger the animation and when not, just raise
an ivar flag in self. For example, you might like to animate when certain
sublayers are added but not others. So transitionFrom would raise a flag and
actionForLayer could check that flag (in addition to checking the key).
That's why I like this approach: it's so flexible. However, there are other
ways to do it.

By the way, there is an example almost *exactly* like this in the Actions
section of the Core Animation Programming Guide. m.

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



___

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

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

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

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


Synchronization & Core Data

2009-11-15 Thread Karolis Ramanauskas
Good evening to everyone,

I'm in a (extensive) planning stage of a project and an issue of
synchronization is forcing itself on me, I asked a question this morning
about a networking side of things, and I got some info from nice people here
about MYNetwork: http://bitbucket.org/snej/mynetwork/wiki/Home (I want to be
able to sync data between Desktops and iPhones on a local network).

However, now I'm wondering how should I organize / store my data. I want to
use CoreData and I could, easily. I probably won't even have to write a lot
of code as I'm storing numbers, strings, and dates. Most of the behavior I
need is free. But how would I sync core data stores between devices? Only
info I could find was this post:
http://forums.pragprog.com/forums/90/topics/3201. Perhaps someone has some
experience with this? Should I do, as the post says, and create "date
modified" attribute and write my own logic? Or is it possible, after all, to
get some behavior for free from core data framework?

Thanks,
Karolis
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Authorization Samples for Cocoa?

2009-11-15 Thread Laurent Daudelin
Hello.

I need a little helper tool to run under privileges and got it to work with 
help from the "BLAuthentication" class. However, I'd like to put up a 
personalized message when the security server requests the user to enter an 
admin password. The BLAuthentication class uses 
"AuthorizationExecuteWithPrivileges" which doesn't seem to allow to pass a 
description like "AuthorizationRightSet" seems to allow. I've searched for some 
samples but they are all very outdated (from 2005 (AuthForAll) and 2007 
(BetterAuthorizationSample)) and are way too complex to understand in like one 
hour. I can't imagine that all that crap hasn't been encapsulated under some 
Objective-C classes. Anyone has any idea or pointer to something basic I don't 
need to take a few hours to figure it out? I'm not interested in a sample with 
an array of functions that perform an array of things, just a plain, simple 
example would do.

Thanks in advance.




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

___

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

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

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

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


Re: Example of categorized lists in a Mail-type interface

2009-11-15 Thread Rob Keniger

On 16/11/2009, at 4:38 AM, Ian Piper wrote:

> I would appreciate it if someone could point me at an example that I could 
> use as the basis for building a categorized list similar to the mail folders 
> display in Mail.

This should help:

http://developer.apple.com/mac/library/samplecode/SourceView

--
Rob Keniger



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Automatically terminating application

2009-11-15 Thread William Squires


On Oct 7, 2009, at 9:57 PM, Wim Lewis wrote:



On Oct 7, 2009, at 1:44 PM, Daniel Ketel wrote:
[...] I must have done something wrong, the application seems to  
get confused or I don't know what. The system itself still is  
running, but somehow the application is ignoring ANY input, but  
since it covers up the whole screen and ignores the input, I have  
no means of terminating the application. I can't switch to  
Activity Monitor or back to xcode or anything...
[...] So I though there might be something built into xcode (or  
something in the xcode-package) like a timer to terminate an  
application. For example before starting my application in debug  
mode I would set the timer to say 10 seconds, and after 10 seconds  
the application will be killed automagically, regardless of what  
it is doing. Would help me a lot, since I wouldn't have to force- 
kill the whole system (forced shutdown...). Any ideas?


You could use the alarm() syscall. This will schedule a SIGALARM to  
be sent to your process in some number of seconds. If you don't  
have a signal handler set up for that signal (and by default, you  
don't), then your program will be terminated. Just put a line like  
"alarm(10);" near the beginning of main().


(If you have another machine available, even a non-Mac, then using  
ssh to log in and kill the process is probably the easiest route,  
as Jens Alfke suggests.)


But don't forget that you need to enable remote login via the Sharing  
system preferences panel or this'll get nowhere, methinks!





___
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list  (xcode-us...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/wsquires% 
40satx.rr.com


This email sent to wsqui...@satx.rr.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 can a plug-in bundle get access to its own resources?

2009-11-15 Thread Steve Christensen
As has been pointed out several times, it's a really bad idea to have  
the same-named class in multiple plugins. The Objective-C runtime will  
load the first class instance it finds (in your case, in the first- 
loaded plugin). For all other plugins, when the class is referenced,  
that first class instance is used, so calling [NSBundle bundleForClass: 
[self class]] will cause it to return the bundle for that first  
plugin, no matter which plugin is asking. This answers your question  
about code knowing its containing bundle. You made an assumption about  
where the plug-in's code was loaded that turned out to be incorrect.


If you want to use the same class code for each plug-in, I would  
suggest that you use a #define to rename the plug-in class at build  
time, and add a per-target definition containing a unique class name.  
Then your common class would be renamed automatically for each target.  
If you have to specify the plugin class in, say, your Info.plist, you  
could use the same build definition.


@interface PLUGIN_CLASS_NAME
...
@end


@implementation PLUGIN_CLASS_NAME
...
@end

The benefit of going with this model is that you still maintain a  
single code base for all of your plugins, even though the class is  
renamed on a per-plugin basis; you eliminate the "which plugin am I"  
problem you're running into now; and you don't have to worry about  
having an older plugin version that happens to load before a newer  
version, thus forcing all the newer plug-ins to use the older plug-in  
code.



On Nov 15, 2009, at 3:36 AM, Motti Shneor wrote:


Thanks, but the bundleWithIdentifier has its own problems.

1. The identifier is (as far as i know) accessible only from the  
bundle itself, which I don't have! I'm circling around here, without  
access to my own resources!  Must I hard-code the bundle identifier  
as a string constant within each of my plug-ins?


2. Even if I DO follow this rule, how can I manage to distinguish  
between two bundles that include the same plug-in but from different  
versions?


They have the same class, and the same identifier


Really, Isn't there a way for a library (dll, dylib framework etc)  
to know what is its containing bundle?



On 10/11/2009, at 19:42, Douglas Davidson wrote:


On Nov 10, 2009, at 4:59 AM, Motti Shneor wrote:


Thanks guys, but you may have not read all my message ---

The [NSBundle bundleForClass:[self class]];

is unusable for me, because I have many plugins that build from the
same code, and export the same class (of course --- the same class
name).

Obj-C has no name-spaces, and so, If you load 2 such plugins, and
use the [NSBundle bundleForClass:[self class]] in each of them
independently --- you'll get erroneous answers! both of them will
return the same bundle although they come from different bundles.

This is hardly a system "bug" because there are no namespaces, and
for the same class name there is only one bundle.


As others have said, don't do this.  However, to answer your  
question,

the other way to locate your bundle is via bundleWithIdentifier:.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CPU sampling and +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]

2009-11-15 Thread Paulo Andrade
Thank you both. I have finally understood what's going on :).

On Nov 15, 2009, at 7:19 AM, Joar Wingfors wrote:

> 
> On 14 nov 2009, at 03.20, Michael Ash wrote:
> 
>> On Fri, Nov 13, 2009 at 1:28 PM, Paulo Andrade  wrote:
>>> Hello,
>>> 
>>> I'm using the CPU sampler template.
>>> 
>>> Here (http://1wzi.sl.pt) is a sample of a very simple run to prove my point.
>>> 
>>> Here's how I collected it:
>>> - Start the app and let it fully launch (it does a few request at boot)
>>> - Attach instruments with the CPU Sampler template
>>> - Let it run for 30 seconds and not touch the iphone
>>> 
>>> You'll see that the time is equally divided between +[UIApplication run] 
>>> and +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
>>> 
>>> Please let me know if you have any other ideas that could explain this.
>> 
>> The CPU sampler in Instruments does not distinguish between a thread
>> which is actively running (and taking up CPU time) and a thread which
>> is sleeping (and taking no CPU time). This does not make it very
>> useful. I recommend using Shark instead.
> 
> 
> Michael:
> 
> Sometimes you don't care about sleeping threads, sometimes you do. And in 
> fact, Shark offers both modes: [1] Time Profile, and [2] Time Profile (All 
> Thread States). The second mode, Time Profile (All Thread States), works in 
> the same way as the CPU Sampler in Instruments.
> 
> If you're investigating what is clearly a CPU bound problem, then you 
> probably aren't as interested in sleeping threads, and in that case the Time 
> Profile would work well (given that it has lower overhead and provides finer 
> granularity). The drawback with the Time Profile is that it doesn't even show 
> sleeping threads in the report (only active threads show up). This can be 
> surprising (what, no main thread?!), and you might also miss important clues.
> 
> If you, on the other hand, are not quite sure what you're looking for yet, or 
> if you know that you're interested in blocking operations, then Time Profile 
> (All Thread States) in Shark, or the CPU Sampler in Instruments, probably 
> would be better.
> 
> Paulo:
> 
> You had the "Show Ojb-C Only" filter set in Instruments. While this makes the 
> report more compact, it also hides some important details. When I disable 
> that, and "Invert Call Tree" setting, I see this:
> 
>   2331  Thread 0x8eff : -[NSThread main] :0
>   2331_pthread_body
>   2331  __NSThread__main__
>   2331-[NSThread main]
>   2331  +[NSURLConnection(NSURLConnectionReallyInternal) 
> _resourceLoadLoop:]
>   2331CFRunLoopRunInMode
>   2331  CFRunLoopRunSpecific
>   2331mach_msg_trap
> 
> Two things of interest to note here:
> 
> * You have the same sample count for all "frames", meaning that every sample 
> found the same backtrace. This is, btw., true for all threads in this report.
> 
> * The "mach_msg_trap" is symbol that you should learn to recognize as 
> indicating that this thread is "parked", waiting for more work. If you look 
> at the other treads, you'll find that they're all parked in the same, or 
> similar, places.
> 
> So, to summarize: Your application is completely idle in this report. You 
> didn't expect any activity, and there isn't any.
> 
> j o a r
> 
> 

___

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

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

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

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


Re: Example of categorized lists in a Mail-type interface

2009-11-15 Thread Seth Willits

On Nov 15, 2009, at 10:38 AM, Ian Piper wrote:

I would appreciate it if someone could point me at an example that I  
could use as the basis for building a categorized list similar to  
the mail folders display in Mail.



It's a standard outline view, with group rows. See the delegate  
methods for NSOutlineView.



--
Seth Willits



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSWindowCollectionBehaviorMoveToActiveSpace doesn't work

2009-11-15 Thread slasktrattena...@gmail.com
This appears to be a bug. I found that whereas calling

[self setCollectionBehavior:NSWindowCollectionBehaviorMoveToActiveSpace];

has no effect,

[self setCollectionBehavior:1];

produces the desired behavior. I'll file a radar.

/f

On Sun, Nov 15, 2009 at 7:31 PM, slasktrattena...@gmail.com
 wrote:
> Hi all,
>
> Setting the collection behavior of my (standard) NSWindow to
> NSWindowCollectionBehaviorMoveToActiveSpace has no effect whatsoever.
> Someone else posted a simple test project a while back demonstrating
> the problem:
>
> http://lists.apple.com/archives/cocoa-dev/2009/Oct/msg00647.html
>
> Any ideas? Thanks.
>
> /f
>
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Example of categorized lists in a Mail-type interface

2009-11-15 Thread Ian Piper
Hi all,

I would appreciate it if someone could point me at an example that I could use 
as the basis for building a categorized list similar to the mail folders 
display in Mail.

I have a data model that has an entity called category and another called item. 
These have a one to many relationship (an item is in just one category, while a 
category can have many items). I want to have a list of categories in the left 
panel, with a disclosure arrow to open up for a list of items in that category. 
Selecting each item shows the detail to the right. As with Mail the category 
titles should not be selectable, but only open or close via the arrow. BTW I am 
only looking for one level of hierarchy below the category, so it is different 
from Mail in that respect.

I'm probably missing something obvious but I can't see how to start with 
building or coding this.

Anyway, I'm not looking for a complete solution, obviously, but some pointers 
or examples to use as a starting point.

Thanks for any guidance you can offer.

Regards,


Ian.
--
___

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

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

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

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


NSWindowCollectionBehaviorMoveToActiveSpace doesn't work

2009-11-15 Thread slasktrattena...@gmail.com
Hi all,

Setting the collection behavior of my (standard) NSWindow to
NSWindowCollectionBehaviorMoveToActiveSpace has no effect whatsoever.
Someone else posted a simple test project a while back demonstrating
the problem:

http://lists.apple.com/archives/cocoa-dev/2009/Oct/msg00647.html

Any ideas? Thanks.

/f
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


[OT] Re: jdns_sd.dll ??? Bonjour & Cocoa OK, but .... Bonjour & Java & Windows??? - need help!

2009-11-15 Thread Alastair Houghton
On 15 Nov 2009, at 14:14, Gabriel Höhener wrote:

> I already could make a cocoa application that works just like I want using 
> bonjour (it works with wlan and bluetooth and cable like a charm!). Then I 
> thought to develop the same thing for windows and thought that this would be 
> as easy... no way! It's a nightmare!!!

[snip]

In what way is this a Cocoa question?  (Hint: it isn't, and not even close 
either.  You aren't even asking about Mac OS X-related things here!)

Please ask on a more appropriate mailing list; you probably either want 
bonjour-dev, or (since you're asking about Windows) one of Microsoft's mailing 
lists, or possibly one of the various Java mailing lists.

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


Re: retain and don`t retain in accessor methods

2009-11-15 Thread Clark Cox
On Sat, Nov 14, 2009 at 11:35 PM, Ariel Feinerman  wrote:
> 2009/11/15 Kyle Sluder 
>
>> On Sat, Nov 14, 2009 at 2:35 PM, Ariel Feinerman 
>> wrote:
>> > I need two versions of -initWith ... and -set ... methods of custom timer
>> > class (for example, to prevent the circle references);
>>
>> Do not use accessors in your initializers or -dealloc.
>>
>
> Hm, it means to do the same work two times, I think. For example if I change
> the mechanism in the setting of instance variables, I must to change one in
> difference inits method; can you say a reason?

The reason often given (to which I don't personally subscribe) is that
the accessor could be overridden in a subclass, and therefore do
things that aren't appropriate (i.e. they could assume something about
the already-dealloc'ed or not-yet-init'ed portions of the subclass).

-- 
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: [iPhone] iPhone Screen with Add Photo and UITableView

2009-11-15 Thread Luke Hiesterman

What you see in Contacts is probably all in a tableHeaderView.

Luke

Sent from my iPhone.

On Nov 15, 2009, at 2:40 AM, Tharindu Madushanka  
 wrote:



Hi

I am trying to implement a screen in that it should have a table  
view, with
add photo button and to right a table view cell. Could I do this  
with a
single table view ? Can anyone point some way to do it. Like in  
contacts app


Thank you,

Tharindu
___

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

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


Re: Sync my iPhone app with the Desktop version

2009-11-15 Thread John Cebasek
Another plug for Jens Alfke's MyNetworkLibrary... Takes a bit to set up 
(detailed in the documentation), but works fine!

It's at:

http://bitbucket.org/snej/mynetwork/

John
On 2009-11-15, at 9:40 AM, Karolis Ramanauskas wrote:

> Good day,
> 
> Does anyone here have pointers on how to implement syncing of my iphone
> application with the desktop version. I am interested in the way "Things" on
> iPhone does it, for example: http://bit.ly/OrLhi. They use wi-fi. The
> biggest problem I have digging up any information is that looking for
> "iPhone app sync" and similar queries in Google give me a lot of "junk",
> e.g., the results usually have to do with iTunes app sync, etc.
> 
> If anyone here have any experience with this, please drop me a bone or
> two...
> 
> Thanks and Regards,
> Karolis
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/john_cebasek%40sympatico.ca
> 
> This email sent to john_ceba...@sympatico.ca
> 

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Sync my iPhone app with the Desktop version

2009-11-15 Thread Karolis Ramanauskas
Good day,

Does anyone here have pointers on how to implement syncing of my iphone
application with the desktop version. I am interested in the way "Things" on
iPhone does it, for example: http://bit.ly/OrLhi. They use wi-fi. The
biggest problem I have digging up any information is that looking for
"iPhone app sync" and similar queries in Google give me a lot of "junk",
e.g., the results usually have to do with iTunes app sync, etc.

If anyone here have any experience with this, please drop me a bone or
two...

Thanks and Regards,
Karolis
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 can a plug-in bundle get access to its own resources?

2009-11-15 Thread Mike Abdullah


On 15 Nov 2009, at 11:36 AM, Motti Shneor  wrote:


Thanks, but the bundleWithIdentifier has its own problems.

1. The identifier is (as far as i know) accessible only from the  
bundle itself, which I don't have! I'm circling around here, without  
access to my own resources!  Must I hard-code the bundle identifier  
as a string constant within each of my plug-ins?


If you want to use that method, yes


2. Even if I DO follow this rule, how can I manage to distinguish  
between two bundles that include the same plug-in but from different  
versions?


They have the same class, and the same identifier


Really, Isn't there a way for a library (dll, dylib framework etc)  
to know what is its containing bundle?


As already explained to you, having the same class loaded twice is a  
really bad idea. You have an API that does exactly what you want  
(bundleForClass:) — now fix your code not to re-use class names



On 10/11/2009, at 19:42, Douglas Davidson wrote:



On Nov 10, 2009, at 4:59 AM, Motti Shneor wrote:


Thanks guys, but you may have not read all my message ---

The [NSBundle bundleForClass:[self class]];

is unusable for me, because I have many plugins that build from the
same code, and export the same class (of course --- the same class
name).

Obj-C has no name-spaces, and so, If you load 2 such plugins, and
use the [NSBundle bundleForClass:[self class]] in each of them
independently --- you'll get erroneous answers! both of them will
return the same bundle although they come from different bundles.

This is hardly a system "bug" because there are no namespaces, and
for the same class name there is only one bundle.


As others have said, don't do this.  However, to answer your  
question,

the other way to locate your bundle is via bundleWithIdentifier:.

Douglas Davidson



Motti Shneor
--
Senior Software Engineer
Waves Audio ltd.

Phone: +972-3-6094415
Mobile: +972-54-4470730
[mailto: mot...@waves.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/cocoadev%40mikeabdullah.net

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


jdns_sd.dll ??? Bonjour & Cocoa OK, but .... Bonjour & Java & Windows??? - need help!

2009-11-15 Thread Gabriel Höhener

Hello folks

I already could make a cocoa application that works just like I want 
using bonjour (it works with wlan and bluetooth and cable like a 
charm!). Then I thought to develop the same thing for windows and 
thought that this would be as easy... no way! It's a nightmare!!!


Has anybody any experiences and can help telling me the best way to 
begin...


- I have Bonjour SDK installed (do I have to compile/use some .dll's or 
can I just start developing using Java (using which bonjour-libraries? 
.. jdns_sd.dll... ?)...?)
- Java has nice API's like BonSwing, BonAHA... but the problem is that 
they need some jdns_sd.dll and I don't know where/how to get that... 
(see question 1)


- I already tried using jmDNS and that worked at the beginning - but not 
for bluetooth devices... I couldn't find any service...



Thank you!

Gabe

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 are the interface builder components?

2009-11-15 Thread lbland

On Nov 14, 2009, at 8:40 PM, Dave DeLong wrote:

> There are a bunch of freely available frameworks that have UI elements like 
> that, such as BWToolkit, BGHudAppKit, AmberFramework, iLife Controls, 
> HMBlkAppKit, and more.
> 
> Here's a decent list:  http://cocoaheads.byu.edu/resources/user-interface

hi-

Cool! Whoever did the web layout for that site is a genius!

Here is another IB plugin:

http://www.vvidget.org/code/description

You can read a plug about it at:

http://www.vvi.com/news/2009/1112vvidget.html

thanks!-

-lance

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 can a plug-in bundle get access to its own resources?

2009-11-15 Thread Motti Shneor
Thanks, but the bundleWithIdentifier has its own problems.

1. The identifier is (as far as i know) accessible only from the bundle itself, 
which I don't have! I'm circling around here, without access to my own 
resources!  Must I hard-code the bundle identifier as a string constant within 
each of my plug-ins?

2. Even if I DO follow this rule, how can I manage to distinguish between two 
bundles that include the same plug-in but from different versions?

They have the same class, and the same identifier


Really, Isn't there a way for a library (dll, dylib framework etc) to know what 
is its containing bundle?


On 10/11/2009, at 19:42, Douglas Davidson wrote:

> 
> On Nov 10, 2009, at 4:59 AM, Motti Shneor wrote:
> 
>> Thanks guys, but you may have not read all my message ---
>> 
>> The [NSBundle bundleForClass:[self class]];
>> 
>> is unusable for me, because I have many plugins that build from the  
>> same code, and export the same class (of course --- the same class  
>> name).
>> 
>> Obj-C has no name-spaces, and so, If you load 2 such plugins, and  
>> use the [NSBundle bundleForClass:[self class]] in each of them  
>> independently --- you'll get erroneous answers! both of them will  
>> return the same bundle although they come from different bundles.
>> 
>> This is hardly a system "bug" because there are no namespaces, and  
>> for the same class name there is only one bundle.
> 
> As others have said, don't do this.  However, to answer your question,  
> the other way to locate your bundle is via bundleWithIdentifier:.
> 
> Douglas Davidson
> 

Motti Shneor
--
Senior Software Engineer
Waves Audio ltd.

Phone: +972-3-6094415
Mobile: +972-54-4470730
[mailto: mot...@waves.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


[iPhone] iPhone Screen with Add Photo and UITableView

2009-11-15 Thread Tharindu Madushanka
Hi

I am trying to implement a screen in that it should have a table view, with
add photo button and to right a table view cell. Could I do this with a
single table view ? Can anyone point some way to do it. Like in contacts app

Thank you,

Tharindu
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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