w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to properly reuse a cell in UITableView
Your main problem here is that you are recreating new views in your cell every time this method is called. You want to create all reusable elements inside the if(cell == nil) otherwise it will make duplicates. Anything that is dynamic must be created outside of this. I took your code and modified it. This should work better. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { // Everything that does not change should go in here! cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; UILab

Categories : IOS

UICollectionView + SDWebImage + Cell reuse
If I understand your problem correctly, you are getting old images still appearing in reused cells so in addition to stopping the previous image load you probably want to remove the old image from the imageView. SDImageView might have a method to clear the image or else you could just manually replace it with a placeholder image. - (void)prepareForReuse { [super prepareForReuse]; [self.thumbnailView.imageView cancelCurrentImageLoad]; [self.thumbnailView.imageView setImage:<<LOCAL PLACEHOLDER IMAGE>> forState:UIControlStateNormal]; }

Categories : IOS

UITableView: How to utilize cell reuse identifier?
The table view manages separate queues of cells for reuse for each identifier. So for example, if the cells should have a diiferent appearance for even and odd rows (just as an example), you could do NSString *cellIdentifier = (indexPath.row % 2 == 0 ? @"EvenCell" : @"OddCell"); UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; if (indexPath.row % 2 == 0) { // set cell properties for even rows } else { // set cell properties for odd rows } } Using different reuse identifiers guarantees that a cell from an even row is not reused as a cell for an odd row. (This example woul

Categories : Objective C

Cell reuse issue in table view iphone
If you're reusing a cell, that cell (and all of its properties) are the same as they were before. So, your code if([[[self.Contents objectAtIndex:indexPath.row]status] isEqualToString:@"Failed"]) { cell.textLabel.textColor = [UIColor redColor]; } will set the text red in that condition. If the condition is false, then the text colour is not changed. However, if the colour was changed to red before, it is still red. Just add code to set it to the appropriate colour in the other condition. if([[[self.Contents objectAtIndex:indexPath.row]status] isEqualToString:@"Failed"]) { cell.textLabel.textColor = [UIColor redColor]; } else { cell.textLabel.textColor = [UIColor blackColor]; }

Categories : Iphone

Server registering client ID twice for Socket() call
Your problem could be in that you're calling the SocketAccepted delegate twice: SocketAccepted(sock); if (SocketAccepted != null) { SocketAccepted(sock); }

Categories : C#

Call a sub when a cell is a certain value
By taking advantage of the Worksheet_Change event you can run some code for each change to a particular range. Below is an example tailored to your use-case: Private Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range ' The variable KeyCells contains the cells that will ' cause an alert when they are changed. Set KeyCells = Range("D70") If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then If KeyCells.Value = 0 Then StartBlinking Else StopBlinking End If End If End Sub

Categories : Vba

How to call one cell of a database?
It sounds like you want a particular row, in which, case you would just changes your query to filter for some specific value that identifies the row. THis might look something like this: SELECT * FROM products WHERE product_id = ? Where ? is the known product_id value that you want to receive the full record for. Also, since you are just learning, I should point out that you should not learn to use mysql_* functions. They are deprecated. Learn mysqli or PDO for interacting with MySQL.

Categories : PHP

Phone Call within Table Cell
There are a couple of approaches you could take to achieve this. But firstly, I don't understand what you are doing at the bottom of -tableview:cellForRowAtIndexPath:. It's as if you are trying to define your IBAction method inside this method. You also have it defined at the bottom of the implementation, but in that method the number variable is not in scope. Anyway, you should subclass the UITableViewCell. In the implementation for the subclass, you should define the IBAction method and hook it up in interface builder, or otherwise. When the button is tapped, you should hand the number for the selected cell back to the PictureListMainTable view controller, in order for that view controller to process it (i.e. call the number). You can do this in two ways: 1) the delegate method Creat

Categories : IOS

VBA - Call function to each cell within a column using a Button
I hope this can at least get you started. More info and a better question will result in me providing you a better answer. Sub Button1_Click() Dim LastRow As Long If Range("A1") <> vbNullString And Range("A2") <> vbNullString Then LastRow = Range("A1").End(xlDown).Row ' how many rows have data within the column End If With Range("B1:B" & LastRow) 'Last row in A so you know how many rows to use .FormulaR1C1 = "=yahooPage(RC[-1])" .Value = .Value 'Removes the formula and leaves only the values. End With End Sub

Categories : Excel

Understanding UITableView dequeueReusableCellWithIdentifier - returns cell even on the first call
because the first time the cell is nil that is why this gets called: if (!cell) { NSLog(@"New cell"); cell = [[UITableViewCell alloc] initWithStyle:someStyle reuseIdentifier:someIdentifier]; } but then if the cell is already ready for reuse and basically its not nil - it returns the cell and it does not hit the above if statement

Categories : IOS

Call method from UITableView Cell subView in iphone application
Set you button in UITableViewCell with Tag like bellow:- addButton = [UIButton buttonWithType:UIButtonTypeCustom]; addButton.Frame=CGRectMake(400,2,42,42); [addButton setTitle:@"Record Video" forState:UIControlStateNormal]; [addButton addTarget:self action:@selector(tab1Action:) forControlEvents:UIControlEventTouchUpInside]; addButton.tag=indexPath.row; [addButton setImage:[UIImage imageNamed:@"popuptab1j.png"] forState:UIControlStateNormal]; addButton.clipsToBounds=YES; [[cell contentView] addSubview:addButton]; -(IBAction)tab1Action:(UIButton *)sender { NSLog(@"=== > %d",sender.tag); //apple your Logic } NOTE:- use [[cell contentView] addSubview:addButton]; instead of use [cell addSubview:addButton]; and also you not s

Categories : Iphone

How to call a specific cell selection based on user interaction in UITableView
In -tableView:cellForRowAtIndexPath: set the selectionStyle to UITableViewCellSelectionStyleNone Or you do it in interface builder (The goal is to avoid blue/ or gray selection) -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"SomeCellIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell){ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } // Configure your cell return cell; } Then in -tableView:didSelectRowAtIndexPath: customize the beha

Categories : IOS

Is there any way to get a macro or module to change the copy destination cell from one cell to another cell in the next row with each run?
In order to do that, you can do it a couple of different ways: Method 1 In your macro, you will need code that counts how many sheets exist in the workbook. Then use that number to determine what cell on Sheet1 should be copied to cell B10 on the new sheet. This method has some pitfalls if you have other sheets in your workbook. Method 2 Store the row number of the cell you want to copy in a cell somewhere on Sheet1. Every time your macro runs, retrieve that value to determine which cell to copy to the new sheet, then increment that value, so the next time the macro runs, it will get the next cell. This method is probably the most straight-forward, but you need to make sure that you don't accidentally erase or alter the cell containing your current row number.

Categories : Excel

Find value from one cell, copy value from cell near to that cell and paste it to another sheet
Use a VLOOKUP along with an IFERROR. =IFERROR(VLOOKUP(A1, Sheet1!A:B, 2, 0), "") This will do what you described (well described, by the way!) in your question. Drag the formula down in Sheet2 till the bottom. VLOOKUP takes the value of A1 in sheet 2 (no sheet reference because the value is in the same sheet as the formula) and looks it up in column A of Sheet1. It returns the second value (hence why 2) of the table selected in the formula (column A is 1, column B is 2). The 0 tells the VLOOKUP to look for exact matches. You don't need approximate match here. And IFFERROR is there in case VLOOKUP doesn't find anything (like with ada) and instead of giving #N/A, returns an empty cell, "".

Categories : Excel

I want to move the value from Cell B to Cell C if Cell A values is changed
Private Sub Worksheet_Change(ByVal Target As Range) CR = Target.Address SplitCR = Split(CR, "$") CC = SplitCR(1) CR = SplitCR(2) If CC = "A" Then CellBValue = Range("B" & CR) CellCValue = Range("C" & CR) Range("B" & CR).Value = CellCValue Range("C" & CR).Value = CellBValue End If End Sub Paste the above code in your sheet.

Categories : Excel

How to call render method of a cell view from the editor view upon change event?
You are listening on an event from a constructor of a view. EditorView is a constructor function and not an instance of the view. You should either use global messenging to communicate between views: var EditorView = Backbone.View.extend({ //..... change : function() { Backbone.trigger('editor:change'); } }); var CellView = Backbone.View.extend({ initialize: function (optionValues,multiple) { this.listenTo(Backbone,'editor:change',this.render); } }); Or pass the editor's instance in the creation of the cell view: var CellView = Backbon.View.extend({ initialize: function( options ) { this.editor = options.editor; this.listenTo( this.editor, 'change', this.render ); } }); I think the global messenging style is clearer and offers more flexibility.

Categories : Javascript

Vim key map not registering
This could be a problem with your terminal emulator which may encode the alt key different from what vim expects. Ctrl+v causes vim (and most shells) to output the next character or key combination verbatim (literally). This way, you can insert the keycode produced when you press Alt+r directly into your configuration file by adding set <M-r>=^[r set <M-R>=^[R where the escaped characters like ^[x have to be entered by pressing Ctrl+v and then Alt+x and may produce a different result on different terminal emulators. Notice that there are no spaces around the equal signs. Vim would interpret additional spaces as part of the assignment which would make the directive misbehave.

Categories : Vim

Registering a COM dll on another machine
Currently no... (The Less You Know, the Better) It put just this simple Line out. But it works. I use regasm.exe to implement my COM-ActiveX Controls. If you want more Information you have to use OleView.exe, it's shows you a great Overview about the OLE and Interfaces at COM.

Categories : C#

Excel 2010 If Cell = N/A then value from another cell, if not N/A then value from a different cell
I think this is pretty close to what you want in cell D1 but your conditions for choosing C1 are not clear. =IF(AND(A1 <> "N/A", OR(B1 = 1, B1 =0)),B1,C1) N/A would need to be the text "N/A" for this to work If N/A is the Excel error Type #N/A then you should use =IF(AND(Error.Type(A1) <> 7, OR(B1 = 1, B1 =0)),B1,C1) as suggested by chuff in the comments

Categories : Excel

ZF2 RoleUserBridge: not getting inserted after registering
Well Justin, everything is fine in this bridge module but lacking the documentation about how to actually execute the insert action. I have gone through the module on Github and found this. You have to actually make a call to the Service/Mapper insert function by handling the "register.post" event thrown by "zfcuser". Check out the code below. This is my Application's "Module.php" class "bootstrap" event handler //----keep what was there before-------- $serviceManager = $e->getApplication()->getServiceManager(); //zfcuser_user_service --- provided by ZfcUser module $userService = $serviceManager->get('zfcuser_user_service'); //handling "register.post" event $userService->getEventManager()->attach('register.post', function(endEventManag

Categories : PHP

Building VB6 projects without registering
It means the original developers probably did not set the "binary compatibility" correctly. Which means the VB6 dll's get a "new com guid" every time they are built. Which means your original VB6 developers were probably a bunch of hacks. You can read the section here on Binary Compatibility. http://support.microsoft.com/kb/161137 Get in a time machine and go back and punch the person in the face who said "We don't need to work out the binary compatibility issues now, we'll just unregister and re-register the components... Easy Peezey!"................ If I'm wrong, please let me know. But every time I've seen "unregister the com" and "re-register the com".........it goes back to that brainiac decision. Here is a longer discussion on it: http://www.techrepublic.com/article/demystif

Categories : Tfs

Need to know what is the best practice for registering commands
Java allows for you to make multiple constructors for a single class as long as each constructor takes a different type or types of arguments. for instance public class Thing { private int value; public Thing(int i) { value = i; } public Thing() { value = 0; } } So rather than constructing the class with two null values for it's arguments, create a constructor with no arguments and deal with that case within the class. This will make it easy to change if in the future you decide to change standards for the case when the class is built with no arguments.

Categories : Java

iOS: Cells are not registering with TableView
after setting datasource call the reload table method as [self.tableview reloadData]; Try this - (void)viewDidLoad { [super viewDidLoad]; self.tableView.dataSource = self; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; [self.tableview reloadData]; }

Categories : IOS

Listbox "Click" not registering - how t o fix?
Hum... Listbox.ItemIndex = -1 means that you click in the empty area. With the mouseevent, it should do the trick. Another option : Maybe you could try to check the component having the focus, instead of using the click event. EDIT : Not having a Delphi5 available, i can tell you that this 'bug' is fixed in XE. Set a Timer and check which listbox has the focus (Listbox.Focused), if hopefully this property is available.

Categories : Delphi

error checking not registering
Note that the check occurs in your setBalance() method, but you never call this method. In particular, your constructor sets the balance field directly without a similar check One way to fix this (and reduce duplication at the same time) is to call setBalance() (and the other setters) from your constructor.

Categories : Java

JNI in Windows not registering function
Got it. For anyone that would like to know, the issue was the move of the javah-compiled header file to the project. I had to manually go into the VS2010 studio project and put in the header file (rather than copy pasting it in the editor) than include it in the main .cpp file

Categories : Java

IntentService registering Callbacks
Is it safe to use IntentService to make a job of that kind? No. Once onHandleIntent() returns, the service is destroyed, if no new commands were received in the meantime. It is not safe to try to perform asynchronous operations from an IntentService, as not only is the service gone when the operation completes, but the whole process might be terminated (as with any background process, particularly one with no running services). should I use some BroadcastReceiver + Service pattern? I don't know about the BroadcastReceiver part, but you are certainly welcome to use a regular Service. Be sure to call stopSelf() when your work is complete.

Categories : Android

Registering all exeptions from rails app
I won't comment on whether I think this is the right approach to this problem... but this was a fun little metaprogramming challenge. The thing to realize is that raise, like most things in ruby, is just a method. So you can alias method chain it and do whatever you want before or after calling the original, giving you effectively a "before" and "after" hook on the raising of methods. Here's an implementation of your pseudo code above. The one thing you DON'T get with this is a handle on the actual instance of the exception being raised, so you couldn't, for example, include a stack trace in the email sent to you. I'm not sure if there would be a way to get your hands on that exception, since the creation of it is in C code. But here you go: module Kernel @@registered_exceptions ||=

Categories : Ruby On Rails

Registering a Directshow Filter
Regsvr32 does generic COM registration, which involves running DLL's registration code, which in turn not only registers COM classes, but also does registration of hosted DirectShow filters. That is, regsvr32 is the registration that does it in full, there is nothing else. The registration might fail for reasons specific to DLL code (esp. bugs), in particular the typical reasons for failure include: attempt to register with missing static link dependency (or, C runtime dependency) attempt to register without elevating UAC privileges Codec packs more often evil than not. You don't know what it drags into machine and how exactly it tweaks its defaults. It is always safer to install individual filter you need.

Categories : C#

Registering events works only first time
This is a very JQuery-ish way to add events. You are dealing with components and should add event listeners on components. If you need to delegate events down to html elements then you need to set a single event listener on the Component encapsulating the elements and add delegate config to the actual html elements. Here are some resources: extjs 4 event handling tutorial Event delegation explained: http://www.sencha.com/blog/event-delegation-in-sencha-touch (applies to extjs just as well) More on Listeners with extjs: http://stackoverflow.com/a/8733338/834424

Categories : Extjs

multiple clicks registering in pygame
The reason that it cycles through is because you hold down the mouse long enough for it to check three times. I think if you have it wait between clicks, or you have it check not every time a cycle, it should be fixed.

Categories : Python

Registering a SAS library in Metadata - programmatically
@user2173800 Did u ever recieve a solution to the question above? Here is what i came up with : The below Code creates a SAS Library called BASE_Metalib under the Metadata folder :/Shared Data/Libraries/BASE_Metalib (this folder is assumed to already exist in Metadata). The code also resgisters all tables under this Directory defined for this Library. The below code uses Metadata Datastep functions to Interface with metadata. /*Creating a Metadata Library with BASE Engine and register all the tables under it */ options metaserver="taasasf2" metaport=8561 metauser="testuser" metapass="test123" metarepository="Foundation"; %Let MetaLibName=BASE_Metalib; /* Name of the SAS Library with BASE Engine to be created */ data _null_; length luri uri m

Categories : Sas

If statement not registering "save" rails 4
The reason is you used render instead of redirect_to. flash is something stored in session which will only take effect on next request. In your controller, there is only one request, the flash is still some old info stored in session and render won't update it. To fix, replace render with redirect_to

Categories : Ruby On Rails

access_token for Facebook Registering Achievement
You can not test this in the Graph API Explorer. It didn't return any JSON, instead you have to get the content from the - https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials You can test it by simply running it in your browser, you'll get the result in format- access_token=APP_ID|XXXXXXXXXXXXXX

Categories : Facebook

neo4j registering object into field
In Neo4j property values can be primitives, Strings or arrays of them, see http://docs.neo4j.org/chunked/stable/graphdb-neo4j-properties.html. To build up more nested structures you should make them explicit in the graph. A nested property might become a node that connected to the originating node.

Categories : Neo4j

Click event not registering with jQuery
Try this, if a is not created dyanmically, if a is created on runtime then need to bind while creation time. <script type="text/javascript"> $(function () { $("body").on({ // When ajaxStart is fired, add 'loading' to body class ajaxStart: function () { $(this).addClass("loading"); }, // When ajaxStop is fired, remove 'loading' from body class ajaxStop: function () { $(this).removeClass("loading"); } }); $("a").click(function () { $(this).addClass("loading"); }); }); </script> Demo

Categories : Jquery

JQM registering same even multiple times on same object
I think it has to do with this code. You are attaching another click event to the anchor items every time you navigate to the search page. Here is jsfiddle to demonstrate http://jsfiddle.net/d2Jzb/ // This event register is being registered multiple times $('#catList').on('click', 'li a', function(){ var href = $(this).attr('href'); var id = href.split('='); console.log('spLoadCategoryResults('+id[1]+')'); spLoadCategoryResults(id[1]); // return results from database }); That click event appears to be independent from anything happening in the pagebeforeshow event. Just take the event declaration out of the pagebeforeshow event declaration.

Categories : Jquery

registering windowsbase assembly SqlServer CLR
Could this be of any help? CREATE ASSEMBLY [WindowsBase] FROM 'C:WindowsassemblyGAC_MSILWindowsBase3.0.0.0__31bf3856ad364e35WindowsBase.dll' WITH permission_set = unsafe go

Categories : Dotnet

ios dynamodb not registering tables properly
I'm one of the maintainers of the AWS SDK for iOS. I'm sorry for the trouble. It appears with a recent update to this sample we lost the change in default to the us-west-2 (Oregon) region for this sample. This is controlled by the endpoint set on the AmazonDynamoDBClient at creation time. You can simply modify the code in AmazonClientManager.m to add the following: ddb.endpoint = [AmazonEndpoints ddbEndpoint:US_WEST_2]; This will create/use the table in the us-west-2 region.

Categories : IOS

CSS button/link not registering on some clicks
It is because you are moving the button with the :active selector. The top of the element changes by 8px and this happens before the click event is registered with Javascript. So when you click within the top 8 pixels the click won't register. You could achieve the same effect by also changing the padding-top value within :active. a.fatButton:active { top:8px; padding-top:16px; box-shadow: none; } Updated fiddle: http://jsfiddle.net/NT5e2/

Categories : CSS



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