I was wondering which would be faster/more efficient when it comes to taking off annotations from the map: hiding or removing. I need to remove and add 100 or so pins every time the user zooms in or out.
I can either loop through and hide all annotations using setHidden:, or just remove them using removeAnnotations:. I'm not sure which would be a better method.
I believe the standard method is to remove them. Less memory overhead. Not that 100 takes up that much, but still better to remove and re-add when needed then to hide.
Related
I'm writing a logging application which is using a QListView with custom QStandardItems to display the log data. I have implemented filters in the app that will color the matching rows differently and when changing a filter I have to manipulate every item in the list, which after a while gets very slow. I'm not sure what's causing this yet, but I wonder if it could be that it repaints after every item change. If that is the case, could I somehow tell QT to not repaint until I'm done manipulating all the items?
Thanks for any help!
For helping others, I could add that I fixed this by implementing my own view that handles the paint event itself and only paints the rows currently visible on screen. This makes it extremely fast and no internal QT view seem to be able to do something similar.
If I turn the autocorrection ON, the words get autocompleted, as if I write "wor", I get "word" before I finish writing. I don't want this to happen because I might be writing "world" or any word different than the autocompleted one.
I set Correction off in the Interface Builder and this problem is solved.
The problem now is that I still need the suggestions that appear in a little popover below the incomplete words.
This two features might be different but I don't know how to activate the suggestions.
How can I solve this?
This can be solved with the use of tableview. Create a tableview with the width as of the width of the textfield and height as you like. Place it just below the textfield. Make it hidden initially. When the user starts typing, fetch the array of data that resembles to the typed text and if any exists then, unhide the table view. On the subsequent typing keep on reloading the tableview sections with animations. You should be accurate on hiding, unhiding and then reloading the data on the tableview. I have implemented such thing before. It is really easy and once you get started with it you find it easy.
In the UITextView TextViewDidChange I created a thread that changed the cursor position. This, off course happens after the text view changes. The change of the cursor position triggers the autocomplete without letting me even see that there had been a suggestion.
i want my app to be able to track a person when he moves 2 dimensionally upwards. I already have a vertical scroll view, and it works, but when i press a button i want it to track a little stick figure as he walks vertically, how can i control this? i thought of setting the scrollview.contentoffset to a certain position, but it just changes it one time when i want it to change it fluidly. i suppose i could make a timer that updates the contentOffSet every like .001 seconds or something, but i thought there maybe a better way.
Also, while i was searching the UIScrollView's methods, one of them was an isTracking method, which is a boolean, and I'm assuming it returns yes if the scrollview is tracking something, so given that i assume there is a feature in scrollview so that you can track things. Also, if to track things you have to use some other framework thing that would be helpful to know too
THANKYOU FOR ANY HELP!
The property tracking tells if the scroll view is currently tracking the user's movement. So that definitely won't help you out. (See David H's post for a better explanation for what the property indicates.)
However, you could use setContentOffset:animated: and set animated to YES. That results in a smooth transition to the new content offset.
Instead of calculating a reasonable content offset you might find it easier to specify an area that contains the stick figure. If so use scrollRectToVisible:animated:. Obviously animated should be set to YES.
1) don't use contentOffset = x;, use "- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated". Experiment how often you need to send this message, but I'm guessing you can do it no more than 10 times a second and get nice results.
2) isTracking means the user has their finger on the scrollView but has not started dragging it. By testing "isTracking" and "isDragging" you can determine if the user is fiddling with your scrollView or not.
Is it possible to make the table view allow scrolling only in one section and not others OR in other words allowing scrolling only in desired sections of the grouped table?
Many thanks.
Sure, this is entirely possible if you're willing to forego the use of a tableview. If you use a scrollview, you can achieve what you want by defining custom behaviour. It's not going to be easy but here are some suggestions:
Figure out how you want it laid out on the screen
Create a "floating cell" that will hang around, this will be your "not scrolling" section
With respect to #2 above, you'll have to figure out what kind of logic you want to make that floating cell disappear versus the other data.
The rest, you're effectively reimplementing a tableview.
Now, you can probably achieve this with a tableview, but it's be hairy big time.
I can make a single row IKImageBrowserView by setting the
[imageBrowser setContentResizingMask:NSViewWidthSizable];
but in this case while i drag an image inside image browser to rearrange it, the drop place highlights with horizontal line(vertical line expected).
how can this be changed?
Many thanks.
There is no defined way to do what you want.
You may be better off writing your own custom view where you can control every detail of how things are drawn. In general, Apple's controls are "as-is" and unless they provide an explicit way to control behavior or mention that you can custom an object in some way, don't count on being able to do it easily (if at all).
I would also suggest heading to http://bugreport.apple.com and making the enhancement request - it would be best if you attached a sample application demonstrating the behavior.
EDIT: You could also try out the NSCollectionView to see if it might work for you.