w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
tableView:didDeselectRowAtIndexPath: not called until first user-initiated selection and deselection
This is too long for comment so I'm posting this as an answer. Just created test project with tableView. I call [UITableView selectRowAtIndexPath:animated:] on viewDidLoad and I have one cell selected. Then I'm selecting another cell (without deselecting first one). I have this output: [SDTVTViewController tableView:willSelectRowAtIndexPath:] [SDTVTViewController tableView:willDeselectRowAtIndexPath:] [SDTVTViewController tableView:didDeselectRowAtIndexPath:] [SDTVTViewController tableView:didSelectRowAtIndexPath:] And I have first cell deselected and second one selected. I have no idea, why it's not working in your code. When you're calling [UITableView selectRowAtIndexPath:animated:] and can you post code of UITableViewDelegate methods that you've implemented?

Categories : IOS

Using tableView:didDeselectRowAtIndexPath: to edit a UITextField in a cell
Not sure how proper the practice is, but I have an app I use a textField that is 1x1 points and off screen. If I want to bring up the keyboard, I call [self.myTextField becomeFirstResponder]; Then you can use the UITextFieldDelegate methods to control and update information being entered on the keyboard. Then when the user is done, I call [self.myTextField resignFirstResponder]; Of course this is assuming that you don't actually want to use a textField in your tableView. Hope this helps.

Categories : IOS

Android Activity onDestroy() is not always called and if called only part of the code is executed
Take a look at this: Activity OnDestroy never called? And this: http://developer.android.com/reference/android/app/Activity.html#onDestroy%28%29 Basically, there's never a guarantee that onDestroy() will be called, and in some cases processes such as your app will be killed directly, bypassing the method call anyway.

Categories : Android

Android Service's onBind isn't being called and onDestroy is being called even with a client connected
I've found out that my onBind wasn't being called when reconnected with the Service. So, I started to return 'true' in the onUnbind. This way, the onRebind is called when the Activity reconnects to the Service. Then, I'm still keeping track if there's any client connected and my resource cleaner just calls stopSelf if there's no client connected. Anyway, I think it is a bug. The documentation tells me that a Service that is both started (startService()) and bound (bindService()) isn't destroyed (onDestroy()) until both all clients are disconnected and the stopService/stopSelf is called. So, when my resource cleaner calls stopSelf(), the service shouldn't be destroyed, since there's a client connected (when the client reconnects).

Categories : Android

alert() called on new window seems to be called from opener page if using jquery's methods
Seems like this is the way jQuery handles <script> tag. domManip function in jQuery source code: // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } domManip will strip all the <script> elements, evaluate them in global context and then disable. domManip is called by append() method: append: function(

Categories : Javascript

HttpGet works fine if called directly but issues a 400 response if called from Android Activity
OK Folks check this out Keep it very simple - it is not the script that is bad, No sir.. Your Web.Config may have a HttP conflict that 400 error is asking to load a webpage that is not responding. So you must check a few minor details minor bcs you know the script is good so now you have to check your setting and how the computer and browser responds... To Resolve try this First Clear your DNS Cache and delete cookies 1. Reset your web browser then go to script replace website.com with actual web url. 2. for service, replace webHttpBinding with basicHttpBinding 3. Make sure your header lines are not long remember keep it simple For further assistance email me Frankieperez@yahoo.com

Categories : Java

Member function called PlaySound() causes linker error when called
My assumption based on the type of error you're getting and the fact that your function is in a separate namespace is that there is the following snippet somewhere (probably in a microsoft include): #ifdef _UNICODE #define PlaySound PlaySoundW #else #define PlaySound PlaySoundA #endif // _UNICODE These types of #define statements are common in microsoft's internal headers because they are designed to handle both unicode and multibyte character encodings. In order to get around this issue, you might want to put the following before you use your code: #undef PlaySound

Categories : C++

didSelectRowAtIndexPath is being called in very rare cases or not being called most time
You have to write code to deselect the row ,Otherwise it will remain selected.And I think it is the reason for your problem.So do this - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; }

Categories : Iphone

