Detect missing 'commitAnimations' - iphone

Something weird is happening to my views all of a sudden (resizing a UITableView results in strange flying header sections) and I have a feeling I'm missing a '[UIVIew commitAnimations]' somewhere in code. When I add this line into 'viewForHeaderInSection', the weird behavior stops.
Question is, how can I find animation blocks with missing 'commitAnimations' statements? I've given the code a manual look and couldn't find anything. It's also a huge project and I can't see where something might have gone wrong. Please help!

Command+Shift+F ("Find in Project") and type "[UIView beginAnimations" with the "contains" option and you should be able to find all of the instances in your project where the [UIView commitAnimations] should be.

Related

How do I customize a JSlider to have a larger "thumb"?

I have a Java GUI that I'm developing and I've run into a snag with regard to the default size of the "thumb" on a JSlider I need for user input for the simple and unavoidable reason that the application has to run on a touch-screen, there is no mouse, and the precision of the touch of a finger is just not good enough to make it easy to "get a grip" on the slider to move it. The touch screen is all there is... it just isn't that precise.
NO PROBLEM, I thought! I'll just customize it and make the "thumb" bigger! In doing my research I found this previously asked question, and it has what looks like helpful data, but I couldn't figure out how to get that to work. In the answers to that question it points to this page where it purports to show how it's done, but ... it then doesn't show it?!
I guess they presume you know what to do with the likes of:
Slider.thumbHeight Integer
Slider.thumbWidth Integer
But, I don't! Anybody got any code snippet of an example?
I played around, incompetently, with stuff like this that I really don't quite understand:
UIDefaults defaults = UIManager.getDefaults();
defaults.put("Slider.thumbHeight", 45);
defaults.put("Slider.thumbWidth", 15);
...With no success, though it does compile just fine. I tried creating the slider after this. Nope. I tried mySlider.updateUI(); Nope. And, of course, this won't compile at all: mySlider.thumbHeight(40); ...I just don't quite grock how one is supposed to customize these things.
Thanks in advance.
Old post I know, but still may be relevant for others anyway.
"Slider.thumbHeight Integer" just tells you that the variable is of type integer and thus expects a whole number as an argument when you set it.
You have to change the UIdefaults (as in your example) before you create the JSlider.
This said it seems to be operating system dependent whether it works or not. It worked well on my Windows10 PC but not on Raspbian Linux where I really needed it :-(

Explanation of JavaFX Table View Cell Renderer?

I am very curious about an example that I am trying to imitate in my own code. My own code isn't working yet and I'm confident that it is because I don't understand the example very completely. Unfortunately, the person who prepared the example didn't bother to explain it in much detail either. I was wondering if someone could walk me through each of the three classes - especially the part in Main.java that involves setCellFactory() and setCellValueFactory() - line by line and explain what exactly is going on?
This is a link to the example:JavaFX8 – Render a DatePicker Cell in a TableView
The code clearly works as it is; I've run it myself and satisfied myself that it works. I've run it in Debug mode of Eclipse also but don't really understand what I'm seeing. I was hoping someone could explain it line by line. With a bit of luck, that will "make the penny drop" so that I can see what I am doing wrong.
Or can someone suggest a better approach to understanding why the example works but my code doesn't?

How can I take something in then out in Eclipse?

I have been looking for a way to pull something out of my main method into a outer method then plop the output of the outer method back into the main method (this is in Eclipse).
I have been looking for a strangely long time for a answer for this but everything seems way more advanced than what I am looking for. If anyone can help it would be a great help.
You want the extract method refactoring. Select the code block that you want move into a different method and press Shift-Ctrl-M. Or is it Ctrl-Alt-M? Can't remember right now.
And here I go giving refactorings to someone that doesn't even know what a method is....

Providing un-intrusive messages on an iPhone

This is kind of a silly question, but I cannot find the answer as I don't know the terms with which to search for it.
I am looking for a simple way of giving a 'status' message like 'Data updated' to the user without necessarily interrupting what he/she is doing (but have a option I guess in some instances to tab it an perform an action).
For example; some Apps give a rounded square semi-transparent with 'Lock screen/rotation' when an iPhone is rotated, I am look for something similar (or like the square box 'Build Complete in Xcode 4').
Is there an easy way of doing this?
Thanks a million in advance!
https://github.com/myell0w/MTStatusBarOverlay
MTStatusBarOverlay adds very subtle text to the phone's status bar. If you're looking for something a little more noticiable, try:
https://github.com/jdg/MBProgressHUD
As #kubi has pointed out, MTStatusBarOverlay is a good one, and I've passed Apple reviewer inspection with it. However I just found something that looks fraking awesome...
Tweetbot-Like Alert Panels (Blog), and the repository is MKInfoPanelDemo at Github.
Create a view that shows your message nicely, add it to the window, and start a UIView animation which makes it fade away. In the animation ended handler (delegate or block) remove the view.

Why does the codeSense feature of Xcode only work sometimes?

For example, when I type
[UIView commitAni
then I would expect that it finishes it like:
[UIView commitAnimations
so that I have:
[UIView commitAnimations];
but here, it doesn't. Although I have included CoreGraphics.framework
Strange: When I try with other animation related stuff, it works:
[UIView setAnimationDura
will be completed to:
[UIView setAnimationDuration:<#(NSTimeInterval)#>
But this one will not be recognized by codeSense:
[UIView setAnimationTr
...here, I would expect an completion to
[UIView setAnimationTransition
but it doesn't happen. What could be the problem here?
I don't think that I miss an included framework, because everything compiles well and works in the iPhone simulator.
This appears to be a conflict between the static code analysis tools (Clang) and CodeSense. See
http://www.openradar.appspot.com/7338181
I turned off the "Run Static Analyzer" build setting and clicked on the "Rebuild Code Sense Index" under general and it solved the problem for me. However, I want static code analysis too.
Is that the (I'm assuming you haven't changed the keybindings, for simplicity) Cmd-. "give me the next completion" or Cmd-, "give me the completion menu", or the "wait until something turns up and hit return"? I've often seen the last of those fail to give me the completion I want, where Cmd-, will show the correct option.
Usually, when codeSense doesn't give me a correct completion I type ESC for displaying all possibilities and I choose the one I want.
When codeSense answers: No completion found, most of the time there is a typo in the object declaration or a missing ; or ) or ] somewhere near the completion request.
It sounds like you've probably already tried this, but whenver I get an unresponsive codesense, I save all the files I recently added imports to. It seems like saving the file updates the codesense scope for the newly referenced items.
Just upgraded to xcode3.1.3 with iphone 3.0 sdk. Codesense wont autocomplete for simple things like UIScreen mainScreen. its able to find only UIScreen main(). I've tried rebuilding the index several times and no luck.