I am trying to customize user experience from the plugin I am working on, my goal is to provide a kiosk style using the options available in COCOA NSApplication, the code is like following:
// Hide the dock tile and the menu bar:
NSApplicationPresentationOptions options =
NSApplicationPresentationHideDock + NSApplicationPresentationHideMenuBar;
[NSApp setPresentationOptions:options];
I have tested this code using a normal cocoa application and it works fine but when I embed this code in a function inside a "Firebreath PlugIn" nothing happens although the firebreath builds correctly and the other functions I have works normally.
some ideas? this is about system security restrictions maybe?? if so how to enable it? I don't know why this doesn't work if other cocoa functions works fine.
I am developing over Mac OS X Lion with XCODE 4.2
My guess is that you can't get tot he NSApplication because you are in a different process; you might be able to create a fake one or something like that with a new NSWindow to make it work, but since you're in a different process from the browser there is no way to access the browser's NSApp or other similar objects.
Related
I created a simple application using Xcode 7 Beta 2. The application simply contains class MyAppDelegate, MyViewController, MyMain.storyBoard and MyLaunchScreen.storyboard. After recompiling the application with Xcode 7 Beta 4 the error "Launch screens may not set custom classnames" appears. Any suggestions?
Note that the launch screen is not a fully customizable view controller. You cannot specify a custom class name in the storyboard and expect the system to give you the option to execute code at this stage by calling viewDidLoad. Remember, the app hasn’t launched yet.
Launch Screen Constraints
The system loads the launch screen file before launching the app which creates some constraints on what it can contain (some of which may force you back to static image files):
The app is not yet loaded so the view hierarchy does not exist and the system can not call any custom view controller setup code you may have in the app (e.g. viewDidLoad)
You can only use standard UIKit classes so you can use UIView or UIViewController but not a custom subclass. If you try to set a custom class you will get an Illegal Configuration error in Xcode.
The launch screen file can only use basic UIKit views such as UIImageView and UILabel. You cannot use a UIWebView.
If you are using a storyboard you can specify multiple view controllers but there are again some limitations. For example you can embed view controllers in a navigation or tab bar controller but more complex container classes such as UISplitViewController do not work (at least not yet).
Localizing the launch screen file does not currently seem to have any effect. The base localization is always used so you will probably want to avoid text on the launch screen.
You cannot specify different launch screen files for iPad and iPhone. This may be a problem if you have significantly different interfaces for those devices as there is only so much you can do with auto layout and size classes.
If you are deploying to iOS 7 you will still need to include the static launch image files. You can include both a launch screen file and static launch images. Devices such as the iPhone 6 running iOS 8 will use the launch screen file whilst iOS 7 devices will fallback to the launch images.
For more details please click here
This is a simple answer, but something I did and didn't even know it. I think with iOS 7, there is now a main.storyboard and a launchscreen.storyboard. I was unwittingly trying to build my initial functional screen on the launch screen.storyboard. That's a no no.
Hope this helps and happy coding!
Go through your View Controllers in Main.storyboard and make sure you don't have one that is both set to a custom class:
and has "Is Initial View Controller" checked:
You can only do one or the other. Somehow I had "Is Initial View Controller" still checked by mistake, and it took me a while to hunt that down!
I recently created an app using the Xcode 8 beta but couldn't submit it to the app store using the beta software. I had the same error message: "Launch screens may not set custom classnames" and several other.
My solution: Go to the File Inspector of the Main Storyboard and deselect the Use as Launch Screen option. Simple, right? Hopefully this works for you too.
Here's an image of what to look for
Is there a way to get an NSWindow reference from its id from an AIR extension?
I am making an Adobe Air app which is supposed to stay always on top. It is for kids so you can give a computer to them and they can't exit the app. The problem is that the default "alwaysOnTop" property of air applications doesn't work. What I am planning to do is use a native extension to get the Air window id and then try and set the level. I've already checked with the accessibility API but apparently there is no way of doing it that way. I could be wrong, though.
I found a way. Just use the global NSapp variable to get the main window from inside an Air native extension. Then call setLevel on that window and that's it.
Is the semi-transparant notification window which XCode 4 shows on Snow Leopard and on Lion a standard Cocoa control or is it something custom? I've seen more and more apps with similarly styled popups, and don't want to go about reinventing something if a much cleaner implementation exists in Cocoa. If this is a standard control, could someone tell me the name or point me to the documentation for it?
This is the popup window I am referring to:
This is custom but Matt Gemmell has sample code at http://mattgemmell.com/source. It's called RoundedFloatingPanel.
At the moment I am experiencing a really weird behavior of my Mac App.
On my Mac (and on all other testing Macs) everything works fine. The app simply works, no leaks,...
BUT on all the review Macs (Yes, on all) it fails: First the launch failed and now, after submitting it more times and trying to workaround the bug, it does not get initialized: Icons that should get loaded dynamically are not shown.
WHY?! Perhaps anyone has made experiences with such a problem because I cannot test it. I try to find the issue but it's nearly impossible.
[EDIT]
App Information:
My app should list all the currently running applications and display them in some way. It reads no files, only the NSUserDefaults to setup itself.
Structure:
appDidFinishedLaunching setups basic stuff like global hotkeys, loads the NSUserDefaults and finally forwards the message to the subclassed main window (<- There is the problem).
There it should load its interface which does not work on review Macs.
I was able to "override" or "fix" this by a little, dirty code snippet but it does not fix the main problem:
//AppDelegate.m
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self performSelector:#selector(didLaunch) withObject:nil afterDelay:0.5f];//<- THIS does the trick, so that the app launches and shows the static content of the NIB, but NO dynamic content is displayed: exactly the same nib state
//Register hotkeys, load NSUserDefaults,
[mainview launched];//<- Here is the problem
finishedLaunching=1;//global var
}
-(void)didLaunch//Launching works
{
if (finishedLaunching==0) {//=0 because of the review results
//Does all the stuff that [mainview launched]; is supposed to do: Display window and setup position
//Calling methods included in main view does not work (OR the window is not refreshed
//so the first start finally works, but the interface is EMPTY, only static content visible
}
}
Does the setup not happen because it is done in its subclassed window?
Why does it work on my Mac (and another Mac mini)?
Do you know why this happens, a way how to correct it or how to reproduce the bugs?
I really need your help and appreciate every tip!
I'm new to cocoa app dev, and I'm searching a solution to create a windows like the tweetie main windows with a left tool bar and a panel that point to the selected icon.
like this screenshot : http://i.stack.imgur.com/qvxWu.jpg
could anyone help me?
It's likely that a lot of the Tweetie UI is implemented using custom controls. You'll want to look into subclassing NSView and how to handle drawing and mouse events. There's nothing built into the Cocoa framework for this.
The NSView documentation has info on view programming, drawing, and event handling. If you're new to Cocoa, you may want to start off with something built in, though, as this will be a lot of work (and requires a pretty good understanding of how the framework works).