In a Lua file called foo.lua, what would the difference be between a variable called self.bar, foo.bar, and bar?
Metatables Metatables are used to overload common operations in the language. These operations can include such things as addition, multiplation, equality comparisons and (as the name would imply) table like operations such as accessing a value via a key table[key]. Metatables are often used to implement Object Oriented programming in Lua. The primary mechanism by which this is driven is the use of __index. This example will illustrate this in the most basic form: >>> parent = {parentID = 'Secret'} >>> child = {} >>> setmetatable(child,{__index=parent}) >>> =child.parentID Secret The key parentID doesn't actually exist within child, so nowhere in child is there something like the following: child = { parentID = 'Secret' } Instead, we

Categories : Lua

How do called functions return to their caller, after being called?
The compiler obeys a particular "calling convention", defined as part of the ABI you're targeting. That calling convention will include a way for the system to know what address to return to. The calling convention usually takes advantage of the hardware's support for procedure calls. On Intel, for example, the return address is pushed to the stack: ...the processor pushes the value of the EIP register (which contains the offset of the instruction following the CALL instruction) on the stack (for use later as a return-instruction pointer). Returning from a function is done via the ret instruction: ... the processor pops the return instruction pointer (offset) from the top of the stack into the EIP register and begins program execution at the new instruction pointer. To cont

Categories : C

If .off automatically called when .remove is called?
Well according to the documentation events are removed as well: http://api.jquery.com/remove/ Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead.

Categories : Javascript

Method being called 9 times, should be called once
Each time that cellForRowAtIndexPath calls the currentDataValues method, the dictionary inside that method is created and therefore windDirection called. You should create that dictionary once, for example in viewDidLoad and store it in a property or instance variable of the table view controller.

Categories : Objective C

TSQL statement in OSQL fails when called from a batch file called from a batch file
I'd change the EXIT to an EXIT /B EXIT terminates the CMD session. exit /b optionalerrorlevelnumber terminates the current batch, optionally returning an errorlevel.

Categories : Sql Server

Service is destroyed if called from same file, but not if object of that service is created (and called from seperate file)
This is because in your onReceive method you instantiating a service instead of using existing one. So you just need a reference to your exicting service instance and then you should call finish() method on it.

Categories : Java

In VB.Net, What is this called --> �
This is the Unicode Replacement Character, which is inserted instead of invalid Unicode characters. It has no special VB.NET name. The most common cause is using an incorrect encoding when reading a file. You're probably reading it as UTF-8 now, but you need to change that to the actual encoding used by the file (likely Windows-1252 or something like that, but it depends on where the file comes from).

Categories : Dotnet

Get and Set not being called
To everyone: Thanks for your help, I found the issue- the issue was Visual Studio, not the code. I closed VS, restarted the PC, opened VS, cleaned the solution, closed, reopened, built. There was an error in one of my referenced assemblies that was not appearing all the other times I built the project that appeared this time, and fixing that error caused all of this to work properly. I'd have never found this without your help (I'd still be scratching my head wondering how my code was wrong) so thank you all so much! :)

Categories : C#

Will Foo(Foo x){ } ever be called in C++?
Have you actually tried to compile this code? Error 1 error C2652: 'Foo' : illegal copy constructor: first parameter must not be a 'Foo' main.cpp 5 1 NativeConsoleSketchbook C++11 standard, 12.8.6: A declaration of a constructor for a class X is ill-formed if its first parameter is of type (optionally cv-qualified) X and either there are no other parameters or else all other parameters have default arguments.

Categories : C++

