ios6

Access files owner view controller instance from subclass (using SWRevealViewController)

纵然是瞬间 提交于 2019-12-11 05:19:34
问题 I am using SWRevealViewController (https://github.com/Joan-Lluch/SWRevealViewController) and am trying to access the revealViewController instance that lives within the files owner view controller of a xib file from within a subclass. Basically, in the files owner of the xib, i access the instance by saying [self revealViewController] and am able to control it that way. My issue is that I have a search display controller in the xib file and I need to access [self revealViewController] within

stop popoverViewController resignFirstResponder after dismissed

不想你离开。 提交于 2019-12-11 05:12:57
问题 I am using a uitableview containing multiple rows, and each row contains two UITextFields side by side. let's say TextField1, TextField2. When a user taped on TextField1, and start typing, a popoverViewController shows up for suggestions. When the user tap on a suggestion from the popoverViewController, the popover dismissed (this is what i want), then the keyboard dismissed as well (this is not what i want). if now the user tap on TextField2, the keyboard comes up. I want to keep the

Wrong decoding of barcodes also in ZBAR SDK example

妖精的绣舞 提交于 2019-12-11 05:10:19
问题 I am using the ZBarSDK with a project for iPhone. I am using ZBar as an embeded reader. Basically hooking up a UIView in Interface Builder. Changing the class to ZBarReaderView and implementing the delegate method -(void)readerView: (ZBarReaderView*) view didReadSymbols: (ZBarSymbolSet*) syms fromImage: (UIImage*) img . This works fine most of the time. There are however barcodes that apparently do not scan correctly. The first block gets interpreted wrong. I get something like 5008914... the

XCode base_convert

China☆狼群 提交于 2019-12-11 05:08:49
问题 I am developing iOS application and I need base_convert function. Application is communicating with PHP server using base_convert, too. In PHP I use this: base_convert($something,16,36) and base_convert($something,36,16) I search for something like I use in PHP, but for Xcode (iOS application). Thank you. 回答1: there is a C++ implementation here: http://thinkdiff.net/mixed/base-conversion-handle-upto-36-bases/ that will convert back and forth with bases up to 36. Not sure if you need more than

add textfield to tableviewheader

≡放荡痞女 提交于 2019-12-11 04:42:48
问题 I am trying to add textfield to header view. I could not figure out why I can't see my textfield. When I use a label it works perfectly. Following is the code: -(UIView*) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ UIView *tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(40, 0, self.view.frame.size.width - 70, 30)]; UITextField *sectionTitleTF1 = [[UITextField alloc] initWithFrame:CGRectMake(58, 0, 500, 30)]; sectionTitleTF1.backgroundColor =

“Find my friends” style GPS (remotely ping for location)

邮差的信 提交于 2019-12-11 04:41:54
问题 In the "find my friends" ios app, a friend can ask for another person's location. Find my friends grabs the location in the background and the location services arrow appears momentarily. I am mainly concerned with the fact that the GPS arrow indicator is only shown when the user is pinged by a friend (does not remain on). My intended scenario: Bob opens the app and pings his friend John for John's location. John's phone momentarily shows the GPS arrow and in the background, sends back his

iOS 6.0 AutoLayout issue with constraints: subviews disappear when rotated

人走茶凉 提交于 2019-12-11 04:28:19
问题 Hi I have designed a XIB using AutoLayout constriants to display two rows of buttons, with three buttons in each row, as shown in the screenshot (I'll place the buttons in the Red UIViews after I get a satisfactory layout): So far so good, in portrait mode as shown above the buttons look fine. However when I rotate to landscape the header (in blue) and parent view (in grey) resize and appear correctly, but the red button views just disappear (see below). What is the best way to set the

IPhone Storyboard custom cell disappears when scrolling down

萝らか妹 提交于 2019-12-11 04:23:29
问题 I have just finished a project where I use a custom cell for my TableView in Storyboard. The problem is that when i scroll down the content in each cell is gone, which in my case is two Labels. This is the code I use to present each cell: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; MessageCell *cell = (MessageCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell

How do UIAlertView or UIActionSheet handle retaining/releasing themselves under ARC?

孤街醉人 提交于 2019-12-11 04:18:41
问题 I want to create a similar class to UIAlertView which doesn't require a strong ivar. For example, with UIAlertView, I can do the following in one of my UIViewController's methods: UIAlertView *alertView = [[UIActionSheet alloc] initWithTitle:nil message:@"Foo" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alertView show]; ... and the actionSheet will not be dealloced until it is no longer visible. If I were to try to do the same thing: MYAlertView *myAlertView = [