Draggable On/Off button
Hi, I need to create a On/Off button similar to that of Time machine's On/Off button(similar one can be seen in Safari-Preferences-Extensions tab also). Is there a Cocoa built-in draggable On/Off button for Mac OS? Thanks, Swetha ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
iPhone Wifi detection and turnoff
Hi All, Is there any way to do iPhone app that turns off wireless to the iphone then turns it back on again on clicking of 2 buttons inside our application. Is there any framework available in iphone SDK to detect current network status and disable and enabling if it is wifi? Thanks in advance. Regards, Sri. ___ 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: Draggable On/Off button
On 26 Nov 2010, at 08:03, Swetha Chinthireddy wrote: Hi, I need to create a On/Off button similar to that of Time machine's On/Off button(similar one can be seen in Safari-Preferences-Extensions tab also). Is there a Cocoa built-in draggable On/Off button for Mac OS? I think the amber framework might supply a suitable control. http://code.google.com/p/amber-framework/ Regards Jonathan Mitchell Developer Mugginsoft LLP http://www.mugginsoft.com___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Objective-C Mind Map Libraries
Try doing a search on github for cocoa, Mac and iPhone apps. Lots of indie Mac devs keep public repositories there. You might also try Bitbucket. Paul Ward Sent from my iPhone. On Nov 25, 2010, at 9:41 PM, Andrew McLaughlin p...@me.com wrote: Thanks Gary... I'll take that as a no. The top links when searching for Objective-c open source gave me zilch. Searching for Gary's suggestion of cocoa open source, wasn't much better. Top link there was essentially a GeoCities page with uncataloged links to apps and frameworks. Far short of SourceForge/FreshMeat. http://www.cocoadev.com/index.pl?CocoaOpen Andrew On Nov 25, 2010, at 1:16 PM, Gary L. Wade wrote: The silence you're hearing is due to people being tired of posting the same comment to another person who hasn't learned how to use a search engine with the words cocoa open source. On 11/25/2010 12:33 PM, Andrew McLaughlin p...@me.com wrote: So I guess there's none? :) Andrew On Nov 22, 2010, at 9:55 PM, Andrew McLaughlin wrote: Hi guys (and gals), I'm new to the Objective-C arena and am still getting my bearings. Besides the amazing set of libraries that Apple provides in the SDK, is there an open source repository elsewhere of Objective-C libraries that can be used in development? Specifically, I'm looking for a SourceForge or FreshMeat type of site that is searchable. I have an app idea that will span, iPhone, iPod Touch, iPad and the Mac OS X Desktop that I would like to development. The main UI for this app will be a Mind Map structure. Nothing quite as crazy/fancy as what Tony Buzan and those folks are doing. Each node of the diagram will need to be clickable, editable and provide for some gestures (under Mac OS X Lion). I'd hate to roll my own if there is something already available. Thanks, 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/pik0%40me.com This email sent to p...@me.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/dssstrkl%40me.com This email sent to dssst...@me.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 redraw a view
On Nov 24, 2010, at 9:50 AM, Artemiy Pavlov artemiy.pav...@ukrpost.ua wrote: I have a view whose drawRect method draws a plot according to a few parameters which are global variables. When I change these variables according to the user input, I want to update that plot, so I need the drawRect method of my view to be called. I tried [self setNeedsDisplay] or [MyView setNeedsDisplay] but this doesn't work. (I assume you're referring to -drawRect: and -setNeedsDisplay:, as the colons are part of Objective-C method names, not separate syntax.) In what way doesn't this work for you? Do you mean that after you make a change, your view isn't redrawn the next time through the run loop? Or do you mean that when you change a property on your view, you expect the view to draw immediately rather than at another part of the run loop? Finally, and to cover all bases, are you changing the property on your view in the main thread, or in another thread? You should just ensure changing properties on your view (or property changes on the data your view is observing) causes the view to invoke either [self setNeedsDisplay:YES] or [self setNeedsDisplayInRect:affectedRect]. Cocoa will generally ensure your -drawRect: is invoked at the right time after that. -- Chris ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
CoreText - CTFrameDraw doesn't draw paragraph's last line
Hi all, I'm trying to solve my CoreText problem with paragraph text drawing. It draws my paragraph perfectly, but it doesn't draw the last line in some cases. I have no idea why. Here's the frame size calculation method ... - (CGSize)sizeThatFits:(CGSize)size { CFRange labelFitRange; CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString( __labelData.attributedString ); CGSize labelSize = CTFramesetterSuggestFrameSizeWithConstraints( framesetter, CFRangeMake( 0, 0 ), NULL, CGSizeMake( size.width, CGFLOAT_MAX ), labelFitRange ); CFRelease( framesetter ); if ( labelFitRange.location != 0 || labelFitRange.length != CFAttributedStringGetLength( __labelData.attributedString ) ) { NSLog( @The whole string doesn't fit. Range: %d.%d != 0.%d, (int)labelFitRange.location, (int)labelFitRange.length, (int)CFAttributedStringGetLength( __labelData.attributedString ) ); } return labelSize; } ... and here's the -drawRect:(CGRect)rect method ... - (void)drawRect:(CGRect)rect { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSaveGState( ctx ); CGContextTranslateCTM( ctx, 0, rect.size.height ); CGContextScaleCTM( ctx, 1.0f, -1.0f ); CGContextSetTextMatrix( ctx, CGAffineTransformIdentity ); CGMutablePathRef path = CGPathCreateMutable(); CGPathAddRect( path, NULL, rect ); CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString( __labelData.attributedString ); CTFrameRef frame = CTFramesetterCreateFrame( framesetter, CFRangeMake( 0, 0 ), path, NULL ); CTFrameDraw( frame, ctx ); CGPathRelease( path ); CFRelease( frame ); CFRelease( framesetter ); CGContextRestoreGState( ctx ); } ... -sizeThatFits: returns numbers like 654.98 x 129.18, etc. I mean not integers. And when I set the UIView (my label) frame to this size, paragraph text is visible, but the last line is not drawn sometimes (some paragraphs have all lines, some of them are missing the last line). I tried everything, even I was trying to ceil numbers before assigning UIView's frame, I removed all string attributes, etc. but nothing helps. Interesting things is, that iOS 3.2.x is much more affected when compared to the 4.2.1 where number of paragraphs (same text as on 3.2.x) without the last line is much lower. Any idea what can be wrong? Regards, Robert ___ 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
[SOLVED] Re: NSFileHandleDataAvailableNotification doesn't clear the [[notification userInfo] objectForKey:NSFileHandleNotificationDataItem]
I have solved the problem while using NSFileHandleNotificationDataItem and the Notification constant NSFileHandleReadCompletionNotification. Am 24.11.2010 um 15:45 schrieb Wolf Stephan Kappesser: Hello, I am trying to connect a chess engine (via UCI) to my obj-c program. For this, I use the async NSFileHandleDataAvailableNotification to read the datas into a string and parse them. The problem is that the NSTask which starts the chess engine uses some old datas which seems to be in a buffer, I can't clear. The effect is that the engine answer to input which is depreciated. I can't determine this behavior. There are someone how knows, were I can get help, or have a solution directly. If need I can send you code snips and log files. Best regards Wolf S. K.___ 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/wolf.st.kappesser%40gmx.de This email sent to wolf.st.kappes...@gmx.de ___ 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: CoreText - CTFrameDraw doesn't draw paragraph's last line
On 26.11.2010, at 14:12, Robert Vojta wrote: Sorry, wrong mailing list, redirecting to coretext-dev ... ___ 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: UI Implications
After having written a couple of simple iPad apps to investigate certain features, I'm now close to being feature-complete on my first serious application. I'm finding that the lack of a standard menu for centralizing actions is the hardest thing to get used to. As a result of that, I've adopted the seemingly reasonable policy of having custom controls or control subclasses respond to gestures and behave accordingly. This leads to a couple of design difficulties: 1) It's not always obvious what kind of UI element or gesture is appropriate (or available) for enabling a specific action, and 2) Any desired gesture has some chance -- not necessarily documented -- of conflict with one used by a standard UI element. (The iOS Human Interface Guidelines are a partial solution but they are incomplete and, by necessity, can't provide fine detail. ) At the coding level, I'm noticing that I'm using notifications far more than I would in a Mac application. In the Mac world, it's likely that an application-specific action will be recognized first by a controller (in the MVC) sense which will coordinate data and view updates in some way. With the iPad, I'm finding it more likely that a lower level object will be the natural recipient of the action and will then need to broadcast its interpretation of that. Not that there's anything wrong with that, though debugging session tend to be less intuitive, but it has required some revisions to my thinking. So far, I've resisted the temptation to replicate Mac menus using UIBarButtonItems and UIPopoverControllers. :-) I don't have any specific questions or problems associated with this but I'm curious about attitudes, techniques, patterns, or tools that others have found helpful going from Mac to iOS.___ 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 redraw a view
On Nov 24, 2010, at 6:50 PM, Artemiy Pavlov wrote: I have a view whose drawRect method draws a plot according to a few parameters which are global variables. When I change these variables according to the user input, I want to update that plot, so I need the drawRect method of my view to be called. I tried [self setNeedsDisplay] or [MyView setNeedsDisplay] but this doesn't work. Is this iOS or MacOS? Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... ___ 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: Radio dial buttons [iOS] -sheesh
On Tue, 23 Nov 2010 10:41:04 -0700, Development developm...@fornextsoft.com said: I can't believe I missed the rotation gesture recognizer. I honestly searched... The Xcode documentation window doesn't do a good job of listing a given class's subclasses. Use the Class Browser, or even better, try AppKiDo, which combines a class browser and documentation display. m. -- matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPad: UI Implications
On Nov 26, 2010, at 9:02 AM, Phillip Mills wrote: I don't have any specific questions or problems associated with this but I'm curious about attitudes, techniques, patterns, or tools that others have found helpful going from Mac to iOS. At a high level, you don't go from Mac to iOS. i.e. you don't attempt to port, clone the UI, etc. Start with a mission statement of what you want to do with the iOS app. Keep it simple. Perhaps start with the mission statement of your Mac version, then trim it down to what makes sense to have in a mobile environment. Then, storyboard your app. Do not even reference your Mac version; think about the best possible ways to provide your features. Trust me, don't get hung up on how the Mac version presents itself. Rethink everything. There is room to share though, but leave that to your business logic. FWIW, here's my setup for all my apps: (1) A set of foundation classes (utilities, common models, etc.). These are shared* between all apps for Mac OS X and iOS. (2) A shell app. There's one for Mac OS X and one for iOS. All apps I write sit upon one or both of these. (3) Business logic for each individual app. These are shared between Mac OS X and iOS. (4) Individual projects for Mac OS X vs. iOS. Here, they sit upon the appropriate shell and reference all common code. Graphical assets, nibs, etc. are then unique to each individual project. * sharing has had its downsides. The original Mac version was baselined to Mac OS X 10.4 (pre Objective-C 2.0). Thus, that set of code isn't yet using things like the newer property syntax. My newer individual projects though do. Also, know that in iOS, there is no GC. So either create dual code to handle both cases (you can then drive things with compile-time macros), or stick with non-GC code everywhere. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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: Scroll/Position Image in Scrollview that is smaller than the Scrollview
On Wed, 24 Nov 2010 12:04:26 +0100, macli...@batchmaker.de (Hado Hein) said: But when the picture is zoomed to a size smaller than the ScrollView the picture is placed in the top left corner and no more scrolling happens. In simple I want to center the small ImageView in the bigger ScrollView so that there is still scrolling possible. Scrolling is possible if the contentSize is larger than the scroll view. If the image view is the scalable view (for zooming purposes), then if it is zoomed smaller than the scroll view, no scrolling is possible. I think you're going to want to embed the image view in a superview, make the superview the scalable view, and adjust the size and position of the image view within that superview yourself. It is possible also to trick the scroll view by removing the transform of the scalable view, but in that case you break the scroll view's idea of how zoomed the content is, so you have to give it new maximum-minimum zoom values to compensate and track the real zoom value yourself. m. -- matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Change duration of a running CAAnimation?
On Thu, 25 Nov 2010 20:40:57 +0200, Oleg Krupnov oleg.krup...@gmail.com said: Is there a way to change the duration of an already running CAAnimation, in order to change its speed? The animation is added explicitly via [layer addAnimation: forKey:] When I try to get the animation with [layer animationForKey:] and call [animation setDuration:], I get an exception that I'm trying to modify a readonly animation. I know I could cancel the current animation and start a new one using the current [layer presentationLayer]'s value as the fromValue, but this is not convenient because my animation is repetitive and after such a manipulation it will start from a wrong fromValue on the next loop. Nevertheless that's what you're probably going to have to do. The +timeOffset+ property may assist you here in starting the new animation in the middle; also, observe that +repeatCount+ is a float (it does not have to indicate an integral number of repetitions). m. -- matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPad: UI Implications
On 2010-11-26, at 11:34 AM, Ricky Sharp wrote: At a high level, you don't go from Mac to iOS. i.e. you don't attempt to port, clone the UI, etc. Actually, I'm going from Mac to iOS at an even higher level: programming style and patterns of object interaction. In other words, this application has no existing Mac equivalent, so porting is a non-starter. :-) Thanks for the tips, tough. If I ever try to create parallel applications, I'll keep those in mind. (No worries about GC. Many years of commercial development using Java has convinced me that GC invites a generally sloppy attitude...or maybe it's just Java that does that. [shrug]) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Change duration of a running CAAnimation?
Thanks Matt! I have already found another solution that worked pretty well: Instead of using the repeatCount property, I set a delegate on the animation and add another animation manually each time the previous one ends (animationDidEnd: finished:). In this way I can fully control the fromValue and toValues of each loop of the animation. On Fri, Nov 26, 2010 at 6:51 PM, Matt Neuburg m...@tidbits.com wrote: On Thu, 25 Nov 2010 20:40:57 +0200, Oleg Krupnov oleg.krup...@gmail.com said: Is there a way to change the duration of an already running CAAnimation, in order to change its speed? The animation is added explicitly via [layer addAnimation: forKey:] When I try to get the animation with [layer animationForKey:] and call [animation setDuration:], I get an exception that I'm trying to modify a readonly animation. I know I could cancel the current animation and start a new one using the current [layer presentationLayer]'s value as the fromValue, but this is not convenient because my animation is repetitive and after such a manipulation it will start from a wrong fromValue on the next loop. Nevertheless that's what you're probably going to have to do. The +timeOffset+ property may assist you here in starting the new animation in the middle; also, observe that +repeatCount+ is a float (it does not have to indicate an integral number of repetitions). m. -- matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
respondsToSelector warning: may not respond
Hi all, I have the following bit in my code: if ([obj respondsToSelector:@selector(setOrdinal:)]) { [obj setOrdinal:value]; } XCode gives a warning that obj may not respond to setOrdinal: which won't be a problem unless something is really screwy. But how do I get rid of the warning? Or do I just live with it? Regards, Mikkel 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Change duration of a running CAAnimation?
On Nov 26, 2010, at 9:07 AM, Oleg Krupnov wrote: Thanks Matt! I have already found another solution that worked pretty well: Instead of using the repeatCount property, I set a delegate on the animation and add another animation manually each time the previous one ends (animationDidEnd: finished:). In this way I can fully control the fromValue and toValues of each loop of the animation. It sounds as if looking at Apple's Metronome example at the start would have helped you here. :) m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/ pantes anthropoi tou eidenai oregontai phusei Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf AppleScript: the Definitive Guide, 2nd edition http://www.tidbits.com/matt/default.html#applescriptthings Take Control of Exploring Customizing Snow Leopard http://tinyurl.com/kufyy8 RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html TidBITS, Mac news and reviews since 1990, 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/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: respondsToSelector warning: may not respond
I should have mentioned that it is declared, but obj can be one of many classes only some of which have setOrdinal: On Nov 26, 2010, at 6:46 PM, banane wrote: declare the method in your header file. -(void)setOrdinal; On Fri, Nov 26, 2010 at 9:08 AM, Mikkel Eide Eriksen mikkel.erik...@gmail.com wrote: Hi all, I have the following bit in my code: if ([obj respondsToSelector:@selector(setOrdinal:)]) { [obj setOrdinal:value]; } XCode gives a warning that obj may not respond to setOrdinal: which won't be a problem unless something is really screwy. But how do I get rid of the warning? Or do I just live with it? Regards, Mikkel ___ 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/banane%40gmail.com This email sent to ban...@gmail.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: respondsToSelector warning: may not respond
You have many options, in rough order of cleanness: A) Declare a protocol that your objects conform to. Make -setOrdinal: @optional B) Do [object performSelector:@selector(setOrdinal:) withObject:value] or use -setValue:forKey: C) Typecast the object to a class that is known to implement -setOrdinal: On 26 Nov 2010, at 17:47, Mikkel Eide Eriksen wrote: I should have mentioned that it is declared, but obj can be one of many classes only some of which have setOrdinal: On Nov 26, 2010, at 6:46 PM, banane wrote: declare the method in your header file. -(void)setOrdinal; On Fri, Nov 26, 2010 at 9:08 AM, Mikkel Eide Eriksen mikkel.erik...@gmail.com wrote: Hi all, I have the following bit in my code: if ([obj respondsToSelector:@selector(setOrdinal:)]) { [obj setOrdinal:value]; } XCode gives a warning that obj may not respond to setOrdinal: which won't be a problem unless something is really screwy. But how do I get rid of the warning? Or do I just live with it? Regards, Mikkel ___ 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/banane%40gmail.com This email sent to ban...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net This email sent to cocoa...@mikeabdullah.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: respondsToSelector warning: may not respond
On Nov 26, 2010, at 12:27 PM, Mike Abdullah wrote: C) Typecast the object to a class that is known to implement -setOrdinal: D) Typecast the object to id. 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: respondsToSelector warning: may not respond
Z) ignore the warning On Fri, Nov 26, 2010 at 9:44 PM, Ken Thomases k...@codeweavers.com wrote: On Nov 26, 2010, at 12:27 PM, Mike Abdullah wrote: C) Typecast the object to a class that is known to implement -setOrdinal: D) Typecast the object to id. 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/jjalon%40gmail.com This email sent to jja...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: respondsToSelector warning: may not respond
On 26 Nov 2010, at 21:38, Julien Jalon wrote: Z) ignore the warning Z^Z) ignore that Regards Jonathan Mitchell Developer Mugginsoft LLP http://www.mugginsoft.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: respondsToSelector warning: may not respond
I always take the protocol route. You can implement other methods and do a single cast to NSObject nameOfProtocol* (or idnameOfProtocol if you don't need the NSObject methods) and then just pass around that. All you have to check for in instantiation is that it passes implementsProtocol: and then you're set. After that, not only do you typically have the ability to forgo these warnings (they won't appear) but so long as you import the protocol header, XCode will implement code completion for the protocol, which is nice. I use protocols for internal classes for pull-up refactoring, too. After creating and requiring the protocol in the object, if you change the controllers, all you have to do is change the method name in the protocol. XCode will throw warnings in all the places that the method should -but isn't- implemented. Dave On Nov 26, 2010, at 10:27 AM, Mike Abdullah wrote: You have many options, in rough order of cleanness: A) Declare a protocol that your objects conform to. Make -setOrdinal: @optional B) Do [object performSelector:@selector(setOrdinal:) withObject:value] or use -setValue:forKey: C) Typecast the object to a class that is known to implement -setOrdinal: On 26 Nov 2010, at 17:47, Mikkel Eide Eriksen wrote: I should have mentioned that it is declared, but obj can be one of many classes only some of which have setOrdinal: On Nov 26, 2010, at 6:46 PM, banane wrote: declare the method in your header file. -(void)setOrdinal; On Fri, Nov 26, 2010 at 9:08 AM, Mikkel Eide Eriksen mikkel.erik...@gmail.com wrote: Hi all, I have the following bit in my code: if ([obj respondsToSelector:@selector(setOrdinal:)]) { [obj setOrdinal:value]; } XCode gives a warning that obj may not respond to setOrdinal: which won't be a problem unless something is really screwy. But how do I get rid of the warning? Or do I just live with it? Regards, Mikkel ___ 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/banane%40gmail.com This email sent to ban...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net This email sent to cocoa...@mikeabdullah.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/zwerdlds%40gmail.com This email sent to zwerd...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTask with unzip
Hi, I can properly unzip a zip file launching a NSTask with /usr/bin/unzip The task saves the unzipped file to the disk, then a I read the unzipped file in a NSData. Well. My question is: Can I do the same job without saving the unzipped file to the disk? I have tried to set the standard output to a pipe - which works well with other tasks - but here it doesn't work. The task never exits. Here's the wrong code: NSTask *unzip = [[[NSTask alloc] init] autorelease]; [unzip setLaunchPath:@/usr/bin/unzip]; [unzip setArguments:[NSArray arrayWithObjects:@-p, zipfile, @filetounzip, nil]]; NSPipe *aPipe = [NSPipe pipe]; [unzip setStandardOutput:aPipe]; [unzip launch]; [unzip waitUntilExit]; if([unzip terminationStatus] == noErr){ dictData = [NSMutableData data]; while((dataOut = [aPipe availableData]) [dataOut length]){ [dictData appendData:dataOut]; } } -- Leo ___ 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 redraw a view
Hi all, sorry for a late reply, my e-mail was in moderation queue for almost a day, but I was able to find an answer in a few hours after I sent it. This did the trick for me, all is working well now: [super setNeedsDisplay:YES] P.S. This is in Mac OS X. On 26 Nov 2010, at 17:52, Uli Kusterer wrote: On Nov 24, 2010, at 6:50 PM, Artemiy Pavlov wrote: I have a view whose drawRect method draws a plot according to a few parameters which are global variables. When I change these variables according to the user input, I want to update that plot, so I need the drawRect method of my view to be called. I tried [self setNeedsDisplay] or [MyView setNeedsDisplay] but this doesn't work. Is this iOS or MacOS? Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... ___ 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
Video player dead?
Hey list, I just updated to 4.2.1 on my iPad 3G after have been on 4.2 gm and 4.2b gm. At this point, my video player no longer plays. When I start it, all I get is a black screen. Anybody else getting this now? I hooked up to Xcode and opened the Organizer. Looking at the Console panel, I see the following series of errors reported when I load the app: Fri Nov 26 23:54:35 iPad-3G com.apple.mediaserverd[18] Notice: vxdDec - Frame# 1, DecodeFrame failed with error: 6 ... Fri Nov 26 23:54:35 iPad-3G com.apple.mediaserverd[18] Notice: vxdDec - Frame# 201, DecodeFrame failed with error: 6 So, sounds like I have a corrupted video? Too bad, these are all iTunes U stuff... :P Anybody seen this? 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