iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Automatically cell selected UITableView

My UITableView opens via PopOverViewController , so How can I load one of these cells automatically after app did load , the cell selecting process on MainViewController – (void)setDetailItem:(id)newDetailItem { if (detailItem != newDetailItem) { [detailItem release]; detailItem = [newDetailItem retain]; //—update the view— label.text = [detailItem description]; } } and cell selecting in TableViewController […]

SFSafariViewController: Hide navigation bar

I was able to get my app to automatically load a url via the SFSafariViewController per this post, and it works great, the only drawback is the navbar. The SFSafariViewController navbar is kind of useless when being used this way, as the url is read-only, and the ‘done’ link doesn’t do anything but reload the […]

What is the difference between arrayWithObjects and initWithObjects?

Can you please explain me exact difference between these two lines? NSArray *foo = [NSArray arrayWithObjects:@”hai”,@”how”,@”are”,@”you”,nil]; NSArray *bar = [[NSArray alloc] initWithObjects:@”hai”,@”how”,@”are”,@”you”,nil];

Writing text to a PDF via from an NSString

I am fairly new to iOS development and this one is killing me. I have not found one complete (simple) example of how to write text to a pdf on the iPhone. The Apple documentation on the subject is code snippets and difficult to follow (for me anyway), and having downloaded the Quartz demo I […]

Why am I getting this CPSqliteStatementPerform error in xcode console

I am getting the following errors in the xcode console, but I don’t know what read only data base it is complaining about: CPSqliteStatementPerform: attempt to write a readonly database for UPDATE ddd.ext_container SET orig_date_modified = (SELECT date_modified FROM container WHERE pid=container_pid) WHERE orig_date_modified=0 CPSqliteStatementReset: attempt to write a readonly database for UPDATE ddd.ext_container SET […]

AFNetworking post image in nested json

I have to send a nested json request which includes an image in an inner hierarchy. eg: {“product” : { “catalogue_id” : “x”, “name” : “my product”, “image” : #<image> } } Problem is if I try using multipartFormRequestWithMethod:path:parameters:constructingBodyWithBlock: (and appendPartWithFileData:name:fileName:mimeType:), passing in catalogue_id and name as params, the image field is appended after “product”, […]

NSString to treat “regular english alphabets” and characters like emoji or japanese uniformly

There is a textView in which I can enter Characters. characters can be a,b,c,d etc or a smiley face added using emoji keyboard. -(void)textFieldDidEndEditing:(UITextField *)textField{ NSLog(@”len:%lu”,textField.length); NSLog(@”char:%c”,[textField.text characterAtIndex:0]); } Currently , The above function gives following outputs if textField.text = @”qq” len:2 char:q if textField.text = @”😄q” len:3 char:= What I need is if textField.text […]

Connect object in .xib to existing IBAction

I am quite new to iOS Programming. This is my question: I want to connect a new object to an existing IBAction method. For example, I want to buttons to perform the same function. But when I “control-drag” it, it will always ask me to insert as a new method. How can I add to […]

Using UpdateChildValues to delete from Firebase

I am trying to delete data from several locations in the Firebase database simultaneously. The Firebase docs state: “The simplest way to delete data is to call removeValue on a reference to the location of that data. You can also delete by specifying nil as the value for another write operation such as setValue or […]

Using disk cached images if present in Alamofire Images

I’m using the AlamofireImage library to cache downloaded images. Code: import UIKit import AlamofireImage class ViewController: UIViewController { @IBOutlet weak var firstImageView: UIImageView! @IBOutlet weak var secondImageView: UIImageView! let downloader = ImageDownloader() let URLRequest = NSURLRequest(URL: NSURL(string: “https://httpbin.org/image/jpeg”)!) override func viewDidLoad() { super.viewDidLoad() requestFirstImage() } func requestFirstImage() { downloader.downloadImage(URLRequest: URLRequest) { response in print(response.request) print(response.response) […]