Re: Core Animation and interaction
> There's a CoreAnimation sample project that does just this, called LightBoard. > --Kyle Sluder Thank you and thanks everyone else. I didn't find the LightBoard sample but I found GeekGameBoard which helped me a lot. John. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Core Animation and interaction
Hi there, in my app I want to have a light table to sort photos. Basically it's just a huge view with lots of photos in it and you can drag the photos around. Photos can overlap, they don't fall into a grid like in iPhoto. So every photo needs to respond to mouse events. Do I make every photo into its own view? Or are views too expensive to create? I want to easily support 100+ photos or more. (I will downsample the images for performance.) Photos need to be in layers as well so I can change the stacking order. Do I use CoreAnimation for this? I don't need finished source code just some pointers and general ideas. I will (try to) figure out the implementation myself. Fwiw, I target 10.5+, I use Obj-C 2.0 and garbage collection. Thanks in advance! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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: Why "self"? (Was: Newbie: Referencing Objects)
Hi Graham! On 10/28/08, Graham Cox <[EMAIL PROTECTED]> wrote: > FWIW, I tried to do some coding in Actionscript a few years ago after > being immersed in C++ for many years and then Objective-C/Cocoa for a > few years. To say that it was an exercise in utter frustration is an > understatement. [...] I think I know how you feel. :-) And I share your opinion about Actionscript and (for me) Flash in general. I feel kinda spoiled by Actionscript but I'm unlearning now. :-)) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Why "self"? (Was: Newbie: Referencing Objects)
Hi Ken! Thank you for your long answer! It cleared up a lot of things for me. I come from coding in Actionscript (Flash) and there things are apparently quite different. Is it true that all instances I create live in memory on the same level? That they are all somehow equal? And that all relationships between them are only by pointers? Because in Actionscript you can have instances inside other object's instances and once you dealloc the containing instance all the other object's instances it contained die with it. Think Matryoshka puppets or something like that. On 10/28/08, Ken Thomases <[EMAIL PROTECTED]> wrote: > Part of the problem is that object's don't have names, they have addresses. I see. So I can only access an instance from within some other instance if I always remember to pass along a pointer to it? > But the pointer isn't the object and the object isn't the pointer. This is what I got wrong I guess. > So, when you say "I create a subobject called 'mySubObject' inside my > main object 'myMainObject'" I translate that to mean, that you have a > pointer named myMainObject to an instance of some custom class. In > the implementation of that class, there's a method, and in that method > you create another object of some other(?) class and store its address > into a pointer named mySubObject. mySubObject might be a local > variable, an instance variable, or whatever. > > Now, what does "within 'mySubObject'" mean? I assume you mean within > an instance method of the class of which mySubObject is an instance. Thank you. You translated correctly and explained it to me at the same time! :-) Your following explanation did the trick for me. Thank you again! Cheers, John. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Why "self"? (Was: Newbie: Referencing Objects)
Ken Thomases wrote me off-list. I don't know if this was deliberate (I guess not) but I'd rather not quote his mail here without his consent. Anyways the problem is fixed and I understand it all a whole lot better now. Big thanks to everybody and esp. Ken. You all are very nice people!! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Why "self"? (Was: Newbie: Referencing Objects)
Hi again! I'm still plucking along and any help is still greatly appreciated! Here is the deal: I create a subobject called "mySubObject" inside my main object "myMainObject". Now I want to access "myMainObject" from within "mySubObject". I'm still not sure what the ideal way to do this would be but I have gotten it to work somehow. Inside "myMainObject" I create a property and point it to "self" so it stores a reference to "myMainObject". Inside "mySubObject" I cannot access this by writing [pointerToMainObject doMethod]; but it works when I write [self.pointerToMainObject doMethod]; Why? What difference does "self" make here? I'm still trying to wrap my head around all this stuff so please bear with me here. :-) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Newbie: Referencing Objects (second try)
Hi again! I feel like I'm getting there. Though any help is still greatly appreciated! On Mon, Oct 27, 2008 at 3:58 AM, john fogg <[EMAIL PROTECTED]> wrote: > Or do I have to populate the variable once I created the object? It does work! I create the "secondSubObject" inside my "secondMainObject" and after that I set the property "secondMainObject" in "secondSubObject" to secondMainObject's "self". Only it is available after the object is initialized. I want to access the property already during initialization. Sorry for spamming the list. Please tell me if I should stop. :-) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Newbie: Referencing Objects (second try)
Hi again! On Mon, Oct 27, 2008 at 3:20 AM, john fogg <[EMAIL PROTECTED]> wrote: > OK I did that. But as far as I can tell I now have an empty variable > named "secondMainObject" located in "secondSubObject". How do I store > the reference to "secondMainObject" in the variable? Or do I have to populate the variable once I created the object? I created the accessor in "secondSubObject" as you said and tried (in "secondMainObject") secondSubObject.secondMainObject = self; But it doesn't seem to work. Hmpf! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Newbie: Referencing Objects (second try)
Hi again! On Sun, Oct 26, 2008 at 10:40 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > Use accessors. In secondSubObject, create an @property(assign) > SecondMainObject *secondMainObject; so that you can call methods in > secondMainObjct from secondSubObject. OK I did that. But as far as I can tell I now have an empty variable named "secondMainObject" located in "secondSubObject". How do I store the reference to "secondMainObject" in the variable? And how do I do this with my main application delegate? I want to call it from wherever I am. Thanks again for your help!! I can't stress this enough! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Newbie: Referencing Objects
Hi again! On Sun, Oct 26, 2008 at 10:02 PM, Ken Thomases <[EMAIL PROTECTED]> wrote: > [...] Does that help? Oh man, that helped a lot!! Thank you! Does this apply even if I create my UI programatically? I lay out all my interface elements with code and not in Interface Builder. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Newbie: Referencing Objects (second try)
Hi again! And thank you for your kind help!! Let me rephrase my question. I create two objects: "fistMainObject" and "secondMainObject". Inside the second I create another object called "secondSubObject". When I'm inside "secondSubObject" how can I alter a variable in "secondMainObject"? And how can I alter a variable in "firstMainObject"? Thanks again! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Re: Newbie: Referencing Objects
Hi again! Thank you everybody for your answers. On Sun, Oct 26, 2008 at 7:45 PM, Andy Lee <[EMAIL PROTECTED]> wrote: > I don't know Actionscript but it looks like it has a global dictionary of > objects that you can reference by name. There is nothing like "_root" in > Objective-C. I see, this is where I was wrong. Yes Actionscript has this global dictionary. If you know the name of an object and its place in the hierarchy you can access it. In my game I think of having a sort of "controller object" that controls the whole state of the game. So I'd like to access it from almost every other object further down the hierarchy. How would you do this? Is there a way to create the controller object and store its reference in a global variable? Or is there another common way to do this that I'm not thinking of? Sorry for asking such dumb questions but I'm still new to this. Thanks again in advance! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]
Newbie: Referencing Objects
Hi there! I'm stuck with Objective-C but then again I'm new to this. I searched the web for the last two days but maybe I'm looking in the wrong direction? I create a Button and in the course of that I set a "target:" and an "action:". Unlike any and all of the examples I found on the web and on Apple's site I don't want the message sent to my current object, so I don't want "target:self" but another object I created elsewhere from another class. How do I do that? I know I have an object in memory and I know its name but I don't have a pointer to it. For methods there is "@selector", is there something like it for objects? If this helps: In Actionscript I'd write "_root.myObjectName.myFunctionName" and be set. Is there a way to access objects like this in Objective-C? Or am I doing it all wrong? :-( Thanks in advance! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. 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 [EMAIL PROTECTED]