Re: iOS 8 beta 4 messes with my TextView
You can also change the constraint. It sounds like you vs auto-layout. Sent from my iPhone On Jul 29, 2014, at 8:06 AM, Kyle Sluder k...@ksluder.com wrote: On Jul 29, 2014, at 1:58 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Master Detail app, works fine in 7.1.2. The Detail View has a UITextView. Whenever I get a Keyboard Notification (Changed) I change the height of the TextView accordingly. All would be fine; but after all Notifications have been delivered and before I can start typing, some evil agent resets the height of my TextView back to the old (and now, with a keyboard present, much too big) value. Any ideas who would do such a thing to me? You can answer this question yourself. Subclass UITextView, override -setFrame:, and set a breakpoint. Any known work-arounds? You probably shouldn't be changing the frame of your text view. Rather, set its contentInset. --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: https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Class name as NSString and problem with NSLog?
Even further you can get the current command by using NSStringFromSelector(_cmd); _cmd is the current selector. You can also use NSLog(@“%s”, _PRETTY_FUNCTION”) which will give you the class name and current selector. Do a google search also for NSLog replacements there are ones that do a lot of work of prepending all NSlog calls with class, function, line number and you custom message. Like the answer here: http://stackoverflow.com/questions/969130/how-to-print-out-the-method-name-and-line-number-and-conditionally-disable-nslog Scott On Mar 6, 2014, at 10:21 AM, William Squires wsqui...@satx.rr.com wrote: Given an object, and a method within, is there some way to get the name of the class of the object as an NSString? For that matter, what I want to do is something like this: Class MyClass MyClass.h #import Foundation/Foundation.h @interface MyClass : NSObject ... -(void)myMethod; @end MyClass.m #import MyClass.h @implementation MyClass ... -(void)myMethod { NSString *myClassName = ???; // What can I put here besides a literal @MyClass? NSString *fooText = [NSString stringWithFormat:@%@ -(void)myMethod, myClassName]; NSLog(fooText); // Yellow triangle on this line } ... @end so that when the myMethod message is sent to an object of MyClass, the output should be: timestamp: MyClass -(void)myMethod on the output pane when debugging - timestamp just comes from the NSLog call. Also, when I do this (using a literal NSString constant for myClassName above), Xcode marks the line with NSLog with a yellow triangle, and disclosing it says something about passing an NSString instance as being unsecure. Can this warning be turned off? It seems silly to do: NSLog(@%@, fooText); just to avoid this warning. By using this strategy, if several classes implement the same message, I can tell which instance received the message during debugging; this is handy when iterating over containers (such as NSArray), and passing the same message to multiple objects, or when passing messages to objects of subclasses that override the behavior of their super. TIA! ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.com smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Paged UIScrollview is acting strange in iOS7?
I have some old gallery code that uses UIScrollView in a paged mode. We are trying to port the code to iOS7 but when we are getting strange behavior. In iOS7 we are constantly getting scrollViewDidScroll with weird offset of negative or some large offset that has huge exponents. Is there a known change in paged scrollviews in iOS7? Code is simple. The image content size is hard coded at 20 pages. The reality is its dynamic based on images coming and going. if (_imageScroller == nil) { CGRect scollViewRect = self.bounds; scollViewRect.size.width += IMAGE_PADDING; _imageScroller = [[UIScrollView alloc] initWithFrame:scollViewRect]; CGSize contentSize = _imageScroller.bounds.size; contentSize.width *= 20; _imageScroller.contentSize = contentSize; _imageScroller.pagingEnabled = YES; _imageScroller.delegate = self; _imageScroller.clipsToBounds = YES; _imageScroller.showsVerticalScrollIndicator = NO; _imageScroller.showsHorizontalScrollIndicator = NO; _imageScroller.backgroundColor = [UIColor blueColor]; [self addSubview:_imageScroller]; } ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Paged UIScrollview is acting strange in iOS7?
Seems our tool was not taking into account that the size needed to be halved out of our photoshop template. Some reason setting the frame and content size to 2x size of the view was causing the issue. One the scroll view was sized properly all is now working as expected. Scott On Feb 17, 2014, at 5:31 PM, Scott Andrew scottand...@roadrunner.com wrote: I have some old gallery code that uses UIScrollView in a paged mode. We are trying to port the code to iOS7 but when we are getting strange behavior. In iOS7 we are constantly getting scrollViewDidScroll with weird offset of negative or some large offset that has huge exponents. Is there a known change in paged scrollviews in iOS7? Code is simple. The image content size is hard coded at 20 pages. The reality is its dynamic based on images coming and going. if (_imageScroller == nil) { CGRect scollViewRect = self.bounds; scollViewRect.size.width += IMAGE_PADDING; _imageScroller = [[UIScrollView alloc] initWithFrame:scollViewRect]; CGSize contentSize = _imageScroller.bounds.size; contentSize.width *= 20; _imageScroller.contentSize = contentSize; _imageScroller.pagingEnabled = YES; _imageScroller.delegate = self; _imageScroller.clipsToBounds = YES; _imageScroller.showsVerticalScrollIndicator = NO; _imageScroller.showsHorizontalScrollIndicator = NO; _imageScroller.backgroundColor = [UIColor blueColor]; [self addSubview:_imageScroller]; } ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Wanted: new owner for Mac apps
Hmmm. Wonder how long they'll last. Can you do me a bit of research. See if you can find reviews on these. The read me in the link has their names. See what people think of em. Sent from my iPhone On May 7, 2013, at 6:54 AM, Steven Degutis sbdegu...@gmail.com wrote: These ones: https://github.com/sdegutis/grs They're a lovely little set of Mac apps. Most of them are on the App Store, and with absolutely no marketing they've been making about $42 per month. I'm sure with marketing they'll do much better. This repo also includes AppGrid, which had a huge cult following for the 20 people I've given away free licenses to. They all highly prefer it over Divvy/SizeUp/etc. But again, haven't done marketing. If anyone's interested in taking any or all these apps, just let me know. I'll take them off the store and you can put them up. For the curious, I'm giving them away because -Steven ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Question about block, ARC, self, and reference counting.
I have a question about retain cycles with ARC and blocks. I have the following code: __weak MyViewController* controller = self; [UIView animateWithDuration:.25 animations:^{ controller.alpha = 0; } completion:^(BOOL finsihed) { [controller showState]; }]; -(void) showState { self.textView.text = self.stateText; } I have a question about what happens when I use self in showState. DId i just cause a reference counting issue where I now have an extra retain on self and it's not going to be cleaned up? The WWDC video say to use weak pointers to self in the block otherwise there could be retain cycle issues. This is an example. The utility functions are actually quite larger and called from multiple places. I'm not creating the strong refrence via a variable because these blocks won't be called if self doesn't exist. Scott ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Question about block, ARC, self, and reference counting.
Cool. Thank you that was sort of my thought. Then went and watched the WWDC video and went into a bit of a panic. Scott On Apr 12, 2012, at 11:18 AM, Ken Thomases wrote: On Apr 12, 2012, at 12:04 PM, Scott Andrew wrote: I have a question about retain cycles with ARC and blocks. I have the following code: __weak MyViewController* controller = self; [UIView animateWithDuration:.25 animations:^{ controller.alpha = 0; } completion:^(BOOL finsihed) { [controller showState]; }]; -(void) showState { self.textView.text = self.stateText; } I have a question about what happens when I use self in showState. DId i just cause a reference counting issue where I now have an extra retain on self and it's not going to be cleaned up? No. The compiler looks at the code _in the block_ to know what the block should retain. It doesn't (for this purpose) look inside the -showState method. It can't even reliably know for sure that the call to -showState in the block refers to that implementation of -showState. For example, this code could all be called from a superclass which overrides -showState. The WWDC video say to use weak pointers to self in the block otherwise there could be retain cycle issues. This is an example. The utility functions are actually quite larger and called from multiple places. I'm not creating the strong refrence via a variable because these blocks won't be called if self doesn't exist. For this case, you don't even have to worry about referencing self in the blocks directly. You don't need to use the weak copy, controller. First, the object is not itself retaining the blocks. So, if the blocks retain self, that's still not a retain cycle. Second, the blocks will be disposed of when the animation completes. So any reference they hold on self is released when that happens. Regards, 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS drawer-style interaction
What about using a UIPanGestureRecognizer? I didn't see anything in the docs that says a swipe get's continuous feedback. A UIPanGestureRecognizer gives continuous feedback during the drag. Scott On Apr 5, 2012, at 11:45 PM, Rick Mann wrote: I'm trying to implement a drawer of sorts. Initially I added a down-swipe gesture recognizer, but I'd like the drawer edge to track the user's finger. Is there a way I can hook in to the recognizer to continuously track the finger after recognition? TIA, -- Rick ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ARC not ready for primetime?
I've uploaded a quick sample that shows what i have been seeing. I put some NSLogs to show the deallocs for the NWColorViewController and NWColorLayer so you can see dealloc being called. Load in instruments Allocations app and switch back and forth a few times and end on the Hide tab. Basically this is creating and destroying a color view controller (my real app does this as a datasource for UIPageViewController). Go to the object list and filter by NWLayerTest, you will small amounts of memory leaked where the view controller was created and added to the subview. This is exactly what i am seeing in my code. Bits of runtime being left behind. i have uploaded a sample project to https://bitbucket.org/ScottAndrew/arc-memory-issue Scott On Mar 24, 2012, at 5:11 AM, T.J. Usiyan wrote: Could you post the code for the sublayer and what is the residual memory? On Sat, Mar 24, 2012 at 4:17 AM, Scott Andrew scottand...@roadrunner.comwrote: I seem to have hit a few limitations with ARC. 1.) Subclasses of CALayer are not being fully released which causes my view controller to remain around. There is still some small bit of memory being left behind. Even if I do the following simple code: -(void) viewDidLoad { [super viewDidLoad]; CNFooLayer* foo = [CNFooLayer layer]; [self.view.layer addSublayer:cup]; } Cup is: @interface CNFooLayer : CALayer @end If you change the above too: [super viewDidLoad]; CALayer* foo = [CALayer layer]; [self.view.layer addSublayer:cup]; all is good. If I watch the object list the object allocations you can see that there is residual memory left behind and my view controller is still around (even though dealloc was called). 2.) I have a simple class with lost of properties that if i alloc and init it will cause my hand created view controller to stick around. Remove the alloc in the view controller and all is fine. I seem to be at the point now where need to remove arc and go back to retain, release. The weird thing is leaks has no leaks, watching for my viewController in statistics shows that it has gone away. However heapshot shows residual and so does the object list. ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/griotspeak%40gmail.com This email sent to griotsp...@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: https://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
ARC not ready for primetime?
I seem to have hit a few limitations with ARC. 1.) Subclasses of CALayer are not being fully released which causes my view controller to remain around. There is still some small bit of memory being left behind. Even if I do the following simple code: -(void) viewDidLoad { [super viewDidLoad]; CNFooLayer* foo = [CNFooLayer layer]; [self.view.layer addSublayer:cup]; } Cup is: @interface CNFooLayer : CALayer @end If you change the above too: [super viewDidLoad]; CALayer* foo = [CALayer layer]; [self.view.layer addSublayer:cup]; all is good. If I watch the object list the object allocations you can see that there is residual memory left behind and my view controller is still around (even though dealloc was called). 2.) I have a simple class with lost of properties that if i alloc and init it will cause my hand created view controller to stick around. Remove the alloc in the view controller and all is fine. I seem to be at the point now where need to remove arc and go back to retain, release. The weird thing is leaks has no leaks, watching for my viewController in statistics shows that it has gone away. However heapshot shows residual and so does the object list. ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
GLKit's GLKBaseEffect leaking?
Has anyone been noticing that GLKit's base effect is leaking when calling prepareToDraw? There are repeated leaks in GLKShaderBlockNode. It seems that this may be new to 5.1 SDK. I could have sworn i did a check with 5.0. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Need help debugging this
As was pointed out below the CString doesn't support instance method string:. Crashing this in a debugger should give you call stack so you can trace who is doing the calling. You should also have a crash log that can be symbolized. But, if this is your code run it in the debugger and have it crash. Use the call stack to see who is making this call. Scott On Jul 18, 2011, at 11:13 AM, Quincey Morris wrote: On Jul 18, 2011, at 05:48, Andre Masse wrote: -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70 I don't think anyone's pointed you in the direction of *reading* this error message. Note that it says -[NSCFString string], not +[NSCFString string]. Someone has sent a 'string' message to a NSString instance. NSString instances don't respond to 'string' messages. NSString *classes* do. That leads me to suspect that you've written some code that accidentally sends the class message to an instance, and that your problem is nothing to do with memory management. The important thing to find out is who is sending the message, not what it's being sent to. 1- Adding a breakpoint on objc_exception_throw: brings the debugger on NSApplicationMain... Is this in Xcode 4? Make sure the level of detail slider at the bottom of the debugger view in the navigator pane is all the way to the right. If it's in its default middle position, it often collapses the call stack, misleading you to think the exception was in NSApplicationMain (). ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: UI Design on iPad
Don't give up on UIKit. You will find you can do alot with UIKit. I have used UIKit extensively for several large custom projects with great results. To see the UIKit used to its fullest look at: Disney Second Screen: Tron Edition - http://itunes.apple.com/us/app/disney-second-screen-tron/id426041506?mt=8 Disney Second Screen: Bambi Edition - http://itunes.apple.com/us/app/disney-second-screen-bambi/id417550094?mt=8 Phrase Phrenzy - http://itunes.apple.com/us/app/phrase-phrenzy/id424390323?mt=8 These are all UIKit apps. Tron uses some OpenGL for the pulsing light background for its intro. But all else is pure UIKit. Scott On Apr 20, 2011, at 9:23 PM, Bing Li wrote: Dear all, I am a new developer on iPad. After reading some books about Cocoa and iPad, I notice that the UI supported by Interface Builder is not rich enough. Just some common widgets are available and no interfaces are provided to change their look-and-feel. For example, in some popular UI tools, such as WPF, a button can be customized to different shapes. If I need to have more flexible UI design on iPad, what tools else should I use? Quartz, OpenGL? Any templates or resources are available to reuse? Thanks so much! LB ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Mock the internet
There are a couple of options I have used.. 1.) User your mac's local web server. 2.) MAMP which includes a full Web Server with mySQL. http://www.mamp.info/en/index.html. I use this later a lot for creating and testing custom backend services and client calls locally. Scott Andrew On Nov 8, 2010, at 1:53 AM, Yung-Luen Lan wrote: Hi, I'm writing a framework for web API like flickr. However, I don't want my test failed depending on the server status. (And I don't want it hit the server every time I build my project.) Is there any easy way to fake the network layer? I don't think swizzle the NSURLConnection is enough because the HTTP intermediate framework my project depends use CFNetwork. Conditional compile and mocking the response inside the HTTP intermediate framework is bad since it's not even my code. Any suggestion for this? Regards, yllan ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Difference between NSOperationQueue and NSThread in iOS4?
I'll need to refigure this out becuase we are trying to load/draw a fairly complex page where the scrollview is transparent and there are several composited buttons on a an almost full screen view. I am still curious why this would work on OS 3.2 and not on OS 4 and work like butter. I wonder if the threads operations were scheduled differently or started from the main thread originally. The other place i go this idea was from the advanced iphone projects book. I am not using image views because there was an issue with performance with the number of views and scrolling. Scott On Aug 25, 2010, at 7:22 AM, Michael Ash wrote: On Tue, Aug 24, 2010 at 2:42 PM, Scott Andrew scottand...@roadrunner.com wrote: I have a question that I have been researching but can't find an answer for. I have some iOS 3.2 code using NSOperation this doesn't work using NSOperation but works using NSThread withe detatch thread in iOS4 with the desired effect. My code is basically to create and generate pages for my paged scrollview in the background. Its basically a play on the WWDC picture scroller demo. I however have some almost full screen views we prepare in the background. The code look like: [snip] UI operations are not generally thread safe. While I couldn't find anything specific to UIKit in a quick search on Apple's site (the thread safety guide in the iPhone section still talks about NSWindow and such, doh!), if it's anything like AppKit, there is very little manipulation of views that you can safely do from secondary threads. That it's working with NSThread is pure luck. You need to refactor your code so that all view manipulation happens on the main thread. Mike ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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
Difference between NSOperationQueue and NSThread in iOS4?
I have a question that I have been researching but can't find an answer for. I have some iOS 3.2 code using NSOperation this doesn't work using NSOperation but works using NSThread withe detatch thread in iOS4 with the desired effect. My code is basically to create and generate pages for my paged scrollview in the background. Its basically a play on the WWDC picture scroller demo. I however have some almost full screen views we prepare in the background. The code look like: -(void) tilePages { @synchronized(self) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; CGRect visibleBounds = infoCardScroller.bounds; NSInteger firstNeededIndex = floorf(CGRectGetMinX(visibleBounds)/CGRectGetWidth(visibleBounds)); NSInteger lastNeededIndex = floorf((CGRectGetMaxX(visibleBounds)-1)/CGRectGetWidth(visibleBounds)); currentIndex = firstNeededIndex; firstNeededIndex = MAX(firstNeededIndex-1, 0); lastNeededIndex = MIN(lastNeededIndex+1, [songs count] - 1); // recycle no longer visible pages for (HVInfoCardContainer* infoCard in visibleViews) { if (infoCard.index firstNeededIndex || infoCard.index lastNeededIndex) { [recycledViews addObject:infoCard]; [infoCard removeFromSuperview]; } } [visibleViews minusSet:recycledViews]; // add missing pages. for (int index = firstNeededIndex; index = lastNeededIndex; index++) { if (![self isDisplayingContainerForIndex:index]) { HVInfoCardContainer* container = [self dequeueRecycledContainer]; if (container == nil) container = [[[HVInfoCardContainer alloc] init] autorelease]; [self configureContainer:container forIndex:index]; [infoCardScroller addSubview:container]; [visibleViews addObject:container]; } } [pool release]; } ; } I cached 3 views at most. I basically have the following when the view scrolls: - (void)scrollViewDidScroll:(UIScrollView *)scrollView; { [[NVGlobalQueue sharedNVGlobalQueue] cancelAllOperations]; [[NVGlobalQueue sharedNVGlobalQueue] addOperation:[[[HVInfoCardTileOperation alloc] initWithScroller:self] autorelease]]; } My operations's main is: -(void) main { if (!self.isCancelled) { [self setQueuePriority:NSOperationQueuePriorityVeryHigh]; [scrollerController tilePages]; } } } } On iOS 3.2 i get what i expect. The third view is created and rendered as we scroll to the 2nd one. So i have 3 views in the my scroller full rendered as I scroll to the 2nd one. However, on iOS4 this isn't working I don't get my 3rd one for a few seconds after its scrolled too. However if i change to: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [NSThread detachNewThreadSelector:@selector(tilePages) toTarget:self withObject:nil]; } This works great and scrolls as smooth as butter. I don't mind doing this since there is a check to see if we have to actually create the view (could probably make the tileView call even smarter). But why would this not work over NSOperation on iOS4 but work in 3.2? Going to the main thread isn't an options as it chunks the scroll And no removing the cancelAllOperations doesn't help. Scott Andrew___ 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: detecting touch and hold vs touch in UIButton
You still need that timer. Especially for non 3.2. If you get your touchEnded before your timer is reached it was just a tap. Scott Sent from my iPad On Jun 6, 2010, at 8:54 AM, Alejandro Marcos Aragón alejandro.ara...@gmail.com wrote: Hi Matt, Thanks for your answer. Still, I don't think that solves the problem. It is not just the difference in time what matters. If the user just taps the button, a UISegmentedControl appears, thus this target is in touch up inside. Now, if the user taps and holds, another type of control appears after a delay so this has to be done in touch down (because the user is still holding), and the user should stop holding the button when the new control appears. In your approach, everything is done in the userDidTouchUp, but the tap and hold control should appear even if the user didn't stop holding. If you have a better solution, please let me know, again thanks for your answer. aa On Jun 6, 2010, at 9:35 AM, Matt Neuburg wrote: On Sat, 05 Jun 2010 21:34:48 -0700, Matt Neuburg m...@tidbits.com said: On Fri, 4 Jun 2010 21:16:50 -0500, Alejandro Marcos Arag?n alejandro.ara...@gmail.com said: I've been trying to detect touch and hold vs touch on a subclass of UIButton. I think you want to imitate Listing 3-3 of Event Handling in the iPhone Application Programming Guide, handling the touches yourself. m. Okay, forget that answer. :) If the difference between touch and touch-and-hold is just a matter of how long the time is between the touch down and the touch up, then all you have to do is measure that time: - (void) userDidTouchDown: (id) sender event: (UIEvent*) e { downtime = [e timestamp]; // downtime is an ivar or global } - (void) userDidTouchUp: (id) sender event: (UIEvent*) e { double diff = [e timestamp] - downtime; if (diff 0.2) NSLog(@tap); else NSLog(@tap and hold); } Obviously Touch Down is targeted at userDidTouchDown:. I think you might want to target both Touch Up Inside and Touch Up Outside at userDidTouchUp:. If you mean something more complex and profound by the difference between touch and touch-and-hold, you can probably figure it out from the UIEvent, so you'd do some more complex and profound form of event tracking here. Anyway, I apologize for being hasty and not very clear before. What I was really trying to say was that all your addition and removal of target-action pairs seems unnecessary. m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: detecting touch and hold vs touch in UIButton
I believe the way to do this is to setup a timer on touchDown to fire once after X number of seconds. Your touchUp and touchCancelled should kill the timer if the timer is exists and is not invalidated. If you hit the timer you are being held. When the timer is hit you restart the timer again for the next check. Scott On Jun 4, 2010, at 7:16 PM, Alejandro Marcos Aragón wrote: Hi all, I've been trying to detect touch and hold vs touch on a subclass of UIButton. I basically accomplished that by doing the following: I first add the following when the button is created: [button addTarget:self action:@selector(sourceSelected:) forControlEvents:UIControlEventTouchUpInside]; [button addTarget:self action:@selector(sourceTouchDown:) forControlEvents:UIControlEventTouchDown]; Then in the functions: - (void) sourceSelected:(UIButton*) sender { // cancel request for extended meny [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(sourceSelectedExtended:) object:sender]; ... } - (void) sourceTouchDown:(UIButton*) sender { // give time before performing action [self performSelector:@selector(sourceSelectedExtended:) withObject:sender afterDelay:0.5]; } - (void) sourceSelectedExtended:(UIButton*) sender { // remove action from button [sender removeTarget:self action:@selector(sourceSelected:) forControlEvents:UIControlEventTouchUpInside]; ... ... // give time before performing action [self performSelector:@selector(addSourceAction:) withObject:sender afterDelay:1.]; } - (void) addSourceAction:(UIButton*)sender { // remove action from button [sender addTarget:self action:@selector(sourceSelected:) forControlEvents:UIControlEventTouchUpInside]; } Now, this works fine, but then I thought there must be an easier (and definitely more elegant) way to accomplish the same thing. Can someone through me a line here? Thank you all, aa ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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
iPad animations are backwards for some orintations.
So i have an app that I want to use the curl up UIView animation transition in. however when the iPad his held in either the upside down portrait or upside down landscape (button on right) the transitions are backwards. All controls on the views move however. ___ 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 bring up a keyboard as in UITextField
I did something similar for my IPhone combo box. See http://newwavedigitalmedia.com/?p=79. The source is on GitHub as well at http://github.com/scottandrew/NWPickerField. Sent from my iPad On May 23, 2010, at 12:32 PM, Alejandro Marcos Aragón alejandro.ara...@gmail.com wrote: Hi everyone, I'm trying to reproduce something similar to what happens when the user touches a UITextField. I want a keyboard to show up to half the screen. I created my own xib file with the keyboard, and everything seems to work fine, except that the upper half of the screen is not transparent, and I couldn't find a way to make it transparent after playing with the window opaque and alpha values. Is it possible to do what I want? Thank you all, aa___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Figuring out what's causing redrawing
Just a simple question. Do you have overlapping views going on? If you are overlapping a sibling that is being told to redraw, you will get redraw every time the sibling redraws.. Scott On May 13, 2010, at 12:52 PM, Nick Zitzmann wrote: I've tried searching around but haven't found an answer to this. I have several views that are being constantly apparently needlessly redrawn and I can't figure out why this is happening. How do I catch the culprit that is causing the views to be redrawn? The redrawing is appearing in the usual place, within a call to -[NSWindow displayIfNeeded] in the run loop. I already tried the following: 1. Breaking on -[NSView setNeedsDisplayInRect:], but -drawRect: kept being called anyway, so whatever is causing this is circumventing this method. 2. Observing the value of -[NSView needsDisplay], but the value never changes, and it keeps getting redisplayed anyway. Apparently the value is a perpetual YES... Nick Zitzmann http://www.chronosnet.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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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] How to scroll to UITableView footer view
What about making the rect your view's actual bounds. Something like... CGRect footerBounds = [footerView bounds]; CGRect footerRectInTable = [tableView convertRect:footerBounds fromView:footerView]; [tableView scrollToRect:footerRectInTable animated:YES]; This should scroll to the footer view since you are basing it on the footer view's current bounds after you call endUpdate. If all is added and adjusted. Scott On May 1, 2010, at 8:13 PM, Tharindu Madushanka wrote: Actually this doesn't seem to scroll to footer view :( Following is the code I have, i am continuously adding cells. Now I want to scroll to bottom footer view. Following code doesn't seem to scroll to the most bottom footer view. [tableview beginUpdates]; [tableview insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:(chatMessages.count - 1) inSection:0]] withRowAnimation:UITableViewRowAnimationLeft]; [tableview endUpdates]; if (tableview.tableFooterView) [tableview scrollRectToVisible:CGRectMake(0, tableview.contentSize.height+64, 320, 44) animated:YES]; Tharindu Madushanka ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Help with crash in -[NSKeyValueNestedProperty matchesWithoutOperatorComponentsKeyPath:]
I acutally think i May have found this one.. We had some racing conditions that seems to have been reeking havoc in our heavily threaded code and the KVO we are using.. Scott On Apr 15, 2010, at 6:12 PM, Ken Thomases wrote: On Apr 15, 2010, at 11:03 AM, scottand...@roadrunner.com scottand...@roadrunner.com wrote: Unfortunately i have very little data on what was actually going on before the crash. The crash report itself starts with some important information that you've omitted: the actual nature of the crash. What kind of signal or exception was received? Also, if you can have the reporter check their console log for anything that might have been written just at the moment of the crash, that could be invaluable. Regards, 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: Deleted Ressource folder
If you selected the Also Move To Trash option check the trash can, if it hasn't been emptied.. This is where source control comes in handy. Even if its using git to keep source control local in the project folder. Scott On Mar 14, 2010, at 6:57 AM, Marx Bievor wrote: Hi, I accidentally deleted the Resource folder from the Groups Files list.. I cannot find the xib file anymore.. it must still be there, of course, but how do I get that folder back with its content.. I'm thanks in advance for helping me out. -M___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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
NWPickerField a new iPhone control to share.
I have made a new iPhone control I would like to share. it is NWPickerField a new read only combo box like control for the iPhone. Check out: http://newwavedigitalmedia.com/?p=79 Scott Andrew ___ 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, allKeys and the NSAutoreleasePool
ar is not a member of di. allKeys creates an autoreleased NSArray with the keys values retained in indexes. ar is placed in the auto release pool when it is created in the allKeys call. When you call [autorelease release] the items are freed when you since the pool is released and freed. By the time you call [ar release] the items no longer exist. As Cocoa documentation states all items returned from a message are autoreleased unless otherwise stated in the documentation for the API call. Scott On Sep 3, 2009, at 7:21 AM, Horst Jäger wrote: Hi, yesterday I stumbled upon something strange concerning the autorelease pool. Please consinder the following lines of code: NSLog(@devel); NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init]; NSDictionary *di = [[NSDictionary alloc] init]; NSArray *ar = [di allKeys]; // if ar were a member of di, it would be deallocated here [di release]; // if ar were a constructed and autoreleased, it would be deallocated here [autoreleasePool release]; // but it is not; it is still present NSLog(@ar %i , [ar retainCount]); // adding the following line leads to a crash //[ar release]; NSLog(@/devel); They yield: [Session started at 2009-09-03 13:32:56 +0200.] 2009-09-03 13:32:58.837 KalaHoTi[3180:207] devel 2009-09-03 13:32:58.841 KalaHoTi[3180:207] ar 1 2009-09-03 13:32:58.842 KalaHoTi[3180:207] ar 1 2009-09-03 13:32:58.842 KalaHoTi[3180:207] /devel I dont't unserstand, how ar mgiht be released: 1. If [ar autorelease] were called upon it in nthe process of creation (and so the name allKeys suggests), it were released as soon as the embracing autoreleasepool is. But it is apparently not. 2. If ar were a member of di, it would be deallocated when di is releaed. Apparenly, that isn't the case either. 3. But if you try to release ar yourself, the program crashes. Any explanation? Thanks in advance Horst ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Trouble with NSButtonCell
I think you need to create a subclass of NSButton that uses your cell. Then use setAction and setDoubleAction. Scott On Sep 3, 2009, at 7:41 AM, Dave DeLong wrote: Unfortunately, setDoubleAction: is not a method on NSCell or any of its subclasses (except NSPathCell). Really all the BWToolkit is doing is skinning. As far as I can tell from browsing through the code, it's not actually changing functionality of the controls. Dave On Sep 3, 2009, at 5:33 AM, Reinhard Segeler wrote: Don't know anything about the toolkit you're using, but I would use setAction: for single click and setDoubleAction: for double click,... Hope this helps. Reinhard ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: NSDictionary, allKeys and the NSAutoreleasePool
I could have sworn in either the apple docs (or one of the cocoa books, maybe this board). I maybe thinking of the general rule that you don't own the object until you retain it and its only valid or the within the method that its recieved. My bad. Scott On Sep 3, 2009, at 11:29 AM, mmalc Crawford wrote: On Sep 3, 2009, at 7:56 AM, Scott Andrew wrote: As Cocoa documentation states all items returned from a message are autoreleased unless otherwise stated in the documentation for the API call. The documentation emphatically does not state that. The basic rules are given here: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/2994-BAJHFBGH The rest of the document gives further details. mmalc ___ 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: Generating random numbers
This is not a cocoa question and is a basic C question. The simple solution is to keep a 2nd array of numbers already generated. Sent from my iPhone On Aug 5, 2009, at 3:44 AM, Mahaboob mahab...@newtok.com wrote: I need to produce 15 random numbers between 1 to 16 without repeating any number. I used the code like int i,j; for(i=0;i15;i++){ j =random() % 15 +1; NSLog(@No: %d = %d \n,i,j); srandom(time(NULL)+i); } But some numbers are repeating. How can I do it without repeating the numbers? Thanks in advance Mahaboob ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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 do I extract the int value from an xml node/element?
If this is on a Mac read the documentation for NSXMLDocument. If this is the iPhone check out TouchXML (http://code.google.com/p/touchcode/wiki/TouchXML ). Both have a low level XML parser as well. Scott On Jul 25, 2009, at 11:05 PM, Rick Schmidt wrote: Hi I am trying to extract the value in an XML node/element as an int. Here is a snip of what the xml looks like. BlastOutput_iterations Iteration Iteration_iter-num1/Iteration_iter-num Iteration_hits Hit Hit_num1/Hit_num Hit_idgi|229264291|gb|CP001598.1|/Hit_id Hit_defBacillus anthracis str. A0248, complete genome/ Hit_def Hit_accessionCP001598/Hit_accession Hit_len5227419/Hit_len What I need to get at is the number for Hit_len and others in the file. I know this must be an easy thing to do I just cannot find a simple way to do it. Any ides...? Thanks Rick ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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 do I extract the int value from an xml node/element?
Hit send too soon . For the mac there are ways to get integer values out of the NSElement. I believe TouchXML has the same mechanism, it is a wrapper around libXML2 that mimics NSXML classes on the Mac. If using NSXMLParser you'll need to keep track of where you are at in the file and convert the value the parser:foundCharacters selector is called on your delegate. NSString has an intValue call. I would recommend doing some reading in the Apple documentation on the NSXML classes. Sctt On Jul 26, 2009, at 8:49 AM, Scott Andrew wrote: If this is on a Mac read the documentation for NSXMLDocument. If this is the iPhone check out TouchXML (http://code.google.com/p/touchcode/wiki/TouchXML ). Both have a low level XML parser as well. Scott On Jul 25, 2009, at 11:05 PM, Rick Schmidt wrote: Hi I am trying to extract the value in an XML node/element as an int. Here is a snip of what the xml looks like. BlastOutput_iterations Iteration Iteration_iter-num1/Iteration_iter-num Iteration_hits Hit Hit_num1/Hit_num Hit_idgi|229264291|gb|CP001598.1|/Hit_id Hit_defBacillus anthracis str. A0248, complete genome/ Hit_def Hit_accessionCP001598/Hit_accession Hit_len5227419/Hit_len What I need to get at is the number for Hit_len and others in the file. I know this must be an easy thing to do I just cannot find a simple way to do it. Any ides...? Thanks Rick ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Display csv in a tableView with bindings
If x number of objects in your CSV file represent an object, then parse it by hand and put the data into an object that it represents. For example: Scott Andrew, 40, Computer Programmer These might get parsed into a contact class that has properties name, age, profession. Then the bindings can be mapped to an array of contacts. This assumes that the values represent an object. Of course there are catch 22's that are mentioned else where in this thread. Scott On Jul 24, 2009, at 5:11 PM, gumbo...@mac.com wrote: I need some direction please. I would like to load a csv file and display the contents in an NSTableView. What is the best way to achieve this with bindings? Should the model store the data in an array of arrays (rows and columns) or a dictionary of arrays (keyed columns and rows)? ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Where to release in UIView
There is no difference between initing them in initWithFrame and awakeFromNib. You would release them in the same location. if they need to be around for the life time of the view then release them dealloc. If not call release before you leave awakeFromNib... Scott Andrew On Jul 18, 2009, at 11:09 AM, DKJ wrote: On 18-Jul-09, at 8:50 , Fritz Anderson wrote: You have to release shadingAreas. You alloc'ed it, you own it. Yes, I realise that. What I'm wondering is where to do it, since it's initialised in the awakeFromNib method, rather than in initWithFrame:. The NSDictionary does store the CGMutablePathRefs quite nicely, although the compiler complains about it. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Maybe I've misunderstood something
This all depends on the type of app you are. There are a couple of non 3.0 examples that are good. Rolando uses to show the number of Rolandos are left to be saved, if you are interrupted mid level. Skype shows then number of open conversations. These are two of the non-push non-apple examples that strike me. Sent from my iPhone On Jul 18, 2009, at 7:45 PM, Development developm...@fornextsoft.com wrote: Ok I can add a badge to my application icon on iphone. why? In 3.0 did they make it so that my app could perform tasks when it was not running and I missed the tech note? What is the practical use for this if you are not Apple inc? ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: [Job] Cocoa developer at Skype (Mac/iPhone)
And works very well. I use it when traveling oversees.. Great for making calls from the hotel and attending meetings. Scott On Jul 17, 2009, at 5:29 PM, Alex Kac wrote: Only via the cell network. Skype exists now on the iPhone platform on the App store. Via Wifi. -- CEO WebIS Sent from my phone On Jul 17, 2009, at 7:18 PM, William Squires wsqui...@satx.rr.com wrote: Not sure this'll get anywhere. IIRC, Apple expressly forbids VOIP apps on the iPhone platform... On Jul 8, 2009, at 11:34 AM, Janno Teelem wrote: Hello, Looking for an experienced Cocoa developer to join our Mac and iPhone development team. You will be working on the Mac and/or iPhone versions of Skype. Ideal candidate should be very familiar with application design, user interface implementation and have a strong understanding of Objective-C and Cocoa. Candidate should have demonstrated creative and critical thinking capabilities. Must be self-motivated and able to work well in a team environment. Pre-requisite Knowledge, Skills and Experience: * 5 years of professional software development experience. * Proven track record of delivering complex application software. * World-class skills in Objective-C and Cocoa. * Should have a strong knowledge of multithreaded programming, asynchronous and event driven application design. * Should be well disciplined in the application development processes of requirements analysis, functional spec development, prototyping, implementation, testing, documentation and maintenance. Values: * Goal-oriented. * Fast and effective. * Respectful and honest. * Early adopter of new technologies. * Positive attitude toward working in an environment of frequently changing requirements. Location: Tallinn (Estonia), Stockholm (Sweden), London (UK), so this position is based in Europe. If you're interested or know someone that might be, email j...@skype.net (Ref: COCOA-DEV-EE) or contact me via Skype, username janno_teelem Best regards, Janno Teelem ___ 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/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/alex%40webis.net This email sent to a...@webis.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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: NSData. add 6 bytes to NSData
In all honesty the easiest way is to do it in C. Add a 4 byte variable to the top of your packet header.. When building the packet set it to 0.. That solves your problem of getting data into the packet. But if you want to add something to the beginning, using NSMutableData, you have to first create the NSMutableData packet with 4 bytes of 0s then call [data appendBytes].. So something like so (not perfect).. char bytes[4] = {0,0,0,0}; NSMutableData* data = [NSMutableData withBytes:bytes length:sizeof (bytes)]; [data appendBytes:packet length:sizeOfPacket]; But i think you better way is to just put the 4 bytes at the top of your packet description. When creating you can set it to 0's (first call should be memset in your make packet call to set things to 0). If you are reading the packet from another location you can then put the pointer for the read or memcpy to the location of the first field. NSData is nice but i still think most memory management things (like creating and dealing with buffers) are better in C then thrown into an NSData if needed.. I generally don't use NSData as 1st class citizen for generating buffers. Scott Andrew On Jul 4, 2009, at 9:23 AM, Carlo Gulliani wrote: thanks for your reply, could you show me simple example how to add binary data to existing data and also to add header of 2 bytes i've been trying to use buffer but i have a troubles with result my code: #define PROTO_VERSION_MAJOR 1 #define PROTO_VERSION_MINOR 7 #define PROTO_VERSION u_long)(PROTO_VERSION_MAJOR))16)|(u_long) (PROTO_VERSION_MINOR)) #define PROTO_MAJOR(p) (((p)0x)16) #define PROTO_MINOR(p) ((p)0x) typedef struct mrim_packet_header_t { u_long magic; u_long proto; u_long seq; u_long msg; u_long dlen; u_longfrom; u_longfromport; u_charreserved[16]; } mrim_packet_header_t; #define CS_MAGIC0xDEADBEEF #define MRIM_CS_HELLO 0x1001 structmrim_packet_header_tpacket; packet = [self makePacket:MRIM_CS_HELLO length:0]; NSMutableData *data = [NSData dataWithBytes:packet length:sizeof (packet)]; int c = 4; char buf[c]; [data getBytes:buf]; int i; for (i=20; i[data length]+c; i++) { buf[i] = 0; } data = [NSData dataWithBytes:buf length:[data length]+c]; } -(struct mrim_packet_header_t) makePacket:(unsigned long)key length: (unsigned long)len { staticunsignedlongseq = 2; mrim_packet_header_tmrim_head; //memset(mrim_head, 0, sizeof (mrim_head)); mrim_head.magic = CS_MAGIC; mrim_head.proto = PROTO_VERSION; mrim_head.seq = seq; mrim_head.msg = key; mrim_head.dlen = len; //mrim_head.from = h; //mrim_head.fromport = 2041; seq++; return mrim_head; } so, i found a dump of binary which must to result efbeadde 13000100 0200 0110 0010 0020 but i got efbeadde 07000100 0110 00286930 4cc4 58e4ffbf 36c90091 my data is different of correct data, why? I use the same variables like there ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: NSTableView bug?
I had this problem but it had to do with calculating the height for the row and returning a float value. When i made sure i returned an int this went away. Not sure if you doing that. Scott On Jul 2, 2009, at 7:51 AM, Chris Carson wrote: Hello, I've created a simple application with an NSTableView. I have written a delegate for this table, numberOfRowsInTableView:objectValueForTableColumn:row:, that returns the number of rows in the table when requested. My application uses the table view to display hexadecimal data on a flash memory chip, with 16 bytes displayed per row. As a test, I tried returning a large number for the number of rows, 0x100. When I scroll through the table, everything looks okay for the first 14 million rows or so, after which the gray horizonal cell separator disappears and the row data begins to shift by a pixel per row, until it eventually is superimposed on the row above it. This seems like a bug with the NSTableView class, but perhaps I'm doing something wrong. Has anyone else run into this problem? 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: NSTableView bug?
I was going to recommend 0xED is a good one too. Very fast and he appears to be using a custom view of somesort. Scott On Jul 2, 2009, at 10:21 AM, Jean-Daniel Dupas wrote: I've created a simple application with an NSTableView. I have written a delegate for this table, numberOfRowsInTableView:objectValueForTableColumn:row:, that returns the number of rows in the table when requested. My application uses the table view to display hexadecimal data on a flash memory chip, with 16 bytes displayed per row. As a test, I tried returning a large number for the number of rows, 0x100. When I scroll through the table, everything looks okay for the first 14 million rows or so, after which the gray horizonal cell separator disappears and the row data begins to shift by a pixel per row, until it eventually is superimposed on the row above it. This seems like a bug with the NSTableView class, but perhaps I'm doing something wrong. Has anyone else run into this problem? My 2 cents, If you're looking for a (very) efficient and clean way to display large amount of binary data, have a look at HexFiend. This is the fastest hex editor I know. It's able to handle multi Gbytes files smoothly and without problem (and it's distributed under modified BSD license). http://ridiculousfish.com/hexfiend/ ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to fill rectangle under vertical scroller?
Have you looked at a couple of frameworks that already do this? The two i can think of fare. BWToolkit and HMBlkAppKit. Source is available for both. Scott On Jun 16, 2009, at 9:40 PM, Sumin Kim wrote: That's not part of the scroller. Assuming you're working with NSTableView, this is the cornerView, which you can set up separately. Yes, you are right. I am working with table. Of course I tried to use cornerView. But as far as I understood with my experience dealing with cornerView, it was not I want to handle. I think the cornerView is the upper right corner of the tableView -I mean, above of the vertical scroller- but what I want to fill with my color is right bottom corner, under the vertical scroller. Am I understanding 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Missing something about initialization
A couple of things: You are not retaining your values after retrieved (slot, svn, prn, clock, block). These are auto released and will be released the the next time the pool is cleaned up. (assuming you are not using garbage collection). Not sure what your class is subclassed from, but if not NSObject you want to a call to the super's init (or what ever the designated initializer is). Scott On Jun 12, 2009, at 2:54 AM, Alfonso Ortega wrote: I'm trying to parse a bit of html and use it to initialize an object. I have very little background in objective-c, everything parses correctly, I just can't seem to get the object initialized. What am I doing wrong? -(id)initWithNavcenRow:(NSString *)row { NSScanner *rowScanner = [NSScanner scannerWithString:row]; NSString *svnString; NSString *prnString; NSString *slotString; [rowScanner scanUpToCharactersFromSet:[NSCharacterSet capitalizedLetterCharacterSet] intoString:NULL]; [rowScanner scanUpToString:@/td intoString:plane]; [rowScanner scanUpToCharactersFromSet:[NSCharacterSet decimalDigitCharacterSet] intoString:NULL]; [rowScanner scanUpToString:@/td intoString:slotString]; slot = [slotString intValue]; [rowScanner scanUpToCharactersFromSet:[NSCharacterSet decimalDigitCharacterSet] intoString:NULL]; [rowScanner scanUpToString:@/td intoString:svnString]; svn = [svnString intValue]; [rowScanner scanUpToCharactersFromSet:[NSCharacterSet decimalDigitCharacterSet] intoString:NULL]; [rowScanner scanUpToString:@/td intoString:prnString]; prn = [prnString intValue]; [rowScanner scanUpToCharactersFromSet:[NSCharacterSet capitalizedLetterCharacterSet] intoString:NULL]; [rowScanner scanUpToString:@/td intoString:block]; [rowScanner scanUpToCharactersFromSet:[NSCharacterSet capitalizedLetterCharacterSet] intoString:NULL]; [rowScanner scanUpToString:@/td intoString:clock]; return self; } ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Missing something about initialization
Duh.. Should read the code that says intValue mind went to assignment and didnt finish reading the lines. Scott On Jun 12, 2009, at 11:21 AM, Ken Thomases wrote: On Jun 12, 2009, at 4:54 AM, Alfonso Ortega wrote: I'm trying to parse a bit of html and use it to initialize an object. I have very little background in objective-c, everything parses correctly, I just can't seem to get the object initialized. What am I doing wrong? You're not invoking super's initializer. See here: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocAllocInit.html Cheers, 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Photoshop plugin with Cocoa UI problems
What doesn't make sense is that the plugin i worked on was modal (it was an export plugin). What I noticed in our window does is a call abortModal on the windowWIllClose notification. From what i can see, from the messages in your original post, it looks like you are still in the modal loop. Putting the notification there allows the window to handle when [window close] is called. Scott On Jun 11, 2009, at 9:34 AM, Frederik Slijkerman wrote: Hi Scott, I'm already doing all of that (I studied your earlier post in the message archive), but it looks like the modal window was the problem, see my other message. Thanks anyway! Best regards, Frederik Slijkerman Scott Andrew wrote: Make sure your C function calls NSApplicationLoad() this is needed to initialize Cocoa (including Cocoa runloops) from Carbon. Also make sure you setup your autorelease pool in you plug-in's main entry function. The plug-in I wrote had all objective C except the startup code. Scott Andrew On Jun 10, 2009, at 7:07 AM, Frederik Slijkerman wrote: Hi all, I'm trying to make a Photoshop plugin with a Cocoa user interface, but I'm running into a persistent problem: after closing the plugin window, Photoshop crashes 90% of the time with the following call stack: #00xa04590d8 in _XHNDL_trapback_instruction #10xbf800fac in ?? #20x917ea9a2 in __CFRunLoopDoObservers #30x917ebcfc in CFRunLoopRunSpecific #40x917eccd8 in CFRunLoopRunInMode #50x969f42c0 in RunCurrentEventLoopInMode #60x96aa7904 in GetNextEventMatchingMask #70x96aa7766 in WNEInternal #80x96aa76c5 in WaitNextEvent I've tried every suggestion I could find. The main plugin is a Carbon bundle that locates the Cocoa bundle that actually contains the core plugin as suggested here: http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/ The Cocoa bundle exports a plugin entry point as a C function. The Carbon bundle calls this from its own entry point using CFBundleCreate / CFBundleGetFunctionPointerForName, but it never releases the Cocoa bundle since apparently Cocoa bundles should not be unloaded. The whole idea behind this, as far as I can see, is that Photoshop unloads the Carbon bundle, but does not unload the core Cocoa bundle. Next, the Cocoa bundle calls NSApplicationLoad, displays an empty window using [NSApp runModalForWindow], then closes the window and returns. At this point, I get the aforementioned crash. What am I doing wrong? Any pointers would be highly appreciated -- I've been staring at this for about three days now... Best regards, Frederik Slijkerman ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: re-making connections with a different controller
One other thing to keep things simple.. Take all common functionality and put it into a base view controller class. Then subclass from there for any new controls, functionality, setup, etc. Scott On Jun 10, 2009, at 7:40 AM, Stephen Blinkhorn wrote: On 9 Jun 2009, at 22:44, Quincey Morris wrote: On Jun 9, 2009, at 19:50, Stephen Blinkhorn wrote: If you must use a tab view, you could also approach it with a view xib and a view controller to define the common part of each tab. The view controller would act as an intermediary to pass the action methods on to the correct controller. (The details, and feasibility, of this approach might depend on exactly what class of controllers you're trying to use.) That sounds interesting but will involve a near complete overhaul. Are you sure? Well, yes and no. I'm writing the GUI for a real time audio program. The back end of that is written in C++ which I've written too. The Cocoa UI is getting quite complex now but is nearly finished so I'm a bit reluctant to tear it apart. It is my first real Cocoa project though so I can't assume I've got it all right first time. Moving the contents of the tabs to a different xib file (or is it xib files? are all the tabs identical in appearance?) is straightforward. Connecting the individual controls to the view controller (File's Owner) is straightforward. Writing intermediary action methods in your view controller subclass to pass the actions on the correct controller (held in an instance variable, or set as the representedObject) is straightforward. All my tabs are identical. The current purpose of my controller objects is to map the value from a control onto a nonlinear range. I display the nonlinear value in the UI for user feedback and then pass it to the C++ audio side. There are a number of controls within in each tab(s) which require a custom mapping and differ from controller to controller based on some user selection. Currently I deal with this by dynamically allocating/deallocating a kind of sub controller object of the required type at that time. The only real work happens in (say) your window controller's awakeFromNib method. In that method, you would create as many view controllers as there are distinct tabs, passing the correct action controller object as a parameter, and letting the view controller instantiate its nib. Then, for each view controller, replace the appropriate tab subview with the view controller's view. That doesn't require any design changes anywhere else in your application, AFAICT. It also has the advantage of making your life really easy if you ever have to add one more control to all of the tabs. I know I will be adding and changing things over the next few months so I think it will be worthwhile putting the time in to implement something like this. It isn't so much the tedium of manually connecting things together but the inevitability that a few connections will go astray at some point. I did try something with bindings but it quickly got out of hand for me. Can I make connections programmatically? That might be easier for now. Thanks, Stephen ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: Photoshop plugin with Cocoa UI problems
Make sure your C function calls NSApplicationLoad() this is needed to initialize Cocoa (including Cocoa runloops) from Carbon. Also make sure you setup your autorelease pool in you plug-in's main entry function. The plug-in I wrote had all objective C except the startup code. Scott Andrew On Jun 10, 2009, at 7:07 AM, Frederik Slijkerman wrote: Hi all, I'm trying to make a Photoshop plugin with a Cocoa user interface, but I'm running into a persistent problem: after closing the plugin window, Photoshop crashes 90% of the time with the following call stack: #0 0xa04590d8 in _XHNDL_trapback_instruction #1 0xbf800fac in ?? #2 0x917ea9a2 in __CFRunLoopDoObservers #3 0x917ebcfc in CFRunLoopRunSpecific #4 0x917eccd8 in CFRunLoopRunInMode #5 0x969f42c0 in RunCurrentEventLoopInMode #6 0x96aa7904 in GetNextEventMatchingMask #7 0x96aa7766 in WNEInternal #8 0x96aa76c5 in WaitNextEvent I've tried every suggestion I could find. The main plugin is a Carbon bundle that locates the Cocoa bundle that actually contains the core plugin as suggested here: http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/ The Cocoa bundle exports a plugin entry point as a C function. The Carbon bundle calls this from its own entry point using CFBundleCreate / CFBundleGetFunctionPointerForName, but it never releases the Cocoa bundle since apparently Cocoa bundles should not be unloaded. The whole idea behind this, as far as I can see, is that Photoshop unloads the Carbon bundle, but does not unload the core Cocoa bundle. Next, the Cocoa bundle calls NSApplicationLoad, displays an empty window using [NSApp runModalForWindow], then closes the window and returns. At this point, I get the aforementioned crash. What am I doing wrong? Any pointers would be highly appreciated -- I've been staring at this for about three days now... Best regards, Frederik Slijkerman ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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
NSOutlineView and tags...
This may sound like a newbie questions but never had this issue before.. I am trying to add a tag ID to an NSOutlineView thats in one view controller. In another view controller is a table view. I listen to NSOutlineViewSelectionDidChange notifications and fill the table based on the selection. This listens to all outline views (even the open file panel). So i put a tag id on my NSOutlineView and wanted to check for that particular tag. But it always comes up 0. I have a work around for this by listening for selection changes in the tree controller and firing off a notification based on what was actually selected. I am now just curious about the NSOutlineView and the tag field. I couldn't find anything that said you couldn't tag a outline or table view control. Scott Andrew ___ 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: NSOutlineView and tags...
Chalk this up to me having two copies of the project around and having one of those moments.. Scott On Jun 7, 2009, at 9:47 AM, Keary Suska wrote: On Jun 7, 2009, at 9:54 AM, Scott Andrew wrote: This may sound like a newbie questions but never had this issue before.. I am trying to add a tag ID to an NSOutlineView thats in one view controller. In another view controller is a table view. I listen to NSOutlineViewSelectionDidChange notifications and fill the table based on the selection. This listens to all outline views (even the open file panel). So i put a tag id on my NSOutlineView and wanted to check for that particular tag. But it always comes up 0. I have a work around for this by listening for selection changes in the tree controller and firing off a notification based on what was actually selected. I am now just curious about the NSOutlineView and the tag field. I couldn't find anything that said you couldn't tag a outline or table view control. First off, how are you setting the tag, and what value are you setting? How are you checking the tag (show code)? I haven't heard or experienced any issues with NSOutlineView and tags, but if you have a reducible/reproducible case, you can file a bug. Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: NSTabView; How to get the current / active tab ..?
Why not use unique identifiers for each tab item? Each NSTabViewItem has an identifier value. Using that and some defines you can use do the following: #define GENERAL_TAB 1 #define FONT_TAB 2 NSTabViewItem* tabViewItem = [tabView selectedTabViewItem]; switch([tabViewItem identifier]) { case GENERAL_TAB: NSLog(@1); break; case FONT_TAB NSLog(@2); break; } Scott On Jun 7, 2009, at 11:14 AM, Martin Batholdy wrote: hi, I have an IBOutlet defined in my header; IBOutlet NSTabView *tabView; This Outlet is connected with a TabView generated with Interface Builder. The TabView has two tabs, and in my implementation file I want to do something when tab1 is active and something else when tab2 is active. I tried the following; NSTabViewItem *tabViewItemX; tabViewItemX = [tabView selectedTabViewItem]; if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){ NSLog(@1); } else{ NSLog(@2); } But it doesn't work properly. It is just always 2. What do I wrong? 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: NSTabView; How to get the current / active tab ..?
Duh.. So a bit of correction to my code. #define GENERAL_TAB 100 #define FONT_TAB 101 NSTabViewItem* item = [tabView selectedTabViewItem]; switch ([[item identifier] intValue]) { case GENERAL_TAB: NSLog(@Tab 1); break; case FONT_TAB: NSLog(@Tab 2); break; } } On Jun 7, 2009, at 6:54 PM, Andy Lee wrote: Well, [tabViewItem identifier] returns an id, not an int, but the general idea is probably a good one -- decide your action based on the identifier rather than the position of the tab, in case you decide to rearrange the tabs later. --Andy On Jun 7, 2009, at 9:36 PM, Scott Andrew wrote: Why not use unique identifiers for each tab item? Each NSTabViewItem has an identifier value. Using that and some defines you can use do the following: #define GENERAL_TAB 1 #define FONT_TAB 2 NSTabViewItem* tabViewItem = [tabView selectedTabViewItem]; switch([tabViewItem identifier]) { case GENERAL_TAB: NSLog(@1); break; case FONT_TAB NSLog(@2); break; } Scott On Jun 7, 2009, at 11:14 AM, Martin Batholdy wrote: hi, I have an IBOutlet defined in my header; IBOutlet NSTabView *tabView; This Outlet is connected with a TabView generated with Interface Builder. The TabView has two tabs, and in my implementation file I want to do something when tab1 is active and something else when tab2 is active. I tried the following; NSTabViewItem *tabViewItemX; tabViewItemX = [tabView selectedTabViewItem]; if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){ NSLog(@1); } else{ NSLog(@2); } But it doesn't work properly. It is just always 2. What do I wrong? 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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/aglee%40mac.com This email sent to ag...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Internationalizing Bundle Icon
Its not possible to do.. Its recommended that you don't put text on your application and document icons. Scott On Jun 2, 2009, at 7:27 PM, Richard Holliday wrote: Hi, The new icon icns file for my cocoa application (10.4 +) has text on it which needs to change based on the machine locale. I have localized the rest of the application (strings, nibs) etc. but I’m trying to see if it’s possible to have the finder present a different bundle icon based on the locale. I have two icns files, one in English.lproj and one in en_GB.lproj. It always displays the first one. I suspect this is not possible and am prepared have our designer come up with a new icon design. Any ideas would be appreciated. Thanks, Richard -- Richard Holliday, Senior Software Developer Renaissance Learning - Canada ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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
NSTreeController and CoreData question
I am working on a CoreData project but want some advice on using an Outline View. My relationships are setup like so. They don't have a parent/child entry. The entries more match the read data. Project // just a simple group node will say (targets/sources) in localized languges. TargetGroup (one to one to TargetGroup) SourceGroup (one to one to SourceGroup) TargetGroup Targets (one to may to targets) SourceGroup Sources(one to many to sources). Sources Language Entries (one to many to entries) Target (one to many to targets) Tragets Sources (one to many to sources) I know i have a few options. 1.) Create a generic NSTreeNode subclass the does the right thing based on node type and gets the proper children,parent,etc... 2.) Change my model to a generic children/prarent node type. 3.) Subclass NSManagedObject to do the right thing based on type. 4.) Create a protocol that each object must override to give the proper data. 5.) Use a data source. I think what makes this tricky is that this isn't just a simple one to one relationship and is what is throwing me off. I am leaning towards 1 and 3. I would like to keep this model due to the fact that it represents the real data. I may also be over thinking this a bit.. Any advice would be appreciated. Scott Andrew ___ 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: NSTreeController and CoreData question
I want to hold my heirarchy... And references.. So i don't want to change. I am working on a node wrapper. Scott On May 25, 2009, at 11:28 AM, Shlok Datye wrote: I recently came across some nice sample code on how to use NSTreeController with Core Data. Here it is: http://espresso-served-here.com/2008/05/13/nstreecontroller-and-core-data-sorted/ However, it takes route 2 on your list; the entities have children and parent relationships. Shlok Datye Coding Turtle http://codingturtle.com On 25.05.2009, at 17:38, Scott Andrew wrote: I am working on a CoreData project but want some advice on using an Outline View. My relationships are setup like so. They don't have a parent/child entry. The entries more match the read data. Project // just a simple group node will say (targets/sources) in localized languges. TargetGroup (one to one to TargetGroup) SourceGroup (one to one to SourceGroup) TargetGroup Targets (one to may to targets) SourceGroup Sources(one to many to sources). Sources Language Entries (one to many to entries) Target (one to many to targets) Tragets Sources (one to many to sources) I know i have a few options. 1.) Create a generic NSTreeNode subclass the does the right thing based on node type and gets the proper children,parent,etc... 2.) Change my model to a generic children/prarent node type. 3.) Subclass NSManagedObject to do the right thing based on type. 4.) Create a protocol that each object must override to give the proper data. 5.) Use a data source. I think what makes this tricky is that this isn't just a simple one to one relationship and is what is throwing me off. I am leaning towards 1 and 3. I would like to keep this model due to the fact that it represents the real data. I may also be over thinking this a bit.. Any advice would be appreciated. Scott Andrew ___ 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: NSTreeController and CoreData question
Actually. That makes it alot simpler. There is some selection and addition logic but that should be simple enough.. Like i said i am just over thinking it. Scott Andrew On May 25, 2009, at 8:42 PM, Steve Steinitz wrote: Hi Scott On 25/5/09, cocoa-dev-requ...@lists.apple.com wrote: I am working on a CoreData project but want some advice on using an Outline View. My relationships are setup like so. They don't have a parent/child entry. The entries more match the read data. Project ... Tragets Sources (one to many to sources) I know i have a few options. ... I think what makes this tricky is that this isn't just a simple one to one relationship and is what is throwing me off. I understand everything up to that last sentence. That aside, if you just want to display their names in the outline view and their name attribute has a consistent attribute name (like, say, name :) then each entity could have a children method (for the treeController binding) that returned the relevant objects. Cheers, Steve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
CoreData and NSOutlineView.
I have a question, may know the answer already. I am looking at using core data to store the project for my application I am starting. I want a categorized NSOutlineView that has categories and then children under. The categories just describe the nodes underneath it. They do not not necessarily match 1 to 1 my entities. From what I am seeing on the web it is better that I use a data source for my tree than trying to get bindings to work. Am i missing out on something not using bindings? I have seen also seen that it takes a lot of work arounds to get NSTreeController to work properly with NSOutlineView. This is my first adventure into core data. Scott ___ 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 drawn menus?
Is there any good way to custom draw a menu? Or is the old carbon 'mdef', like the star menu sample, the only way? And will it break in 10.6? Scott ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Custom drawn menus?
Not up for the menu item route. I am looking at just changing the background and shape slightly or the whole menu to match my UI. Scott On Jan 14, 2009, at 1:16 PM, I. Savant wrote: On Wed, Jan 14, 2009 at 4:14 PM, Scott Andrew scottand...@roadrunner.com wrote: Is there any good way to custom draw a menu? Or is the old carbon 'mdef', like the star menu sample, the only way? And will it break in 10.6? You could use a custom view and set it as the menu item's view ... -- I.S. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Which language to get started with cocoa development?
Personally I would say Objective-C. Its not that difficult of a language to learn. If you have learned C++ and C, Objective C is easy enough to learn. I just trained and mentored some window's engineers on an Objective-C project, they had C#, C++ and C expreience. Once they got through the syntax differences and the memory management, they love the language and framework, the tools are a love hate relationship. The Objective-C language, i believe, will run faster than a python or mono app. They require an interpreter for the bit code. They don't compile to native code, i don't believe. Scott On Dec 31, 2008, at 12:22 AM, Achim Domma wrote: Hi, I develop software for a living and want to get started with cocoa development just for fun. I'm good at python, C, C++ and C# and have some Ruby knowledge. Now I'm asking myself, which language I should use to get started with cocoa development: - ObjC looks interesing, but would be a new language to learn. I like to learn new languages, but I also prefer to do one step after another. So learning Cocoa and Obj-C toghether could be frustrating. - I like dynamic scripting languages like python and ruby, but I would like to ship my apps to other users. And they should not care about the language I have used. Can pyObjC or RubyCoca be bundled with my app, so that the enduser will not recognize that python/ruby is shipped with my app? - As far as I understand, GUIs are usually build with the interface builder of XCode. That tools is tuned to be used with ObjC. How good is the integration with scripting languages? - How up to date are bindings to non ObjC languages usually? If I will like cocoa development, I want to have a look at core data and core animations. Are these also available for ruby and python? - What about Mono/Cocoa#? Looks like Mono is not an good option, if I want to distribute my app as small download via the web. Or am I wrong? I would be very happy to hear some opinions of experienced cocoa developers about these topics. Any feedback would be very appreciated. cheers, Achim ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: how to create a CIImage object from a given path safely?
I think the best method to create from a file is imageWithContentsOfURL.. CIImage* image = [CIImage imageWithContentsOfURL:[NSURL urlWithPath:somePath]]; Scott On Dec 21, 2008, at 7:50 AM, Alex.Wang wrote: Hi everyone. As the topic mentioned, I wanted to use a method to create a CIImage object from the given file path neatly, quickly and safely. I have investigated on these field for a while. However, since there are too many methods which can be used to do that, I don't know which one should be the best. Can anyone here give some advice? Thank you very much. Best wishes. -- Best regards. ___ 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/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.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: cString
Depending on you neeeds you can use cStringUsingEncoding: or if you are ok using UTF8 encoded strings -UTF8String. The NSString documentation clearly states this. Scott On Nov 27, 2008, at 11:48 AM, Luca Ciciriello wrote: Hi All.Recently I've installed the new Xcode 3.1.2 and I've removed my old Xcode 2.5.I've compiled with Xcode 3.1.2 (using the optional compiler GCC 4.2) one of the my Objective-C++ project. No problem, but I've got a warning about the code line: string elem = [[[gridArrayObjc objectAtIndex:i] stringValue] cString];The warning is: Warning: 'cString' is deprecated [...]. Well, in which way can I modify my code line in order to eliminate the deprecated cString? Thanks in advance for any answer.Luca.www.mitosrl.com _ Win £1000 John Lewis shopping sprees with BigSnapSearch.com http://clk.atdmt.com/UKM/go/117442309/direct/01/___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to [EMAIL PROTECTED] ___ 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]
Layered back OpenGL view performance on Macbook and Mini
I am looking at using a layered back OpenGL view for my core video rendering. I am using a layered back view so that i can put controls on top of my video. How well does a layered back OpenGL view work on Macbooks and Mini's with the integrated Intel chipsets. I noticed, from the LayeredOpenGL example that you can not fall back to software, it has to be done in hardware. If this isn't going to work i'll go to the transparent window over the OpenGL view. Scott ___ 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: NSView subclass
If its a delegate you would want to check if the delegate handles the selector with respondsToSelector and the use performSelector to make the call. For example if ([delegate respondsToSelector:@selector(pointClicked:)]) [delegate performSelector:@selector(pointClicked:) withObject: [NSValue valueWithPoint:(pt)]]; This should work. I believe the NSValue will resolve to the NSPoint in runtime. Scott Andrew On Oct 15, 2008, at 2:15 PM, DKJ wrote: I've written a subclass of NSView. It calls a method its delegate can implement to detect mouse clicks. I've put something like this in the header file: // delegate method: @interface NSObject () - (void)pointClicked:(NSPoint)point; @end This is enough to prevent a no -pointClicked: method found compiler warning. But is it the best way to do it? dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to [EMAIL PROTECTED] ___ 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: External C function and duplicate symbol
What about using #pragma once at the top of the header file? The other solution is to move the functions to a C file and move just the function definitions to header files. I prefer the second for readability. I usually have a utils.c and a utils.h. I'm not a big fan of function implementations in header files. Scott On Oct 3, 2008, at 4:19 AM, Christian Giordano wrote: Hi guys, I've few functions that I'm keeping on an external .h file. If the header is included in more than a class I get duplicate symbol error. I tried using #ifndef which I use on my C++ classes but didn't bring any luck. I had a look to the various headers in the framework and I saw they use the following sintax: #define VEC_ZERO_2(a) \ { \ (a)[0] = (a)[1] = 0.0;\ } Isn't there a way to achieve the same but having parameters and returns typed? Thanks, chr ___ 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/scottandrew%40roadrunner.com This email sent to [EMAIL PROTECTED] ___ 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]
Core data in private framework.
I have a question. We are designing a private frame work to wrap our data handling. The framework is using Core Data with an SQL back end. However we get errors when loading data if the model file is not included in the application and is just in the framework. I looked through the docs and couldn't find any help. Are there any tricks to having the data model file (.mom) exist in the private framework and not in the application's resources? We would like the data class to be used across applications by just including the framework. Scott Andrew ___ 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]
Calling autorelease on CFAllocated objects?
I have a memory management question. I was looking at the QCTV example on from the quicktime site. It has some code that does the following: ICMCompressionSessionOptionsRef options; .. Do some work .. return (ICMCompressionSessionOptionsRef)[(id)options autorelease]; Can you do this with CoreFoundation allocated things that are not bridged? Scott ___ 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]