天道酬勤,学无止境

ios

UIButton not showing the text in iOS6

I am working with iOS6 and Xcode 4.5, I am getting an UI issue with some UIButton, some of the buttons title are not getting shown in my view. In an older version of iOS everything works as expected. Please see the following image. It's not showing the text "Button" while executing it on simulator

2022-01-19 02:41:19    分类:问答    iphone   objective-c   ios   xcode

UILabel inside nested UIStackViews inside UITableViewCell sometimes truncating

I have a tableview cell in one of my tables setup as containing the following view hierarchy The outer horizontal stackview is pinned to the cell's content view on trailing, leading, bottom and top edges. The right label is pinned to its parent stackViewHackView on trailing, leading, bottom and top edges Within my controllers code I've got the cells setup to be dynamic height to fit the content of the cells so they can grow or shrink depending on the content size tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 30.0 Regarding Auto layout setup. (Relevant

2022-01-19 02:40:19    分类:问答    ios   uitableview   autolayout   uilabel   uistackview

sectioned tableview index selection highlighting

I feel this should be a simple property, but for the life of me I've searched and cannot find the answer. I have a tableview index to the right of my table. When selected, it grays out everything. I'd like to mimic the iPod app, whereby when the index itself is selected, it is semi-transparent (alpha of maybe .4f). Any ideas?

2022-01-19 02:39:48    分类:问答    iphone   objective-c   ios   uitableview

iOS: addConstraints: crashing app

Problem I can't seem to adopt Auto Layout into my existing project. Details I was having the same issue before as this question presentViewController: crash on iOS <6 (AutoLayout) but none of the provided answers were a solution for me: I'm using all storyboard views with no xibs. My 'Use Auto Layout' setting is already turned off and I am using nothing but iOS 6. My view controller was initially crashing, so I set the constraints to be added with a delay and now my app crashes during any addConstraints: call. Worst part is that it won't tell me why. Code I will link my code, but its pretty

2022-01-19 02:37:07    分类:问答    iphone   objective-c   ios   nslayoutconstraint

How to determine when NSURLSessionTask's request begins?

I use NSURLSessionTasks and I'm trying to monitor how long some of my HTTP Requests take, what delegate method (or something else) can I monitor for when the NSURLSessionTask actually makes the initial request? If this were a NSURLConnection inside an NSOperation I'd just start a timer when I start the request but I don't have control over when tasks start.

2022-01-19 02:35:12    分类:问答    ios   objective-c   nsurlsession   nsurlsessiontask

Swift3 : Hide UITableView if Empty

I have a tableview, which I use as a part of the screen. @IBOutlet var tableView: UITableView! Sometimes I have data, and sometimes I don't. I want to display the table only when data is present and hide it when there is no data. I tried adding a constraint of height with lesser or equal to options. But if I do that, tableview is hidden even when I have data what should I do? I googled around and didn't find a solution, so asking here. Disclaimer: I am new to iOS/Swift development. Sorry if this is already answered

2022-01-19 02:33:53    分类:问答    ios   swift   swift3   ios10

Parse iOS how query object by properties found in related PFObject?

I am writing an iOS app and I am using Parse to store data on the server side. I have Users and each user can have a Car. I am trying to figure out how to write a query that allows me to get all users that have a car with year less than 2000 and with a certain color (lets say red). Each car has a relationship to the user and each user also has a relationship to their car. User <-> Car (one to one) I started using the PFQuery: PFQuery * userQuery = [PFQuery queryWithClassName:@"User"]; I am not sure how to handle the relationship in the query. So, I'm pretty much not sure how to get this done

2022-01-19 02:28:33    分类:问答    ios   parse-platform   pfquery

NSLinguisticTagger Memory Leak

I've been fiddling in Xcode 4.2 with iOS 5.0's new NSLinguisticTagger. My objective with this function is to take in an address book record and then spit out a composite name as an NSString, sort of like what ABRecordCopyCompositeName does, but taking into account naming order for East Asian languages and Hungarian (last first instead of first last). Here's the function: NSString *text = [self getLocalizedFullNameOfRecord:[contacts objectAtIndex:indexPath.section]; - (NSString *) getLocalizedFullNameOfRecord:(ABRecordRef) person { NSString *firstName = ABRecordCopyValue(person

2022-01-19 02:22:32    分类:问答    ios   memory-leaks   ios5   block

Checking for valid IP for connection with NSURLConnection

I currently have an ap that attempts to open a webview based on certain servers I am communicating with. However, I allow the user the capability to type in their own server IPs in case both the iphone/ipad and server(or other device) are not on the same network. However, I am attempting to use NSURLConnection to detect if I can open a connection with the given IP however NSURLConnection never returns an error, even if the server address(or even a random web address) is completely bogus. the .h @interface DetailViewController : UIViewController <UIPopoverControllerDelegate

2022-01-19 02:20:45    分类:问答    iphone   objective-c   ios   xcode

Is that possible to create multiple cells in one xib?

I found it can create different cells with different xibs, but I want to know is possible to create different cell in one xib? If possible, what should I can do this? Here is the code, I know it is wrong code, so can you guys help me to fix it? - (void)viewDidLoad { [super viewDidLoad]; [imageTableView registerNib:[UINib nibWithNibName:@"ImageTableViewCell" bundle:nil] forCellReuseIdentifier:@"oneImageTableViewCell"]; [imageTableView registerNib:[UINib nibWithNibName:@"ImageTableViewCell" bundle:nil] forCellReuseIdentifier:@"twoImageTableViewCell"]; } - (UITableViewCell *)tableView

2022-01-19 02:20:03    分类:问答    ios   objective-c   uitableview