CanMoveRowAtIndexPath is never called
as per docs For the reordering control to appear, you must not only set this property but implement the UITableViewDataSource method tableView:moveRowAtIndexPath:toIndexPath:. In addition, if the data source implements tableView:canMoveRowAtIndexPath: to return NO, the reordering control does not appear in that designated row. Implement - (BOOL) tableView: (UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndex toIndexPath:(NSIndexPath *)toIndex

Categories : IOS

What's that filter called?
I suppose you are talking about the Mean filter, or average filter: The basic idea behind filter is for any element of the signal (image) take an average across its neighborhood.

Categories : Javascript

HttpRequestRetryHandler not getting called
Try the StandardHttpRequestRetryHandler I think the HttpRequestRetryHandler öacks of necessary implementations. The DefaultHttpRequestHandler is another option.

Categories : Java

OnDateSetListener() not getting called
Create the DatePickerDialog after you declared the listener, like Rapunzel said. The listener will not work, because dateListener is null when you create DatePickerDialog instance. The DatPickerDialog object will not detect changes made to your listener. EDIT: Because dateListener is null at the time of calling DatePickerDialog(). If you look at the source of the DatePickerDialog, you'll see the private final OnDateSetListener mCallback. That means it references to null. That reference becomes immutable, since it is final. dateListener = new DatePickerDailog.OnDateSetListener will create the instance somewhere else in the memory (because of the new keyword), causing the reference to change. The reference in DatePickerDialog.mCallback will not change, since it is immutable.

Categories : Android

callback not called when value is set
Normal Callback controls action, triggers only when when a user clicks a push button or selects a menu item. A set of Value property of listbox property won't trigger the callback mentioned. One way to achieve this will be using guidata(hObject, handles); listboxColors_Callback(hObject,eventdata,handles); after setting Value in your function.

Categories : Matlab

onBindDialogView not called - Why?
What does your onCreateDialogView() return? onBindDialogView() is called only if you return a non-null custom view from in there. Also, onBindDialogView() is only called when you actually show the preference. Ref: Source code of DialogPreference. In particular, see showDialog() method If you just return the super implementation from your onCreateDialogView(), I suspect it returns null.

Categories : Android

OnActivityResult is never called
From the documentation: Note that this method should only be used with Intent protocols that are defined to return a result. In other protocols (such as ACTION_MAIN or ACTION_VIEW), you may not get the result when you expect. For example, if the activity you are launching uses the singleTask launch mode, it will not run in your task and thus you will immediately receive a cancel result.

Categories : Android

When is a c++ constructor not called?
In the case of yoyo c = b; it's the copy constructor that is called. And in the case of yoyo c; c = b; it's the copy assignment operator that is called. If you don't provide any of them, the compiler will generate default versions for you. If you want to create your own copy constructor, it could look like this: yoyo(const yoyo& other) : i(other.i) { std::cout << "copy constructor initialized "; } The copy assignment operator looks like this: yoyo& operator=(const yoyo& other) { i = other.i; return *this; } Both of them defined inside the class definition of course.

Categories : C++

focusOutEvent is not called
may be it wasn't called because it didn't match to declarion in QWidget virtual **protected** void QWidget::focusOutEvent ( QFocusEvent * event ) also you cant try to call setMouseTracking(true)(documentaion says no need in this but may be this can help) and it will be good to call a original event handler could you specify os you are running ?

Categories : C++

PHP init being called twice?
Since init() is called from the parent::__construct(..) you do not need to call it from the child constructor. PHP will call the correct init() method when the class is created. You have verified this when you removed the call to init from your child class and everything worked as expected. You can verify this by running this simple example that reflects more or less what is going on in your code. <?php class AParent { public function __construct() { $this->init(); } public function init() { echo "init parent "; } } class AChild extends AParent { public function __construct(){ parent::__construct(); } public function init(){ echo "init child " ; } } new AParent(); // Calls init from AParent new AChild(); //

Categories : PHP

A function is called twice in VB.NET
My immediate reaction is a sticky mouse button, but really it's likely due to the web page you are loading having multiple pages being loaded, thus adding the duplicate event handler. Put a breakpoint on this line of code: AddHandler Document.Click, New HtmlElementEventHandler(AddressOf Document_Click) You'll likely see it being hit twice. Make sure to only wire up one HtmlElementEventHandler to avoid the double firing of the click event handler. You can check e.Url for a match before wiring up as a possible solution.

Categories : Vb.Net

ValueProvider never being called
Try this public HttpResponseMessage Get([ValueProvider(typeof(DummyValueProviderFactory))] string foo) {... } I higly suggest you to read this recent article to customize Web Api Binding.

Categories : Asp Net

Why isn't onChronometerTick being called?
For anyone in the future who is having trouble using chronometer for an elapsed timer/stopwatch and can't figure it out, I ended up scrapping chronometer and using CountDownTimer, but using it in such a way that it would also count up: final long startTime = System.currentTimeMillis(); elapsedTimer = new CountDownTimer(activityTime + 1000, 100) { @Override public void onTick(long l) { long elapsedTime = System.currentTimeMillis() - startTime; elapsedTime = elapsedTime/1000; elapsedTimeTextView.setText(String.format("%02d", (elapsedTime))); } @Override public void onFinish() { } }.start();

Categories : Android

alertViewShouldEnableFirstOtherButton not called
UIAlertViewDelegate documentation says for alertViewShouldEnableFirstOtherButton: method, Sent to the delegate to determine whether the first non-cancel button ion the alert should be enabled. You are creating the alert with cancel button as @"ok", since non-cancel buttons is nil the method is not getting called. Instead try following, UIAlertView *alertview=[[UIAlertView alloc]initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil]; Also, user should have option to cancel the alert without having to enter text. It is good user experience to have a cancel button.

Categories : IOS

scrollViewDidScroll not getting called
My best guess here is that you're redefining the delegate property inside you NumberLineScroll class. Try deleting the @property(nonatomic, assign)id <UIScrollViewDelegate> delegate; line (and if you have a @synthesize statement in your *.m file delete that one too). Also, delete the following variable declaration: id <UIScrollViewDelegate> delegate;. Finally, just as a side comment, when you conform to a protocol (like UIScrollViewDelegate) you don't declare the methods that you implement in your *.h file. So, the following lines in your Game class are not needed: - (void)scrollViewDidScroll:(UIScrollView *)scrollView; - (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView; - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(

Categories : Objective C

jQuery's .done() and .always() never getting called
Try like this: $.ajax({ type: 'POST' url: '/api/email' data: { email: email} }).done((msg) -> console.log 'POST success' console.log msg ).always((msg) -> console.log 'Always' )

Categories : Javascript

OnItemClickListener is not being called
Does it crash? If yes, always provide us with the Stacktrace/Logcat. As far as I know, it´s impossible to directly change the interface from within any Thread other than the UI-Thread - you could either try Handler or use this. EDIT: OnPostExecute is actually called on the UI-Thread, so this is not a solution for this problem. (see here)

Categories : Java

TextFieldShoudReturn not being called
Have you enabled the respective class to be compatible with UITextFieldDelegate? Please goto the .h file of the current class, and make it compatible to UITextFieldDelegate. Eg: If your ClassName is HomeController I am assuming you are getting a warning something similar to this: Assigning to id<UITextFieldDelegate> from incompatible type "HomeController" Solution: @interface HomeController : UIViewController <UITextFieldDelegate> // YOur Class Variable. @end

Categories : IOS

Method isn't being called
How to you know it skips your method?. There is probably an exception. Raise the exception in your rescue block. def save_with_payment if valid? charge = Stripe::Charge.create({ amount: 400.00, currency: "gbp", card: stripe_card_token, description: email }) save end rescue Exception => e raise e false end

Categories : Ruby On Rails

Function gets called twice
Add this e.stopPropagation(). $('div').on('click', '[id^=network_picker]', function (e) { e.stopPropagation(); alert("YOU CLICKED IT!") }); And you seriously should use better ids. No commas or spaces and they should be unique!

Categories : Jquery

onSharedPreferenceChanged() Never called
try to call prefs.registerOnSharedPreferenceChangeListener(this) in onCreate in SettingsActivity. Calling it in Fragment, in inner class, will destroy the listeners when inner fragment is Paused, I suppose

Categories : Android

ISRS is not getting called
I have run into a similar problem before. In my case (and I am guessing yours as well), the compiler was removing the division by zero. I was able to work around this by using the volatile keyword in conjunction with a global variable. volatile int globalZero = 0; int myRtn (void) { volatile int error; ... error = error / globalZero; } Hope this helps.

Categories : C

OnInfoListener is never called
Well apparently it's a known bug in Android. When playing HLS stream it's just never calls OnInfoListener or OnBuffering. Look here for more details My so called solution was to create a thread now runs along side of the player, and checking its progress from time to time to determine if the playback is stopped - assuming that means the player is buffering. Here's my code for whom ever wants it private class BufferingThread extends Thread{ WeakReference<NewDefaultPlayer> player; long currentPos, lastSecond; boolean isBuffering, alreadyBuffering; private Object locker = new Object(); public BufferingThread(NewDefaultPlayer player) { this.player = new WeakReference<NewDefaultPlayer>(player); } private Runnable BufferStart = new Runn

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.