iphone


iphone - Difference between addSubview and insertSubview in UIView class

The only difference is in where the view is added: whether it is the frontmost view (addSubview:), or it is before the 5th subview, (insertSubview:atIndex:) or if it is immediately behind another sub... Read More


ios - Could not load the "" image referenced from a nib in the bundle with identifier

Select your image(s) in Project Navigator. Open the File Inspector. Make sure you have the target selected.... Read More


ios - UIButton title text color

use Objective-C [headingButton setTitleColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:113/255.0 alpha:1.0] forState:UIControlStateNormal]; Swift headingButton.setTitleColor(.black, for: .n... Read More


iphone - "Plain Style unsupported in a Navigation Item" warning with my customized Bar Button Item

I was able to remove these errors by manually editing the storyboard files and find the offending style="plain" entry on Bar Button items in the <navigationItem> element. Changed from: <barButtonItem... Read More


iphone - I want to sort an array using NSSortDescriptor

Take a look here: Creating and Using Sort Descriptors You can compare as case-insensitive. NSSortDescriptor *sorter = [[[NSSortDescriptor alloc] initWithKey:@"w" ascending:YES... Read More


ssl - Adding a self-signed certificate to iphone Simulator?

Just for Info, if someone still runs into that problem: simply drag & drop your .cer Files into your running Simulator window. You'll see Safari flashing and then the import dialog for your Certifica... Read More


iphone - add image to UIBarButtonItem using initWithImage:(UIImage *)image

Here's an example that creates a toolbar button from the Facebook logo. Create a pointer to an image (file already added to xCode), create a custom button, change the size of the button to match the... Read More


iphone - Getting thread id of current method call

NSLog(@"%@", [NSThread currentThread]);... Read More


iphone - ObjectiveC Parse Integer from String

I really don't know what was so hard about this question, but I managed to do it this way: [myStringContainingInt intValue]; It should be noted that you can also do: myStringContainingInt.intValue;... Read More


iphone - Round NSDate to the nearest 5 minutes

Here's my solution: NSTimeInterval seconds = round([date timeIntervalSinceReferenceDate]/300.0)*300.0; NSDate *rounded = [NSDate dateWithTimeIntervalSinceReferenceDate:seconds]; I did some testing an... Read More