Search Results

Search found 81 results on 4 pages for 'accessory'.

Page 1/4 | 1 2 3 4  | Next Page >

  • UITableViewCell Custom accessory - get the row of accessory

    - by Emil
    Hi. I have a pretty big issue. I am trying to create a favorite-button on every UITableViewCell in a UITableView. That works very good, and I currently have an action and selector performed when pressed. accessory = [UIButton buttonWithType:UIButtonTypeCustom]; [accessory setImage:[UIImage imageNamed:@"star.png"] forState:UIControlStateNormal]; accessory.frame = CGRectMake(0, 0, 15, 15); accessory.userInteractionEnabled = YES; [accessory addTarget:self action:@selector(didTapStar) forControlEvents:UIControlEventTouchUpInside]; cell.accessoryView = accessory; And selector: - (void) didTapStar { UITableViewCell *newCell = [tableView cellForRowAtIndexPath:???]; accessory = [UIButton buttonWithType:UIButtonTypeCustom]; [accessory setImage:[UIImage imageNamed:@"stared.png"] forState:UIControlStateNormal]; accessory.frame = CGRectMake(0, 0, 26, 26); accessory.userInteractionEnabled = YES; [accessory addTarget:self action:@selector(didTapStar) forControlEvents:UIControlEventTouchDown]; newCell.accessoryView = accessory; } Now, here's the problem: I want to know what row the accessory that was pressed belongs to. How can I do this? Thank you :)

    Read the article

  • Loading Accessory callout view for mkannotationview

    - by Zap
    I have a map annotation view that contains a rightcallout button which loads an accessory view which is a UIViewController class. I am using resuable annotations, but am wondering how I can pass updated information to my UIViewController class. Let's say I have 2 string values which map to 2 UILabels on my view. How can I update those values after the initial accessory view has already been loaded into memory as a resusable view? Any help would be appreciated.

    Read the article

  • Is it possible to populate HTML form field data in an iPhone UIWebView using external accessory fram

    - by Jon Smallberries
    I have an iPhone app where I'd like to load a remotely served HTML form into a UIWebView and then populate that form as data becomes available from an external accessory using the "External Accessory Framework." Right now the data is entered by hand. The proposed flow is: Fetch an HTML page containing a form and put it into a UIWebView When data becomes available from the external accessory, populate the form field(s) Submit the form Is it possible to do this by "injecting" data from the external accessory into the UIWebView when all required data has been retrieved from the external accessory? I cannot seem to find any good examples on how to use the external accessory framework to achieve this.

    Read the article

  • iphone table view check mark accessory problem

    - by Pankaj Kainthla
    I have a table with 50 rows. I want to select particular rows with checkmark accessory but when i select some rows and scroll down the table then i see pre checked rows. I know that table cell are reused but i want to emit this problem what can i do about this? - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // return [array count]; return 50; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; TableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[TableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } cell.textLabel.text=[NSString stringWithFormat:@"%i",[indexPath row]]; return cell; } // Override to support row selection in the table view. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell.accessoryType == UITableViewCellAccessoryNone) { cell.accessoryType = UITableViewCellAccessoryCheckmark; } else { cell.accessoryType = UITableViewCellAccessoryNone; }

    Read the article

  • Setting a UITableViewCell accessory type on some cells, but not all

    - by Sheehan Alam
    I have 8 cells that are being built in my UITableViewController. I would like to know how I can show a disclosure indicator on the 4th and 8th cells. Right now I am building it in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath though I am fully aware it is going to add a disclosure indicator to every cell cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    Read the article

  • iPhone TableView alternative options for Check Mark Accessory

    - by jimsis
    I'm looking for the best approach to this problem. In my tableview I have a list of options from which you can select one and only one. The problem is the selection to choose is not obvious without displaying more details on the option. If I use the disclosure indicator or button for the more detail, I lose the checkmark functionality. In searching around I see some have used the cell Image as a work around. I see others instead of using the standard disclosure button have created custom disclosure button looking like a checkmark. Haven't seen this one but is it viable (HIG) to add a button in the cell ('more info') to launch the next tableview. My thought was to use a disclosure indicator and on the second view in the navigation bar (where the edit button usually is) add a 'selectMe' button. I think I am probably manage to code either of the above, am just asking for information on what is the best (HIG) way. Example Option 1 Option 2 Option 3 (x) Option 4 Where x is the checked one But in order to know which is the best choice you need to see Option 3 (Header) Option 3-a Option 3-b Option 3-c Option 3-d Where even at this level option 3-c might have additional information. Any guidance you can provide would appreciated.

    Read the article

  • UITableView, having problems changing accessory when selected

    - by zpasternack
    I'm using a UITableView to allow selection of one (of many) items. Similar to the UI when selecting a ringtone, I want the selected item to be checked, and the others not. I would like to have the cell selected when touched, then animated back to the normal color (again, like the ringtone selection UI). A UIViewController subclass is my table's delegate and datasource (not UITableViewController, because I also have a toolbar in there). I'm setting the accessoryType of the cells in cellForRowAtIndexPath:, and updating my model when cells are selected in didSelectRowAtIndexPath:. The only way I can think of to set the selected cell to checkmark (and clear the previous one) is to call [tableView reloadData] in didSelectRowAtIndexPath:. However, when I do this, the animating of the cell deselection is weird (a white box appears where the cell's label should be). If I don't call reloadData, of course, the accessoryType won't change, so the checkmarks won't appear. I suppose I could turn the animation off, but that seems lame. I also toyed with getting and altering the cells in didSelectRowAtIndexPath:, but that's a big pain. Any ideas? Abbreviated code follows... - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* aCell = [tableView dequeueReusableCellWithIdentifier:kImageCell]; if( aCell == nil ) { aCell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:kImageCell]; } aCell.text = [imageNames objectAtIndex:[indexPath row]]; if( [indexPath row] == selectedImage ) { aCell.accessoryType = UITableViewCellAccessoryCheckmark; } else { aCell.accessoryType = UITableViewCellAccessoryNone; } return aCell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; selectedImage = [indexPath row] [tableView reloadData]; }

    Read the article

  • Accessory view in UITableView: view doesn't update

    - by Kamchatka
    I'm trying to add checkmarks to items when the user select rows in a table view. However, the view is not refreshed and the checkmarks do no show up: - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* oldCell = [self tableView:tv cellForRowAtIndexPath:[NSIndexPath indexPathForRow:selectedIndex inSection:0]]; oldCell.accessoryType = UITableViewCellAccessoryNone; if (indexPath.section == 0) { selectedIndex = indexPath.row; } UITableViewCell* newCell = [self tableView:tv cellForRowAtIndexPath:indexPath]; newCell.accessoryType = UITableViewCellAccessoryCheckmark; [tv deselectRowAtIndexPath:indexPath animated:NO]; } What could be a reason for that?

    Read the article

  • Update UIViewTableCell's background when accessory URL is clicked

    - by psychotik
    In the tableView:accessoryButtonTappedForRowWithIndexPath: selector, I want to update the backgroundColor of the cell. I can get the UIViewTableCell using cellForRowAtIndexPath: but I'm not sure how I can update its background color. The code beliw doesn't seem to work. [_tableView beginUpdates]; cell.backgroundColor = [UIColor grayColor]; [_tableView endUpdates]; Any suggestions?

    Read the article

  • EAAccessory Notification problem

    - by Deepak
    Hi, I am using a POS device for card swipe. its working good. i have used following codes. (id) init { self = [super init]; if (self != nil) { NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; EAAccessoryManager *accessoryMamaner = [EAAccessoryManager sharedAccessoryManager]; [accessoryMamaner registerForLocalNotifications]; [notificationCenter addObserver: self selector: @selector (accessoryDidConnect:) name: EAAccessoryDidConnectNotification object: nil]; [notificationCenter addObserver: self selector: @selector (accessoryDidDisconnect:) name: EAAccessoryDidDisconnectNotification object: nil]; NSArray *accessories = [accessoryMamaner connectedAccessories]; accessory = nil; session = nil; for (EAAccessory *obj in accessories) { if ([[obj protocolStrings] containsObject:@"com.XXXXX"] || [[obj protocolStrings] containsObject:@"com.YYYYYY"] ) { accessory = obj; break; } } if (accessory) { session = [[EASession alloc] initWithAccessory:accessory forProtocol:@"com.dailysystems.DS247"]; if (!session) session = [[EASession alloc] initWithAccessory:accessory forProtocol:@"com.usaepay.ipos"]; if (session) { self.deviceConnected = YES; [[session inputStream] setDelegate:self]; [[session inputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [[session inputStream] open]; [[session outputStream] setDelegate:self]; [[session outputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [[session outputStream] open]; } else { UIAlertView *accessoryInfo = [[UIAlertView alloc] initWithTitle:@"Alert!" message:@"Hardware is not connected." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [accessoryInfo show]; [accessoryInfo release]; } } } return self; } When i disconnect the accessory it gives me accessoryDidDisconnect and when i connect it gives me accessoryDidConnect, But Problem is after that accessory stop working it does not respond to command. i tried to release the alloc and alloc again but no use. Please tell me if some one have any idea how to get the accessory work again. Thanks in advance.

    Read the article

  • What is a good way for a custom accessory view in a UITableViewCell to message the table view contro

    - by Alex Gosselin
    Hi Everyone, I am working on adding a custom accessory view, (a button) to a UITableViewCell, and I need it to tell the table view when it is touched, but I can't figure out how to communicate to the table view what button was pressed. Ideally I'd like to somehow call a function like this: [controller tableView:view didSelectCustomButtonAtIndexPath:indexPath usingCell:self]; when my custom view button is pressed. Sorry if this is a bit vague, I'm not really sure how to explain this well. I am basically looking for how to mimic the implementation for tableView:didSelectRowAtIndexPath: without having to subclass UITableViewCell. Thanks for any help.

    Read the article

  • iPad: Detecting External Keyboard

    - by StuartW
    My app uses a UIAccessoryView to provide additional keyboard functionality (such as forward/backward tabs and arrows keys) for the virtual keyboard, but that causes UIKeyboardDidShowNotification to fire even when a physical keyboard is present (the accessory appears at the bottom of the screen). I'd like to check if a physical keyboard is attached when handling UIKeyboardWillShowNotification, to prevent the accessory view from appearing and to prevent my custom view from scrolling up (to make room for the non-existent virtual keyboard). I've tried examining the UIKeyboardFrameEndUserInfoKey key, but it returns a real size for the virtual keyboard, in spite of nothing being displayed. Is there any way to detect the presence of a physical keyboard to prevent this unwanted behaviour? Hmm, the plot thickens. I tried disabling the input accessory by returning nil from the inputAccessoryView property of the Responder object which triggers the keyboard. That suppresses UIKeyboardWillShowNotification and UIKeyboardDidShowNotification when there is a physical keyboard present, but keeps these notifications when there is no such keyboard. All good so far. Then I tried re-enabling inputAccessoryView only after UIKeyboardWillShowNotification had been received. This only fires when a virtual keyboard is needed, so it should allow me to reintroduce the accessory view in those circumstances. Or so I thought. Unfortunately, it seems the OS doesn't check inputAccessoryView after UIKeyboardWillShowNotification, so it fails to show the accessory view when it is needed :o( That leaves me with two options: Include the input accessory view, giving extra functionality for virtual keyboard users, but lose the ability to detect a physical keyboard and hence not supporting physical devices; or Exclude the input accessory altogether, preventing most users from accessing the extra keys, but allowing the app to work with a physical keyboard. Not a great choice, so I'm still keen to see if anyone else has addressed this problem!

    Read the article

  • How set accessory type when tabel view is enbled to editing?

    - by Madan Mohan
    Hi Guys, I am using the UITableView properties to edit it. theTableView.editing = YES; theTableView.allowsSelectionDuringEditing = YES; It is working fine, the row is selected and I am getting into the next controller but I need to display the the accessoryType in the row. I am using below line for that but even though it is not working. Is there any property or any thing missing to display the indiactor. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; I am using the below code for table view. theTableView = [[UITableView alloc] initWithFrame:tableRect style:UITableViewStyleGrouped]; theTableView.editing = YES; theTableView.allowsSelectionDuringEditing = YES; theTableView.delegate = self; theTableView.dataSource = self; theTableView.scrollEnabled=YES; theTableView.separatorColor = [UIColor lightGrayColor]; theTableView.autoresizingMask=YES; theTableView.allowsSelection=YES; theTableView.sectionHeaderHeight=5; theTableView.sectionFooterHeight=5; [myView addSubview:theTableView]; Please help me. THank You, Madan Mohan

    Read the article

  • UITableViewCells of different heights place their accessoryViews at different X positions

    - by Jasarien
    Hey Guys, My app has some table cells that vary in height. The cells can also have a UIButton set to be a detail disclosure button (round, blue with arrow) as their accessory view. Depending on the height of the cell, the accessory view is positioned differently. At first I thought it was my layout code for my cell that was causing the problem, so I set up a quick independent test that uses vanilla UITableCells to remove the possibility that it could be my fault. I set up a view in interface builder, and just added a view table cells to the view, set their heights to different values and then added a detail disclosure button to each. Nothing more, nothing less. This is what I see: I added the size guides (thanks to Xscope) so you can see the difference in the accessory view x positions. The heights are: top 37px mid 68px bottom 44px (default, untouched height) If I increase the height any heigher than 68px the accessory view doesn't move any further to the left. Is this a bug? Is there any way I can prevent this from happening?

    Read the article

  • Why is -[UISwitch superlayer] being called?

    - by Jonathan Sterling
    I've got sort of a crazy thing going on where I have an NSProxy subclass standing in for a UISwitch. Messages sent to the proxy are forwarded to the switch. Please don't comment on whether or not this is a good design, because in context, it makes sense as an incredibly cool thing. The dealio is that when I try to add this object as an accessory view to a UITableViewCell, I get the following crash: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UISwitch superlayer]: unrecognized selector sent to instance 0x5889740' Yes, I could just set the proxy's target as the accessory view, but then I would have to keep track of the proxy so that I could release it at the right time. So, what I really want is to be able to have the proxy retained by the table cell, and released when it is removed from the view just like a normal accessory view. So, why is -[UISwitch superlayer] (a method which does not exist) being called, and how do I save the world?

    Read the article

  • EAAccessory problem

    - by dragon
    I have developed code using EAAccessory , and its work fine... But when i disconnect EAAccessory, my application got exception like an error....I want to show an alert , while disconnecting EAAccessory.... I am using this line of code in my app (void)accessoryDidDisconnect:(EAAccessory *)accessory; But this event is not fired ..When i disconnect my accessory.... Can anyone help me ? Thanks in advance..........

    Read the article

  • Hibernate collection multiple types

    - by CaptainAwesomePants
    I have a class Player that contains a list of Accessory objects. There are two kinds of Accessories. SocketedAccessories have a list of SocketJewels, and MagicAccessories have a list of MagicEnchantments. At the database level, there is a players table that represents the player, and an accessories table that contains a list of accessories. Accessories have a type field that indicates whether they are socketed or magical, and the columns that are only used by one type are just left blank by entries of the other type. There are socket_jewels and magic_enchantments tables, representing the socket jewels or the magic enchantments on each accessory. I am trying to figure out the correct way to map this with Hibernate. One way would be for the player to have two lists of accessories, one for SocketedAccessories and one for MagicAccessories. That seems undesirable, though. What I want is a way to specify that player should have a field List<Accessory> accessories that contains both types of thing. Is there a way to tell Hibernate, in either hbm.xml or annotations, to do this?

    Read the article

  • Replacing a calloutaccessoryview in mkannotationview

    - by Mugunth Kumar
    In my viewForAnnotation delegate, I create a MKAnnotationView with leftCalloutaccessory as a info button. When the info button is tapped, I want to replace it with a UIActivityIndicator. So in the calloutAccessoryTapped delegate, I wrote view.leftCalloutaccessoryView = [UIActivityIndicator indicatorWithStyle:UIActivityIndicatorWhite]; The callout accessory seems to change, but it seems like the view doesn't get updated immediately. That's when the callout accessory gets hidden (by tapping another pin) and is re-opened, I see a spinner. But otherwise, I don't. I tried calling [view setNeedsdisplay] and [view setNeedsLayout] and [view layoutsubviews] as well but in vain. Any suggestions/pointers?

    Read the article

  • Is there a way to initialize ImageKit's IKSaveOptions to default to TIFF with LZW compression?

    - by Rei
    I'm using Mac OS X 10.6 SDK ImageKit's IKSaveOptions to add the file format accessory to an NSSavePanel using: - (id)initWithImageProperties:(NSDictionary *)imageProperties imageUTType:(NSString *)imageUTType; and - (void)addSaveOptionsAccessoryViewToSavePanel:(NSSavePanel *)savePanel; I have tried creating an NSDictionary to specify Compression = 5, but I cannot seem to get the IKSaveOptions to show Format:TIFF, Compression:LZW when the NSSavePanel first appears. I've also tried saving the returned imageProperties dictionary and the userSelection dictionary, and then tried feeding that back in for the next time, but the NSSavePanel always defaults to Format:TIFF with Compression:None. Does anyone know how to customize the default format/compression that shows up in the accessory view? I would like to default the save options to TIFF/LZW and furthermore would like to restore the user's last file format choice for next time. I am able to control the file format using the imageUTType (e.g. kUTTypeJPEG, kUTTypePNG, kUTTypeTIFF, etc) but I am still unable to set the initial compression option for TIFF or JPEG formats. Thanks, -Rei

    Read the article

  • iPhone Mobile Safari File System Access

    - by Jon Smallberries
    Is it possible to write to a file in a native iPhone application and have a Safari browser read from that file after having the browser opened from the native app? Alternatively (and this would be great!), would it be possible to launch a mobile Safari webapp from a native iPhone app, and have that application access the OS 3.0 External Accessory Framework? My assumption is no... Basically, I have a functioning iPhone app that wraps a simple mobile Safari webapp, but I'd like to utilize the external accessory framework once I have launched the Safari webapp from the iPhone app...

    Read the article

  • fixed-size tableView cell in iPhone?

    - by SeniorLee
    I want to have all same size(width) cells in tableView no matter what accessory they have. If text in a cell almost fits to a cell, If i click that cell, check mark(accessory at the right) is displayed and some of characters goes to next line. it's annyoing. It's ok to do wordwrap. I can adjust cell's height. But I dont' want a cell displays different number of characters in an line depends on it's clicked or not. How can I do that?? thanks.

    Read the article

1 2 3 4  | Next Page >