Re: warning: 'NSEntityDescription' may not respond to
The compiler only knows about methods declared somewhere or the headers, and Core Data accessor methods are handled at runtime and not declared anywhere. It's only a warning and not an error because the compiler is smart enough to know that Objective C can do cool stuff like that. One solution is to use [managedObject valueForKey:@memo] and [managedObject setValue:@test123 forKey:@memo] instead of the accessors. -Pete On May 30, 2008, at 5:17 AM, Steven Hamilton wrote: Hi folks, I have a custom datasource that does a fetch from Core Data. My entity has a property in it called 'memo'. When I enumerate the returned array to check the results I get the following warning. warning: 'NSEntityDescription' may not respond to '-memo' The fetch appears to work ok and I can use the data returned no problems but I don't like warnings I don't know as it may mean somethings going to bite my bum later on. Any clues? Also, any warnings or errors I get in xcode appear twice in the bubbles. Anyone know why that is? ___ 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/pete %40glossysheep.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: Which framework for Wifi?
On May 27, 2008, at 11:28 PM, J. Scott Tury wrote: And in 10.5.2 the -x command line option does not work at all Hrm... That's odd and disturbing. But not *quite* true. :) I'm using 'airport -x -s' in my little network jumper app to list networks in range, which--I just checked--*does* still give XML plist output in 10.5.2. So it's not completely gone. But like you say, the -x flag seems to be gone for everything else now. I hadn't noticed that. (Was it ever there? I can't remember ever playing with it although I'm sure I must have.) *Sigh* The wonderful world of hacking around where you're not welcome. -Pete ___ 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: Which framework for Wifi?
There is a private command line utility at the path: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/ Current/Resources/airport Calling it with NSTask works. If there's a better way I'd love to know it. It will give XML output with the right flag (-x) so it's quite useable. You can use it to check network signal levels and get a list of visible networks, you can join networks, create WPA keys from passwords, restore user settings (which never quite works, when I do it), etc. All the documentation that I know of that exists for this utility can be found by calling it with the -h flag: -z--disassociate Disassociate from any network -i[arg] --ibss=[arg] Create IBSS -x--xmlPrint info as XML -s[arg] --scan=[arg] Perform a wireless broadcast scan. Will perform a directed scan if the optional arg is provided -rarg --repeats=arg Repeat the command the specified number of times -A[arg] --associate=[arg] Associate to network. Will prompt for network name if arg is not specified and if necessary, for a password if the network is using WEP or WPA. The following additional arguments may be specified with this command: --bssid=arg Specify BSSID to associate with --password=arg Specify a WEP key or WPA password -I--getinfoPrint current wireless status, e.g. signal info, BSSID, port type etc. -Parg --psk=arg Create PSK from specified pass phrase and SSID. The following additional arguments must be specified with this command: --ssid=arg Specify SSID when creating a PSK -c[arg] --channel=[arg]Set arbitrary channel on the card -h--help Show this help Which is to say, there's no real documentation that I know of. -Pete On May 27, 2008, at 6:25 PM, Howard Shere wrote: Which Apple framework would I use to interact with the wireless settings? I need to be able to get a list of the current visible networks, change networks, etc. from within my app. Howard Shere http://www.livejournal.com/users/realgreendragon/ Altair 8800a to Mac OS X so far... ___ 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/pete %40glossysheep.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: NSWindow CoreAnimation Delegate not being called
I'm no core animation expert, but. This... // self is an NSWindow instance CAAnimation *anim = [CABasicAnimation animation]; [anim setDelegate:self]; [self setAnimations:[NSDictionary dictionaryWithObject:anim forKey:@frame]]; [[self animator] setFrame:NSMakeRect(0,0,0,0) display:YES]; ... works perfectly in my app, calling the delegate methods and all. All other things being equal, the only difference I see is that you use [window animationForKey:@frame] whereas I create a new animation and then add it to the window with [window setAnimations:...]. My *guess* would be that maybe windows don't instantiate default animations until they're needed, whereas frames instantiate them at init. So when you call [window animationForKey:@frame] you're getting nil back. But that's just a guess. I really don't know enough about it. Bug? Feature? I don't know. But this could be a workaround, anyway. -Pete On May 24, 2008, at 7:11 AM, Milen Dzhumerov wrote: Hi all, I've been playing with CA and I tried to set up one my objects as the delegate for the frame change animation for an NSWindow by using the following code: CABasicAnimation* anim = [window animationForKey:@frame]; anim.delegate = self; [[window animator] setFrame:NSMakeRect(400, 500, 500, 500) display:YES]; Using this, the window correctly animates but the delegate methods (namely animationDidStop:finished: and animationDidStart:) for the CAAnimation do not get called. When I use the exact same piece of code for setting the delegate of view animations, the delegates do get called. Thanks, 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/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
NSTextField will not become editable in a borderless window
When I add an NSTextField to a borderless window, nothing I do will make it editable. Specifically, running the code below, the text field just won't work. (I've tried it with all backing types, BTW.) NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(300,300,300,300) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; NSTextField *field = [[NSTextField alloc] init]; [field setEditable:YES]; [window setContentView:field]; [window makeKeyAndOrderFront:self]; But change the styleMask to NSTitledWindowMask and it works as expected. What am I missing? Is it impossible to do this for some reason? On the subject of NSBorderlessWindowMask, the docs give the rather opaque guidance, Useful only for display or caching purposes, as if a window was useful for anything other than display. Is there some other, better way to create a completely custom window? I'm running 10.5.2, if that matters. Thanks, Peter Burtis ___ 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: NSTextField will not become editable in a borderless window
Thanks Robert and Graham. FWIW, the one that finally did the trick was overriding canBecomeKeyWindow to return YES, which makes a lot of sense in hindsight. For whatever strange reason, nothing else suggested worked. (This is all happening on a CoreAnimation layer, BTW, which may well be throwing a few extra curveballs into the mix.) Now, overriding canBecomeKeyWindow seems to be wreaking havoc with my mouseEntered and mouseExited code, and the focus ring isn't drawing anywhere near properly, but those are other bugs for other nights- turned-mornings. :) Thanks again for the help, Peter Graham Cox: Me again ;-) It just occurred to me - have you tried the following overrides in NSWindow?: - (BOOL) canBecomeKeyWindow { return YES; } - (BOOL) acceptsFirstResponder { return YES; } - (BOOL) becomeFirstResponder { return YES; } - (BOOL) resignFirstResponder { return YES; } Borderless windows are set up to return NO in these cases by default, so these overrides are necessary to force it back into the land of the living. If the text field now works, but shows the inactive appearance, THEN try the active hack. G. On 22 May 2008, at 10:47 pm, Graham Cox wrote: Found it just after I posted: - (BOOL) _hasActiveControls { return YES; } Also, while this works to show an active *appearance* for buttons, pop-ups and so on, I've never tried it with text fields. It's a quick thing to try though. It would be useful for Apple to provide a properly supported way to do this, to allow pop-up controls though perhaps the new view-in-a-menu-item mechanism will do that now. hth, G. On 22 May 2008, at 10:40 pm, Graham Cox wrote: Peter, I've run into something similar and I think it has to do with the window server not making a window active (i.e. main and key) if it has the borderless attribute. The workaround I ended up using was to override a private undocumented NSWindow method which controls use to query the active state of the window, to always return YES. Unfortunately I've dug through a mountain of code but can't find where I used it. Someone else may remember this trick and help me out... of course, it's not a great solution but it works from 10.3 through 10.5 so far... G. On 22 May 2008, at 10:13 pm, Peter Burtis wrote: When I add an NSTextField to a borderless window, nothing I do will make it editable. Specifically, running the code below, the text field just won't work. (I've tried it with all backing types, BTW.) NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(300,300,300,300) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; NSTextField *field = [[NSTextField alloc] init]; [field setEditable:YES]; [window setContentView:field]; [window makeKeyAndOrderFront:self]; But change the styleMask to NSTitledWindowMask and it works as expected. What am I missing? Is it impossible to do this for some reason? On the subject of NSBorderlessWindowMask, the docs give the rather opaque guidance, Useful only for display or caching purposes, as if a window was useful for anything other than display. Is there some other, better way to create a completely custom window? I'm running 10.5.2, if that matters. Thanks, Peter Burtis ___ 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/graham.cox%40bigpond.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/graham.cox%40bigpond.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/graham.cox%40bigpond.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]